Skip to content

Commit

Permalink
Add gNSI models (openconfig#1037)
Browse files Browse the repository at this point in the history
* Add gNSI models

---------

Co-authored-by: Darren Loher <[email protected]>
  • Loading branch information
wenovus and dplore authored Mar 4, 2024
1 parent 5d24889 commit 063f5a7
Show file tree
Hide file tree
Showing 8 changed files with 1,354 additions and 0 deletions.
10 changes: 10 additions & 0 deletions release/models/gnsi/.spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- name: openconfig-system-gnsi
build:
- yang/system/openconfig-system.yang
- yang/gnsi/openconfig-gnsi.yang
- yang/gnsi/openconfig-gnsi-acctz.yang
- yang/gnsi/openconfig-gnsi-authz.yang
- yang/gnsi/openconfig-gnsi-certz.yang
- yang/gnsi/openconfig-gnsi-credentialz.yang
- yang/gnsi/openconfig-gnsi-pathz.yang
run-ci: true
245 changes: 245 additions & 0 deletions release/models/gnsi/openconfig-gnsi-acctz.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
module openconfig-gnsi-acctz {
yang-version 1;
namespace "https://github.com/openconfig/yang/gnsi/acctz";
prefix oc-gnsi-acctz;

import openconfig-extensions { prefix oc-ext; }
import openconfig-system {
prefix oc-sys;
}
import openconfig-system-grpc {
prefix oc-sys-grpc;
}
import openconfig-types {
prefix oc-types;
}
import openconfig-yang-types {
prefix oc-yang;
}
import openconfig-gnsi {
prefix oc-gnsi;
}
organization
"OpenConfig Working Group";

contact
"OpenConfig working group
[email protected]";

description
"This module provides counters of gNSI accountZ requests and responses and
the quantity of data transferred.";

oc-ext:openconfig-version "0.2.0";

revision 2024-02-13 {
description
"Major style updates and move to openconfig/public from openconfig/gnsi.
Last commit at
https://github.com/openconfig/gnsi/commit/347935aac66135d5649dadb9583ed0914578aab0";
reference "0.2.0";
}

revision 2023-12-01 {
description
"Initial revision.";
reference "0.1.0";
}

typedef cmd-service {
description "enum CommandService.CmdServiceType";
type enumeration {
enum UNSPECIFIED {
value 0;
}
enum SHELL {
value 1;
}
enum CLI {
value 2;
}
enum WEBUI {
value 3;
}
enum RESTCONF {
value 4;
}
enum NETCONF {
value 5;
}
}
}
typedef grpc-service {
description "enum GrpcService.GrpcServiceType";
type enumeration {
enum UNSPECIFIED {
value 0;
}
enum GNMI {
value 1;
}
enum GNOI {
value 2;
}
enum GNSI {
value 3;
}
enum GRIBI {
value 4;
}
enum P4RT {
value 5;
}
}
}
typedef service-request {
description "enum RecordResponse.service_request";
type enumeration {
enum CMD_SERVICE {
value 4;
}
enum GRPC_SERVICE {
value 5;
}
}
}
typedef service-type {
description "enum cmd or grpc service type";
type union {
type cmd-service;
type grpc-service;
}
}

// gnsi.acctz client statistics
grouping client-counters {
description
"A collection of counters that were collected by the gNSI.acctz
module while servicing acctz clients.";

container client-counters {
description
"A collection of counters that were collected by the gNSI.acctz
module while servicing acctz clients.";
leaf history-istruncated {
type oc-yang:counter64;
description
"The total number of times that a RecordRequest resulted in
a RecordResponse being marked history-istruncated. ie: a
request was made for a timestamp that did not exist in the
history.";
}
leaf idle-timeouts {
type oc-yang:counter64;
description
"The total number of times that a client was disconnected
due to missing keepalives (ie: RecordRequests).";
}
leaf record-requests {
type oc-yang:counter64;
description
"The total number of RecordRequest RPCs that have been received.";
}
leaf record-responses {
type oc-yang:counter64;
description
"The total number of RecordResponse RPCs that have been sent.";
}
}
}

// gnsi.acctz producer statistics
grouping source-counters {
description
"A collection of counters for gNSI.acctz record production per
service request type.";

container source-counters {
description
"A collection of counters for gNSI.acctz record production per
service request type.";
list source-records {
key "service type";
// unique "service type";
description
"The total number of times the gNSI.authz module denied access
to a RPC.";

leaf service {
type leafref {
path "../state/service";
}
description
"service request type for the gNSI.acctz record.";
}
leaf type {
type leafref {
path "../state/type";
}
description
"service request application enum for the gNSI.acctz record.";
}

container state {
description
"Operational state for gNSI.acctz counters of record production per
service request type.";
leaf service {
type service-request;
description
"service request type for the gNSI.acctz record.";
}
leaf type {
type service-type;
description
"service request application enum for the gNSI.acctz record.";
}
leaf records {
type oc-yang:counter64;
description
"The total number of records produced for the service-request
type.";
}
}
}
}
}

grouping grpc-server-acctz-counters {
description
"A collection of counters from the gNSI.acctz module.";

container acctz-counters {
config false;
description
"A collection of counters from the gNSI.acctz module
for acctz clients and sources.";

container state {
description
"Operational state relating to acctz-counters.";

leaf counters-last-cleared {
type oc-types:timeticks64;
description
"The last time that the counters were cleared (reset to
zero). This value is reported as nanoseconds since epoch
(January 1st, 1970 00:00:00 GMT).";
}

uses client-counters;
}

uses source-counters;
}
}

// Augments section.
augment "/oc-sys:system/oc-sys-grpc:grpc-servers/oc-sys-grpc:grpc-server" {
when "config[contains(services, 'oc-gnsi:GNSI')]/enable = 'true'";
description
"Counters collected by the gNSI.acctz module.";

uses grpc-server-acctz-counters;
}
}
Loading

0 comments on commit 063f5a7

Please sign in to comment.