Skip to content

Commit

Permalink
Support gNPSI in OpenConfig (openconfig#1085)
Browse files Browse the repository at this point in the history
* (M) release/models/gnpsi/openconfig-gnpsi-types.yang
* (M) release/models/grpc/openconfig-grpc-types.yang
* (M) release/models/system/openconfig-system-grpc.yang

* Add gRPC connections and statistics in OpenConfig
* Add gNPSI as a gRPC service type

---------

Co-authored-by: Darren Loher <[email protected]>
  • Loading branch information
sallylsy and dplore authored May 30, 2024
1 parent c50178f commit 3c810f3
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 1 deletion.
6 changes: 6 additions & 0 deletions release/models/gnpsi/.spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: openconfig-gnpsi
docs:
- yang/gnpsi/openconfig-gnpsi-types.yang
build:
- yang/gnpsi/openconfig-gnpsi-types.yang
run-ci: false
38 changes: 38 additions & 0 deletions release/models/gnpsi/openconfig-gnpsi-types.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module openconfig-gnpsi-types {
yang-version "1";
namespace "http://openconfig.net/yang/gnpsi/types";
prefix "oc-gnpsit";

import openconfig-extensions {
prefix oc-ext;
}

import openconfig-grpc-types {
prefix oc-grpct;
}

organization
"OpenConfig working group";
contact
"www.openconfig.net";

description
"This module adds gRPC server type relating to gNPSI running on
a network device.";

oc-ext:openconfig-version "0.1.0";
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

revision 2024-05-29 {
description
"Initial revision.";
reference "0.1.0";
}

identity GNPSI {
base oc-grpct:GRPC_SERVICE;
description
"gNMI: gRPC Network Management Interface";
}
}
6 changes: 6 additions & 0 deletions release/models/grpc/.spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: openconfig-grpc
docs:
- yang/grpc/openconfig-grpc-types.yang
build:
- yang/grpc/openconfig-grpc-types.yang
run-ci: false
36 changes: 36 additions & 0 deletions release/models/grpc/openconfig-grpc-types.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module openconfig-grpc-types {
yang-version "1";
namespace "http://openconfig.net/yang/grpc/types";
prefix "oc-grpct";

import openconfig-extensions {
prefix oc-ext;
}

organization
"OpenConfig working group";
contact
"www.openconfig.net";

description
"This module adds gRPC server type relating to gRPC services running on
a network device.
The GRPC_SERVICE identity is used to create an extensible list of services
that can be instantiated, with a base set defined in this module. New
services can extend the identity to be included in the list.";

oc-ext:openconfig-version "0.1.0";
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

revision "2024-05-29" {
description
"Initial revision.";
reference "0.1.0";
}

identity GRPC_SERVICE {
description
"Base identity for a gRPC-based service.";
}
}
103 changes: 102 additions & 1 deletion release/models/system/openconfig-system-grpc.yang
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module openconfig-system-grpc {
import openconfig-system { prefix oc-sys; }
import openconfig-inet-types { prefix oc-inet; }
import openconfig-network-instance { prefix oc-ni; }
import openconfig-yang-types { prefix oc-yang; }

organization
"OpenConfig working group";
Expand All @@ -22,10 +23,16 @@ module openconfig-system-grpc {
to be included in the list.";


oc-ext:openconfig-version "1.0.0";
oc-ext:openconfig-version "1.1.0";
oc-ext:catalog-organization "openconfig";
oc-ext:origin "openconfig";

revision "2024-05-29" {
description
"Add support for gRPC connections.";
reference "1.1.0";
}

revision "2022-04-19" {
description
"Description and default value updates for grpc-server
Expand Down Expand Up @@ -97,6 +104,7 @@ module openconfig-system-grpc {
"Operational state relating to the gRPC service.";
uses grpc-server-config;
}
uses connections-top;
}
}
}
Expand Down Expand Up @@ -200,6 +208,99 @@ module openconfig-system-grpc {
}
}

grouping grpc-counters {
description
"Top-level container for gRPC counters.";
container counters {
description
"Operational data for gRPC counters.";
uses grpc-counters-top;
}
}

grouping grpc-counters-top {
description
"Top-level container of operational data for gRPC counters.";

leaf bytes-sent {
type oc-yang:counter64;
description
"The total number of bytes sent to the client.";
}

leaf packets-sent {
type oc-yang:counter64;
description
"The total number of packets sent to the client.";
}

leaf data-send-error {
type oc-yang:counter64;
description
"A count of errors the gRPC server encountered when
sending data to a grpc client.";
}
}

grouping grpc-server-connections-state {
description
"Operational data for gRPC server connections.";

leaf address {
type oc-inet:ip-address;
description
"IPv4/IPv6 address of the gRPC server connection.";
}

leaf port {
type oc-inet:port-number;
description
"TCP/UDP port number for the gRPC server connection.";
}
}

grouping connections-top {
description
"Top-level grouping for data related to gRPC connections.";

container connections {
config false;
description
"Enclosing container for list of gRPC connections.";

list connection {
key "address port";
description
"List of gRPC connections";

leaf address {
type leafref {
path "../state/address";
}
description
"Reference to address list key.";
}

leaf port {
type leafref {
path "../state/port";
}
description
"Reference to port list key.";
}

container state {
config false;
description
"Operational state data for gRPC connections.";

uses grpc-server-connections-state;
uses grpc-counters;
}
}
}
}

augment "/oc-sys:system" {
description
"Add gRPC service configuration to the openconfig-system model.";
Expand Down

0 comments on commit 3c810f3

Please sign in to comment.