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 9, 2024
1 parent bf592f6 commit c1b5fcc
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Table of Contents
* [Device neighbor metada](#device-neighbor-metada)
* [DHCP_RELAY](#dhcp_relay)
* [DHCP Server IPV4](#dhcp_server_ipv4)
* [BMP](#bmp)
* [DSCP_TO_TC_MAP](#dscp_to_tc_map)
* [FG_NHG](#fg_nhg)
* [FG_NHG_MEMBER](#fg_nhg_member)
Expand Down Expand Up @@ -1005,6 +1006,21 @@ instance is supported in SONiC.
```

### BMP
BMP related configuration are defined in **bgp_neighbor_table**,**bgp_rib_in_table**, **bgp_rib_out_table** tables.

```
{
"BMP": {
"table": {
"bgp_neighbor_table": "true",
"bgp_rib_in_table": "false",
"bgp_rib_out_table": "false"
}
}
}
```

### DHCP_SERVER_IPV4
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.
```
Expand Down
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 c1b5fcc

Please sign in to comment.