Skip to content

Commit

Permalink
[yang] add Yang model for GRPCCLIENT (#20902)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdahiya12 authored Nov 26, 2024
1 parent 5cc485b commit 8d016e7
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Table of Contents
* [FABRIC_MONITOR](#fabric-monitor)
* [FABRIC_PORT](#fabric-port)
* [FLEX_COUNTER_TABLE](#flex_counter_table)
* [GRPCCLIENT](#grpcclient)
* [Hash](#hash)
* [IPv6 Link-local] (#ipv6-link-local)
* [KDUMP](#kdump)
Expand Down
1 change: 1 addition & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def run(self):
'./yang-models/sonic-bgp-sentinel.yang',
'./yang-models/sonic-bmp.yang',
'./yang-models/sonic-xcvrd-log.yang',
'./yang-models/sonic-grpcclient.yang',
'./yang-models/sonic-serial-console.yang',
'./yang-models/sonic-smart-switch.yang',]),
('cvlyang-models', ['./cvlyang-models/sonic-acl.yang',
Expand Down
13 changes: 13 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2762,6 +2762,19 @@
"log_verbosity": "notice"
}
},
"GRPCCLIENT": {
"config": {
"type": "secure",
"auth_level": "server",
"log_level": "info"
},
"certs": {
"client_crt": "grpcclient.crt",
"client_key": "grpcclient.key",
"ca_crt": "root.pem",
"grpc_ssl_credential": "azureclient.ms"
}
},
"BANNER_MESSAGE": {
"global": {
"state": "enabled",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"GRPCCLIENT_CONFIG_CHANGE_VERBOSITY_LEVEL": {
"desc": "Consume verbosity level config changes. "
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"GRPCCLIENT_CONFIG_CHANGE_VERBOSITY_LEVEL": {
"sonic-grpcclient:sonic-grpcclient": {
"sonic-grpcclient:GRPCCLIENT": {
"sonic-grpcclient:config":
{
"log_level": "info"
}
}
}
}
}
79 changes: 79 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-grpcclient.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
module sonic-grpcclient {
namespace "http://github.com/sonic-net/sonic-grpcclient";
prefix grpcclient;
yang-version 1.1;

organization
"SONiC";

contact
"SONiC";

description
"SONiC DualToR grpc client configuration data";

revision 2024-10-14 {
description
"Initial revision";
}

container sonic-grpcclient {

container GRPCCLIENT {

container config {

leaf type {
type enumeration {
enum secure;
enum insecure;
}
description "grpc client security level. ";
}

leaf auth_level {
type enumeration {
enum server;
enum client;
}
description "grpc client auth level. ";
}

leaf log_level {
type enumeration {
enum info;
enum notice;
enum debug;
enum warning;
enum critical;
}
description "grpc client log level. ";
}
}

container certs {

leaf client_crt {
type string;
description "grpc client certificate file name ";

}

leaf client_key {
type string;
description "grpc client key file name ";
}

leaf ca_crt {
type string;
description "grpc client root cert";
}

leaf grpc_ssl_credential {
type string;
description "grpc client ssl credential";
}
}
}
}
}

0 comments on commit 8d016e7

Please sign in to comment.