[yang]: SONiC Yang model for PORTCHANNEL_INTERFACE table (#7034)

* SONiC Yang model for PORTCHANNEL_INTERFACE table

Signed-off-by: Arthi Sivanantham <arthi_sivanantham@dell.com>
This commit is contained in:
ArthiSivanantham 2021-03-28 00:51:11 -07:00 committed by GitHub
parent d3d0c2623d
commit cc36a145cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 2 deletions

View File

@ -65,6 +65,14 @@ class Test_yang_models:
'desc': 'Configure a member port in PORT_CHANNEL table.',
'eStr': self.defaultYANGFailure['None']
},
'PORTCHANNEL_INTERFACE_IP_ADDR_TEST': {
'desc': 'Configure IP address on PORTCHANNEL_INTERFACE table.',
'eStr': self.defaultYANGFailure['None']
},
'PORTCHANNEL_INTERFACE_IP_ADDR_ON_NON_EXIST_PO': {
'desc': 'Configure IP address on a non existent PortChannel.',
'eStr': self.defaultYANGFailure['LeafRef']
},
'VLAN_MEMEBER_WITH_NON_EXIST_VLAN': {
'desc': 'Configure vlan-id in VLAN_MEMBER table which does not exist in VLAN table.',
'eStr': self.defaultYANGFailure['LeafRef']

View File

@ -137,6 +137,39 @@
}
},
"PORTCHANNEL_INTERFACE_IP_ADDR_TEST": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [{
"name": "PortChannel0001",
"admin_status": "up"
}]
},
"sonic-portchannel:PORTCHANNEL_INTERFACE": {
"PORTCHANNEL_INTERFACE_IPPREFIX_LIST": [{
"name": "PortChannel0001",
"ip_prefix": "1.1.1.1/24"
}]
}
}
},
"PORTCHANNEL_INTERFACE_IP_ADDR_ON_NON_EXIST_PO": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
"PORTCHANNEL_LIST": [{
"name": "PortChannel0001"
}]
},
"sonic-portchannel:PORTCHANNEL_INTERFACE": {
"PORTCHANNEL_INTERFACE_IPPREFIX_LIST": [{
"name": "PortChannel0002",
"ip_prefix": "2.2.2.2/24"
}]
}
}
},
"PORT_CHANNEL_WRONG_PATTERN": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {

View File

@ -26,7 +26,6 @@ module sonic-acl {
import sonic-portchannel {
prefix lag;
revision-date 2019-07-01;
}
description "ACL YANG Module for SONiC OS";

View File

@ -22,10 +22,15 @@ module sonic-portchannel {
description "PORTCHANNEL yang Module for SONiC OS";
revision 2021-03-15 {
description "Add SONiC PortChannel Interface model";
}
revision 2019-07-01 {
description "First Revision";
}
container sonic-portchannel {
container PORTCHANNEL {
@ -85,6 +90,30 @@ module sonic-portchannel {
} /* end of container PORTCHANNEL */
container PORTCHANNEL_INTERFACE {
description "PORTCHANNEL_INTERFACE part of config_db.json";
list PORTCHANNEL_INTERFACE_IPPREFIX_LIST {
key "name ip_prefix";
leaf name {
/* key elements are mandatory by default */
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
}
leaf ip_prefix {
/* key elements are mandatory by default */
type stypes:sonic-ip-prefix;
}
} /* end of list PORTCHANNEL_INTERFACE_IPPREFIX_LIST */
} /* end of container PORTCHANNEL_INTERFACE */
} /* end of container sonic-portchannel */
} /* end of module sonic-port */
} /* end of module sonic-portchannel */

View File

@ -44,6 +44,13 @@ module sonic-types {
}
}
typedef sonic-ip-prefix {
type union {
type sonic-ip4-prefix;
type sonic-ip6-prefix;
}
}
typedef admin_status {
type enumeration {
enum up;