Skip to content

Commit

Permalink
[yang]: Add admin_status to BGP_NEIGHBOR_TEMPLATE_LIST. (sonic-net#9341)
Browse files Browse the repository at this point in the history
Add admin_status to BGP_NEIGHBOR_TEMPLATE_LIST.

Signed-off-by: Gang Lv ganglv@microsoft.com
  • Loading branch information
ganglyu committed Nov 25, 2021
1 parent fdd8236 commit adf1990
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,8 @@
"local_addr": "10.0.0.2",
"name":"PEER1",
"nhopself":"0",
"rrclient":"0"
"rrclient":"0",
"admin_status":"up"
},
"default|192.168.1.1": {
"local_asn": "65200",
Expand Down
5 changes: 5 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/bgp.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
"desc": "Referring non-existing BGP neighbor table.",
"eStrKey" : "LeafRef"
},
"BGP_NEIGHBOR_NEG_INVALID_ADMIN_STATUS": {
"desc": "Incorrect admin status.",
"eStrKey": "InvalidValue",
"eStr": ["admin_status"]
},
"BGP_NEIGHBOR_NEG_INVALID_NAME": {
"desc": "Incorrect neighbor name.",
"eStrKey": "InvalidValue",
Expand Down
36 changes: 36 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests_config/bgp.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,19 @@
},
"sonic-bgp-neighbor:sonic-bgp-neighbor": {
"sonic-bgp-neighbor:BGP_NEIGHBOR": {
"BGP_NEIGHBOR_TEMPLATE_LIST": [
{
"neighbor": "10.0.0.1",
"asn": "65200",
"holdtime": "180",
"keepalive": "60",
"local_addr": "10.0.0.2",
"name":"PEER1",
"nhopself":"0",
"rrclient":"0",
"admin_status":"up"
}
],
"BGP_NEIGHBOR_LIST": [
{
"vrf_name": "default",
Expand Down Expand Up @@ -434,6 +447,29 @@
}
},

"BGP_NEIGHBOR_NEG_INVALID_ADMIN_STATUS": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
"BGP_GLOBALS_LIST": [
{
"vrf_name": "default",
"local_asn": 65001
}
]
}
},
"sonic-bgp-neighbor:sonic-bgp-neighbor": {
"sonic-bgp-neighbor:BGP_NEIGHBOR": {
"BGP_NEIGHBOR_TEMPLATE_LIST": [
{
"neighbor": "11.12.13.14",
"admin_status": "right"
}
]
}
}
},

"BGP_NEIGHBOR_NEG_INVALID_NAME": {
"sonic-bgp-global:sonic-bgp-global": {
"sonic-bgp-global:BGP_GLOBALS": {
Expand Down
9 changes: 9 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module sonic-bgp-neighbor {
prefix inet;
}

import sonic-types {
prefix stypes;
}

import sonic-bgp-common {
prefix bgpcmn;
}
Expand Down Expand Up @@ -97,6 +101,11 @@ module sonic-bgp-neighbor {
}
description "Route reflector client";
}

leaf admin_status {
type stypes:admin_status;
description "Admin status of BGP peer";
}
}

list BGP_NEIGHBOR_LIST {
Expand Down

0 comments on commit adf1990

Please sign in to comment.