[yang]: Support VLAN alias (#9615)
Why I did it Config db schema generated by minigraph can’t pass yang validation, and there's no 'alias' field in yang model. Minigraph parser supports 'alias' field for VLAN. How I did it Add 'alias' field to sonic-vlan.yang How to verify it Build sonic-yang-models. Run command 'sonic-cfggen -m xxx.xml --print-data', and run yang validation. Signed-off-by: Gang Lv ganglv@microsoft.com
This commit is contained in:
parent
3c20bd8441
commit
c875cc65f5
@ -1,29 +1,32 @@
|
||||
{
|
||||
"VALID_VLAN": {
|
||||
"desc": "Configure VLAN table."
|
||||
},
|
||||
"VLAN_INTERFACE_IPPREFIX_MUST_CONDITION_FALSE": {
|
||||
"desc": "Vlan Interface Ip-prefix must condition failure.",
|
||||
"eStrKey" : "Must"
|
||||
"desc": "Vlan Interface Ip-prefix must condition failure.",
|
||||
"eStrKey" : "Must"
|
||||
},
|
||||
"INCORRECT_VLAN_NAME": {
|
||||
"desc": "INCORRECT VLAN_NAME FIELD IN VLAN TABLE.",
|
||||
"eStrKey" : "Pattern",
|
||||
"eStr": ["Vlan"]
|
||||
"desc": "INCORRECT VLAN_NAME FIELD IN VLAN TABLE.",
|
||||
"eStrKey" : "Pattern",
|
||||
"eStr": ["Vlan"]
|
||||
},
|
||||
"WRONG_FAMILY_WITH_IP_PREFIX": {
|
||||
"desc": "Configure Wrong family with ip-prefix for VLAN_Interface Table",
|
||||
"eStrKey" : "Must"
|
||||
"desc": "Configure Wrong family with ip-prefix for VLAN_Interface Table",
|
||||
"eStrKey" : "Must"
|
||||
},
|
||||
"DHCP_SERVER_INCORRECT_FORMAT": {
|
||||
"desc": "Add dhcp_server which is not in correct ip-prefix format.",
|
||||
"eStrKey" : "InvalidValue",
|
||||
"eStr": ["dhcp_servers"]
|
||||
"desc": "Add dhcp_server which is not in correct ip-prefix format.",
|
||||
"eStrKey" : "InvalidValue",
|
||||
"eStr": ["dhcp_servers"]
|
||||
},
|
||||
"DHCPV6_SERVER_INCORRECT_FORMAT": {
|
||||
"desc": "Add dhcpv6_server which is not in correct ipv6-address format.",
|
||||
"eStrKey" : "Pattern"
|
||||
},
|
||||
"VLAN_WITH_NON_EXIST_PORT": {
|
||||
"desc": "Configure a member port in VLAN_MEMBER table which does not exist.",
|
||||
"eStrKey" : "InvalidValue"
|
||||
"desc": "Configure a member port in VLAN_MEMBER table which does not exist.",
|
||||
"eStrKey" : "InvalidValue"
|
||||
},
|
||||
"VLAN_WITH_PORTCHANNEL_MEMBER": {
|
||||
"desc": "Configure a PortChannel as a member of Vlan."
|
||||
@ -33,13 +36,13 @@
|
||||
"eStrKey" : "InvalidValue"
|
||||
},
|
||||
"VLAN_MEMEBER_WITH_NON_EXIST_VLAN": {
|
||||
"desc": "Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table.",
|
||||
"eStrKey" : "LeafRef"
|
||||
"desc": "Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table.",
|
||||
"eStrKey" : "LeafRef"
|
||||
},
|
||||
"TAGGING_MODE_WRONG_VALUE": {
|
||||
"desc": "Configure wrong value for tagging_mode.",
|
||||
"eStrKey" : "InvalidValue",
|
||||
"eStr": ["tagging_mode"]
|
||||
"desc": "Configure wrong value for tagging_mode.",
|
||||
"eStrKey" : "InvalidValue",
|
||||
"eStr": ["tagging_mode"]
|
||||
},
|
||||
"VLAN_INTERFACE_WRONG_NAT_ZONE_RANGE": {
|
||||
"desc": "Configure wrong value for nat zone.",
|
||||
|
@ -1,4 +1,32 @@
|
||||
{
|
||||
"VALID_VLAN": {
|
||||
"sonic-vlan:sonic-vlan": {
|
||||
"sonic-vlan:VLAN": {
|
||||
"VLAN_LIST": [
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "first_vlan",
|
||||
"description": "server_vlan",
|
||||
"dhcp_servers": [
|
||||
"10.186.72.56"
|
||||
],
|
||||
"mtu": "9100",
|
||||
"name": "Vlan100"
|
||||
},
|
||||
{
|
||||
"admin_status": "up",
|
||||
"alias": "second_vlan",
|
||||
"description": "server_vlan",
|
||||
"dhcp_servers": [
|
||||
"10.186.72.66"
|
||||
],
|
||||
"mtu": "9100",
|
||||
"name": "Vlan200"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"INCORRECT_VLAN_NAME": {
|
||||
"sonic-vlan:sonic-vlan": {
|
||||
"sonic-vlan:VLAN": {
|
||||
|
@ -155,6 +155,10 @@ module sonic-vlan {
|
||||
}
|
||||
}
|
||||
|
||||
leaf alias {
|
||||
type string;
|
||||
}
|
||||
|
||||
leaf description {
|
||||
type string {
|
||||
length 1..255;
|
||||
|
Loading…
Reference in New Issue
Block a user