Skip to content

Commit b37c26f

Browse files
[yang]: Add yang models for bmp service. (#18530)
Why I did it Add yang model support for feature sonic-net/SONiC#1621 Microsoft ADO (number only):27332639
1 parent d6f1893 commit b37c26f

File tree

6 files changed

+114
-0
lines changed

6 files changed

+114
-0
lines changed

src/sonic-yang-models/doc/Configuration.md

+16
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Table of Contents
3333
* [Device neighbor metada](#device-neighbor-metada)
3434
* [DHCP_RELAY](#dhcp_relay)
3535
* [DHCP Server IPV4](#dhcp_server_ipv4)
36+
* [BMP](#bmp)
3637
* [DSCP_TO_TC_MAP](#dscp_to_tc_map)
3738
* [FG_NHG](#fg_nhg)
3839
* [FG_NHG_MEMBER](#fg_nhg_member)
@@ -1007,6 +1008,21 @@ instance is supported in SONiC.
10071008
10081009
```
10091010

1011+
### BMP
1012+
BMP related configuration are defined in **bgp_neighbor_table**,**bgp_rib_in_table**, **bgp_rib_out_table** tables.
1013+
1014+
```
1015+
{
1016+
"BMP": {
1017+
"table": {
1018+
"bgp_neighbor_table": "true",
1019+
"bgp_rib_in_table": "false",
1020+
"bgp_rib_out_table": "false"
1021+
}
1022+
}
1023+
}
1024+
```
1025+
10101026
### DHCP_SERVER_IPV4
10111027
IPV4 DHPC Server related configuration are defined in **DHCP_SERVER_IPV4**, **DHCP_SERVER_IPV4_CUSTOMIZED_OPTIONS**, **DHCP_SERVER_IPV4_RANGE**, **DHCP_SERVER_IPV4_PORT** tables.
10121028
```

src/sonic-yang-models/setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def run(self):
200200
'./yang-models/sonic-system-port.yang',
201201
'./yang-models/sonic-macsec.yang',
202202
'./yang-models/sonic-bgp-sentinel.yang',
203+
'./yang-models/sonic-bmp.yang',
203204
'./yang-models/sonic-smart-switch.yang',]),
204205
('cvlyang-models', ['./cvlyang-models/sonic-acl.yang',
205206
'./cvlyang-models/sonic-banner.yang',
@@ -276,6 +277,7 @@ def run(self):
276277
'./cvlyang-models/sonic-static-route.yang',
277278
'./cvlyang-models/sonic-system-port.yang',
278279
'./cvlyang-models/sonic-macsec.yang',
280+
'./cvlyang-models/sonic-bmp.yang',
279281
'./cvlyang-models/sonic-bgp-sentinel.yang']),
280282
],
281283
zip_safe=False,

src/sonic-yang-models/tests/files/sample_config_db.json

+7
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,13 @@
13041304
"report_type": "periodic"
13051305
}
13061306
},
1307+
"BMP": {
1308+
"table": {
1309+
"bgp_neighbor_table": "true",
1310+
"bgp_rib_in_table": "false",
1311+
"bgp_rib_out_table": "false"
1312+
}
1313+
},
13071314
"GNMI": {
13081315
"certs": {
13091316
"ca_crt": "/etc/sonic/credentials/dsmsroot.cer",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"BMP_TABLE_WITH_VALID_CONFIG": {
3+
"desc": "BMP TABLE WITH VALID CONFIG."
4+
},
5+
"BMP_TABLE_WITH_INVALID_CONFIG": {
6+
"desc": "BMP TABLE WITH INVALID CONFIG.",
7+
"eStrKey": "Pattern"
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"BMP_TABLE_WITH_VALID_CONFIG": {
3+
"sonic-bmp:sonic-bmp": {
4+
"sonic-bmp:BMP": {
5+
"table": {
6+
"bgp_neighbor_table": "true",
7+
"bgp_rib_in_table": "false",
8+
"bgp_rib_out_table": "false"
9+
}
10+
}
11+
}
12+
},
13+
"BMP_TABLE_WITH_INVALID_CONFIG": {
14+
"sonic-bmp:sonic-bmp": {
15+
"sonic-bmp:BMP": {
16+
"table": {
17+
"bgp_neighbor_table": "up",
18+
"bgp_rib_in_table": "false",
19+
"bgp_rib_out_table": "false"
20+
}
21+
}
22+
}
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
module sonic-bmp {
2+
3+
yang-version 1.1;
4+
5+
namespace "http://github.com/sonic-net/sonic-bmp";
6+
prefix bmp;
7+
8+
import sonic-types {
9+
prefix stypes;
10+
}
11+
12+
organization
13+
"SONiC";
14+
15+
contact
16+
"SONiC";
17+
18+
description "BMP YANG Module for SONiC OS";
19+
20+
revision 2024-03-20 {
21+
description "First Revision";
22+
}
23+
24+
container sonic-bmp {
25+
26+
container BMP {
27+
28+
description "BMP TABLE control part of config_db.json";
29+
30+
container table {
31+
32+
leaf bgp_neighbor_table {
33+
type stypes:boolean_type;
34+
default "true";
35+
description "Flag for enabling/disabling bgp_neighbor_table dump.";
36+
}
37+
38+
leaf bgp_rib_in_table {
39+
type stypes:boolean_type;
40+
default "false";
41+
description "Flag for enabling/disabling bgp_rib_in_table dump.";
42+
}
43+
44+
leaf bgp_rib_out_table {
45+
type stypes:boolean_type;
46+
default "false";
47+
description "Flag for enabling/disabling bgp_rib_out_table dump.";
48+
}
49+
50+
}
51+
52+
}
53+
54+
}
55+
56+
}

0 commit comments

Comments
 (0)