Skip to content

Commit

Permalink
Add yang models for bmp service.
Browse files Browse the repository at this point in the history
  • Loading branch information
FengPan-Frank committed Apr 2, 2024
1 parent bf592f6 commit 40d1ffe
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def run(self):
'./yang-models/sonic-system-port.yang',
'./yang-models/sonic-macsec.yang',
'./yang-models/sonic-bgp-sentinel.yang',
'./yang-models/sonic-bmp.yang',
'./yang-models/sonic-smart-switch.yang',]),
('cvlyang-models', ['./cvlyang-models/sonic-acl.yang',
'./cvlyang-models/sonic-bgp-common.yang',
Expand Down Expand Up @@ -274,6 +275,7 @@ def run(self):
'./cvlyang-models/sonic-static-route.yang',
'./cvlyang-models/sonic-system-port.yang',
'./cvlyang-models/sonic-macsec.yang',
'./cvlyang-models/sonic-bmp.yang',
'./cvlyang-models/sonic-bgp-sentinel.yang']),
],
zip_safe=False,
Expand Down
7 changes: 7 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 @@ -1293,6 +1293,13 @@
"report_type": "periodic"
}
},
"BMP": {
"table": {
"bgp_neighbor_table": "true",
"bgp_rib_in_table": "false",
"bgp_rib_out_table": "false"
}
},
"GNMI": {
"certs": {
"ca_crt": "/etc/sonic/credentials/dsmsroot.cer",
Expand Down
9 changes: 9 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/bmp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"BMP_TABLE_WITH_VALID_CONFIG": {
"desc": "BMP TABLE WITH VALID CONFIG."
},
"BMP_TABLE_WITH_INVALID_CONFIG": {
"desc": "BMP TABLE WITH INVALID CONFIG.",
"eStrKey": "Pattern"
}
}
24 changes: 24 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/bmp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"BMP_TABLE_WITH_VALID_CONFIG": {
"sonic-bmp:sonic-bmp": {
"sonic-bmp:BMP": {
"table": {
"bgp_neighbor_table": "true",
"bgp_rib_in_table": "false",
"bgp_rib_out_table": "false"
}
}
}
},
"BMP_TABLE_WITH_INVALID_CONFIG": {
"sonic-bmp:sonic-bmp": {
"sonic-bmp:BMP": {
"table": {
"bgp_neighbor_table": "up",
"bgp_rib_in_table": "false",
"bgp_rib_out_table": "false"
}
}
}
}
}
56 changes: 56 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-bmp.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module sonic-bmp {

yang-version 1.1;

namespace "http://github.com/sonic-net/sonic-bmp";
prefix bmp;

import sonic-types {
prefix stypes;
}

organization
"SONiC";

contact
"SONiC";

description "BMP YANG Module for SONiC OS";

revision 2024-03-20 {
description "First Revision";
}

container sonic-bmp {

container BMP {

description "BMP TABLE control part of config_db.json";

container table {

leaf bgp_neighbor_table {
type stypes:boolean_type;
default "true";
description "Flag for enabling/disabling bgp_neighbor_table dump.";
}

leaf bgp_rib_in_table {
type stypes:boolean_type;
default "false";
description "Flag for enabling/disabling bgp_rib_in_table dump.";
}

leaf bgp_rib_out_table {
type stypes:boolean_type;
default "false";
description "Flag for enabling/disabling bgp_rib_out_table dump.";
}

}

}

}

}

0 comments on commit 40d1ffe

Please sign in to comment.