diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 95f98bd53dd8..1398cbaaa33a 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -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', @@ -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, diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 050f4433bac6..400c72447dec 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -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", diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/bmp.json b/src/sonic-yang-models/tests/yang_model_tests/tests/bmp.json new file mode 100644 index 000000000000..09883d4174c8 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/bmp.json @@ -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" + } +} diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/bmp.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bmp.json new file mode 100644 index 000000000000..cbc8dceead7e --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/bmp.json @@ -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" + } + } + } + } +} diff --git a/src/sonic-yang-models/yang-models/sonic-bmp.yang b/src/sonic-yang-models/yang-models/sonic-bmp.yang new file mode 100644 index 000000000000..70157f6c881e --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-bmp.yang @@ -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."; + } + + } + + } + + } + +}