Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 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 @@ -18,6 +18,10 @@
"mtu": "9100"
}
},
"PORTCHANNEL_INTERFACE": {
"PortChannel0003|13.13.13.13/24": {},
"PortChannel0004|14.14.14.14/24": {}
},
"VLAN_INTERFACE": {
"Vlan111": {},
"Vlan777": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def initTest(self):
'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']
},
'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']
Expand Down
11 changes: 11 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/yangTest.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@
}
},

"PORTCHANNEL_INTERFACE_IP_ADDR_TEST": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL_INTERFACE": {
"PORTCHANNEL_INTERFACE_IPADDR_LIST": [{
"pch_name": "PortChannel0001",
"ip_prefix": "1.1.1.1/24"
}]
}
}
},

"PORT_CHANNEL_WRONG_PATTERN": {
"sonic-portchannel:sonic-portchannel": {
"sonic-portchannel:PORTCHANNEL": {
Expand Down
28 changes: 28 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-portchannel.yang
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ module sonic-portchannel {
revision-date 2019-07-01;
}

import ietf-inet-types {
prefix inet;
}

description "PORTCHANNEL yang Module for SONiC OS";

revision 2019-07-01 {
Expand Down Expand Up @@ -89,6 +93,30 @@ module sonic-portchannel {

} /* end of container PORTCHANNEL */


container PORTCHANNEL_INTERFACE {

description "PORTCHANNEL_INTERFACE part of config_db.json";

list PORTCHANNEL_INTERFACE_IPADDR_LIST {

key "pch_name ip_prefix";

leaf pch_name {
/* key elements are mandatory by default */
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:portchannel_name";
}
}

leaf ip_prefix {
/* key elements are mandatory by default */
type inet:ip-prefix;
}
} /* end of list PORTCHANNEL_INTERFACE_IPADDR_LIST */

} /* end of container PORTCHANNEL_INTERFACE */

} /* end of container sonic-portchannel */

} /* end of module sonic-port */