Commit e673c1d 1 parent 373f091 commit e673c1d Copy full SHA for e673c1d
File tree 5 files changed +175
-0
lines changed
5 files changed +175
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ def run(self):
148
148
'./yang-models/sonic-system-tacacs.yang' ,
149
149
'./yang-models/sonic-system-radius.yang' ,
150
150
'./yang-models/sonic-telemetry.yang' ,
151
+ './yang-models/sonic-gnmi.yang' ,
151
152
'./yang-models/sonic-tunnel.yang' ,
152
153
'./yang-models/sonic-types.yang' ,
153
154
'./yang-models/sonic-versions.yang' ,
@@ -226,6 +227,7 @@ def run(self):
226
227
'./cvlyang-models/sonic-system-aaa.yang' ,
227
228
'./cvlyang-models/sonic-system-tacacs.yang' ,
228
229
'./cvlyang-models/sonic-telemetry.yang' ,
230
+ './cvlyang-models/sonic-gnmi.yang' ,
229
231
'./cvlyang-models/sonic-types.yang' ,
230
232
'./cvlyang-models/sonic-versions.yang' ,
231
233
'./cvlyang-models/sonic-vlan.yang' ,
Original file line number Diff line number Diff line change 1183
1183
"port" : " 50051"
1184
1184
}
1185
1185
},
1186
+ "GNMI" : {
1187
+ "certs" : {
1188
+ "ca_crt" : " /etc/sonic/credentials/dsmsroot.cer" ,
1189
+ "server_crt" : " /etc/sonic/credentials/server.cer" ,
1190
+ "server_key" : " /etc/sonic/credentials/server.key"
1191
+ },
1192
+ "gnmi" : {
1193
+ "client_auth" : " true" ,
1194
+ "log_level" : " 2" ,
1195
+ "port" : " 50052"
1196
+ }
1197
+ },
1186
1198
"TUNNEL" : {
1187
1199
"MuxTunnel0" : {
1188
1200
"dscp_mode" : " uniform" ,
Original file line number Diff line number Diff line change
1
+ {
2
+ "GNMI_TABLE_WITH_INCORRECT_CERT" : {
3
+ "desc" : " TABLE_WITH_INCORRECT_CERT failure." ,
4
+ "eStrKey" : " Pattern"
5
+ },
6
+ "GNMI_TABLE_WITH_INCORRECT_CLIENT_AUTH" : {
7
+ "desc" : " TABLE_WITH_INCORRECT_CLIENT_AUTH failure" ,
8
+ "eStrKey" : " InvalidValue"
9
+ },
10
+ "GNMI_TABLE_WITH_INCORRECT_PORT" : {
11
+ "desc" : " TABLE_WITH_INCORRECT_PORT failure." ,
12
+ "eStrKey" : " InvalidValue"
13
+ },
14
+ "GNMI_TABLE_WITH_VALID_CONFIG" : {
15
+ "desc" : " TABLE WITH VALID CONFIG."
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "GNMI_TABLE_WITH_INCORRECT_CERT" : {
3
+ "sonic-gnmi:sonic-gnmi" : {
4
+ "sonic-gnmi:GNMI" : {
5
+ "certs" : {
6
+ "ca_crt" : " abcd.config" ,
7
+ "server_crt" : " a/b/c" ,
8
+ "server_key" : " 123"
9
+ },
10
+ "gnmi" : {
11
+ "client_auth" : " true" ,
12
+ "log_level" : " 2" ,
13
+ "port" : " 50052"
14
+ }
15
+ }
16
+ }
17
+ },
18
+ "GNMI_TABLE_WITH_INCORRECT_CLIENT_AUTH" : {
19
+ "sonic-gnmi:sonic-gnmi" : {
20
+ "sonic-gnmi:GNMI" : {
21
+ "certs" : {
22
+ "ca_crt" : " /etc/sonic/credentials/dsmsroot.cer" ,
23
+ "server_crt" : " /etc/sonic/credentials/server.cer" ,
24
+ "server_key" : " /etc/sonic/credentials/server.key"
25
+ },
26
+ "gnmi" : {
27
+ "client_auth" : " up" ,
28
+ "log_level" : " 2" ,
29
+ "port" : " 50052"
30
+ }
31
+ }
32
+ }
33
+ },
34
+ "GNMI_TABLE_WITH_INCORRECT_PORT" : {
35
+ "sonic-gnmi:sonic-gnmi" : {
36
+ "sonic-gnmi:GNMI" : {
37
+ "certs" : {
38
+ "ca_crt" : " /etc/sonic/credentials/dsmsroot.cer" ,
39
+ "server_crt" : " /etc/sonic/credentials/server.cer" ,
40
+ "server_key" : " /etc/sonic/credentials/server.key"
41
+ },
42
+ "gnmi" : {
43
+ "client_auth" : " true" ,
44
+ "log_level" : " 2" ,
45
+ "port" : " abc"
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "GNMI_TABLE_WITH_VALID_CONFIG" : {
51
+ "sonic-gnmi:sonic-gnmi" : {
52
+ "sonic-gnmi:GNMI" : {
53
+ "certs" : {
54
+ "ca_crt" : " /etc/sonic/credentials/dsmsroot.cer" ,
55
+ "server_crt" : " /etc/sonic/credentials/server.cer" ,
56
+ "server_key" : " /etc/sonic/credentials/server.key"
57
+ },
58
+ "gnmi" : {
59
+ "client_auth" : " true" ,
60
+ "log_level" : " 2" ,
61
+ "port" : " 50052"
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
Original file line number Diff line number Diff line change
1
+ module sonic-gnmi {
2
+
3
+ yang-version 1.1 ;
4
+
5
+ namespace "http://github.com/sonic-net/sonic-gnmi" ;
6
+ prefix gnmi;
7
+
8
+ import ietf-inet-types {
9
+ prefix inet;
10
+ }
11
+
12
+ organization
13
+ "SONiC" ;
14
+
15
+ contact
16
+ "SONiC" ;
17
+
18
+ description "GNMI YANG Module for SONiC OS" ;
19
+
20
+ revision 2023 -02 -10 {
21
+ description "First Revision" ;
22
+ }
23
+
24
+ container sonic-gnmi {
25
+
26
+ container GNMI {
27
+
28
+ description "GNMI TABLE part of config_db.json" ;
29
+
30
+ container certs {
31
+
32
+ leaf ca_crt {
33
+ type string {
34
+ pattern '(/[a-zA-Z0-9_-]+)*/([a-zA-Z0-9_-]+).cer' ;
35
+ }
36
+ description "Local path for ca_crt." ;
37
+ }
38
+
39
+ leaf server_crt {
40
+ type string {
41
+ pattern '(/[a-zA-Z0-9_-]+)*/([a-zA-Z0-9_-]+).cer' ;
42
+ }
43
+ description "Local path for server_crt." ;
44
+ }
45
+
46
+ leaf server_key {
47
+ type string {
48
+ pattern '(/[a-zA-Z0-9_-]+)*/([a-zA-Z0-9_-]+).key' ;
49
+ }
50
+ description "Local path for server_key." ;
51
+ }
52
+
53
+ }
54
+
55
+ container gnmi {
56
+
57
+ leaf client_auth {
58
+ type boolean ;
59
+ description "Flag for requiring client auth." ;
60
+ }
61
+
62
+ leaf log_level {
63
+ type uint8 {
64
+ range 0 ..100 ;
65
+ }
66
+ description "Log level for gnmi." ;
67
+ }
68
+
69
+ leaf port {
70
+ type inet:port-number;
71
+ description "Port gnmi runs on." ;
72
+ }
73
+
74
+ }
75
+
76
+ }
77
+ }
78
+ }
You can’t perform that action at this time.
0 commit comments