forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsonic-portchannel.yang
More file actions
205 lines (158 loc) · 5.95 KB
/
Copy pathsonic-portchannel.yang
File metadata and controls
205 lines (158 loc) · 5.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
module sonic-portchannel {
yang-version 1.1;
namespace "http://github.com/Azure/sonic-portchannel";
prefix lag;
import sonic-types {
prefix stypes;
revision-date 2019-07-01;
}
import sonic-extension {
prefix ext;
revision-date 2019-07-01;
}
import sonic-port {
prefix port;
revision-date 2019-07-01;
}
import sonic-vrf {
prefix vrf;
}
description "PORTCHANNEL yang Module for SONiC OS";
revision 2021-06-13 {
description "Change min-links valid range from 1-128 to 1-1024";
}
revision 2021-03-31 {
description "Add PortChannel Interface List with VRF attribute";
}
revision 2021-03-15 {
description "Add SONiC PortChannel Interface model";
}
revision 2019-07-01 {
description "First Revision";
}
container sonic-portchannel {
container PORTCHANNEL {
description "PORTCHANNEL part of config_db.json";
list PORTCHANNEL_LIST {
key "name";
leaf name {
type string {
length 1..128;
pattern 'PortChannel[0-9]{1,4}';
}
}
leaf-list members {
/* leaf-list members are unique by default */
type union {
type leafref {
path /port:sonic-port/port:PORT/port:PORT_LIST/port:name;
}
type string {
pattern "";
}
}
/* Today in SONiC, we do not delete the list once
* created, instead we set to empty list. Due to that
* below default values are needed.
*/
default "";
}
leaf min_links {
type uint16 {
range 1..1024;
}
}
leaf description {
type string {
length 1..255;
}
}
leaf mtu {
type uint16 {
range 1..9216;
}
}
leaf admin_status {
mandatory true;
type stypes:admin_status;
}
leaf lacp_key {
/* lacp key should be either auto or a integer in the range of 1 to 65535 */
/* When lacp_key is set to 'auto' the lacp key would be set to be the number */
/* on the end of the PortChannel name with a prefix of 1 */
type union {
type string {
pattern "auto";
}
type uint16 {
range 1..65535;
}
}
}
leaf tpid {
description "This leaf describes the possible TPID value that can be configured
to the specified portchannel if the HW supports TPID configuration. The possible
values are 0x8100, 0x9100, 0x9200, 0x88a8, and 0x88A8";
type stypes:tpid_type;
}
} /* end of list PORTCHANNEL_LIST */
} /* end of container PORTCHANNEL */
container PORTCHANNEL_MEMBER {
description "PORTCHANNEL_MEMBER part of config_db.json";
list PORTCHANNEL_MEMBER_LIST {
key "name port";
leaf name {
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
}
leaf port {
/* key elements are mandatory by default */
type leafref {
path /port:sonic-port/port:PORT/port:PORT_LIST/port:name;
}
}
} /* end of list PORTCHANNEL_MEMBER_LIST */
} /* end of container PORTCHANNEL_MEMBER */
container PORTCHANNEL_INTERFACE {
description "PORTCHANNEL_INTERFACE part of config_db.json";
list PORTCHANNEL_INTERFACE_LIST {
key "name";
leaf name {
/* key elements are mandatory by default */
type leafref {
path "/lag:sonic-portchannel/lag:PORTCHANNEL/lag:PORTCHANNEL_LIST/lag:name";
}
}
leaf vrf_name {
type leafref {
path "/vrf:sonic-vrf/vrf:VRF/vrf:VRF_LIST/vrf:name";
}
}
leaf nat_zone {
description "NAT Zone for the portchannel interface";
type uint8 {
range "0..3" {
error-message "Invalid nat zone for the portchannel interface.";
error-app-tag nat-zone-invalid;
}
}
default "0";
}
} /* end of list PORTCHANNEL_INTERFACE_LIST */
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-portchannel */