@@ -96,6 +96,20 @@ limitations under the License.
96
96
</ACTION >
97
97
</COMMAND >
98
98
99
+ <COMMAND
100
+ name =" show PortChannel"
101
+ help =" LAG status and configuration"
102
+ ptype =" SUBCOMMAND"
103
+ mode =" subcommand" />
104
+ <COMMAND
105
+ name =" show PortChannel summary"
106
+ help =" LAG status and configurationn"
107
+ mode =" subcommand" >
108
+ <ACTION >
109
+ python $SONIC_CLI_ROOT/sonic-cli-if.py get_openconfig_interfaces_interfaces PortChannel show_portchannel.j2
110
+ </ACTION >
111
+ </COMMAND >
112
+
99
113
</VIEW >
100
114
101
115
<VIEW
@@ -139,6 +153,23 @@ limitations under the License.
139
153
<ACTION builtin =" clish_nop" ></ACTION >
140
154
</COMMAND >
141
155
156
+ <COMMAND
157
+ name =" interface PortChannel"
158
+ help =" Port channel Interface Configuration"
159
+ mode =" subcommand"
160
+ ptype =" SUBCOMMAND"
161
+ view =" configure-lag-view"
162
+ viewid =" po_id=po${lag-id}"
163
+ >
164
+ <PARAM
165
+ name =" lag-id"
166
+ help =" PortChannel identifier"
167
+ ptype =" LAG_ID"
168
+ >
169
+ </PARAM >
170
+ <ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_interfaces_interfaces_interface PortChannel${lag-id}</ACTION >
171
+ </COMMAND >
172
+
142
173
<!-- no interface commands -->
143
174
<COMMAND
144
175
name =" no interface"
@@ -162,10 +193,23 @@ limitations under the License.
162
193
ptype =" VLAN_ID"
163
194
/>
164
195
</PARAM >
196
+ <PARAM
197
+ name =" PortChannel"
198
+ help =" Delete PortChannel"
199
+ mode =" subcommand"
200
+ ptype =" SUBCOMMAND"
201
+ >
202
+ <PARAM
203
+ name =" lag-id"
204
+ help =" PortChannel identifier"
205
+ ptype =" LAG_ID"
206
+ />
207
+ </PARAM >
165
208
</PARAM >
166
209
<ACTION builtin =" clish_nop" ></ACTION >
167
210
</COMMAND >
168
211
</VIEW >
212
+
169
213
<VIEW
170
214
name =" configure-if-view"
171
215
prompt =" ${SYSTEM_NAME}(conf-if-${iface})# "
@@ -209,7 +253,47 @@ limitations under the License.
209
253
help =" Remove MTU" >
210
254
<ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_interfaces_interfaces_interface_config_mtu ${iface} 9100 </ACTION >
211
255
</COMMAND >
212
- <COMMAND
256
+ <COMMAND
257
+ name =" channel-group"
258
+ help =" Configure port channel parameters"
259
+ >
260
+ <!-- channel-group <number> -->
261
+ <PARAM
262
+ name =" lag-id"
263
+ help =" Specify a port channel number"
264
+ ptype =" LAG_ID"
265
+ >
266
+ <!-- channel-group <number> mode [active] -->
267
+ <PARAM
268
+ name =" mode"
269
+ help =" Set the LACP actor mode, default: ACTIVE"
270
+ ptype =" SUBCOMMAND"
271
+ mode =" subcommand"
272
+ optional =" true" >
273
+ <PARAM
274
+ name =" portchannel-mode-switch"
275
+ help =" Specify channeling mode"
276
+ ptype =" SUBCOMMAND"
277
+ mode =" switch"
278
+ >
279
+ <PARAM
280
+ name =" active"
281
+ help =" Set channeling mode to ACTIVE"
282
+ ptype =" SUBCOMMAND"
283
+ mode =" subcommand"
284
+ />
285
+ </PARAM >
286
+ </PARAM >
287
+ </PARAM >
288
+ <ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_if_aggregate_interfaces_interface_ethernet_config_aggregate_id ${iface} ${lag-id} </ACTION >
289
+ </COMMAND >
290
+
291
+ <COMMAND
292
+ name =" no channel-group"
293
+ help =" Remove from port channel group" >
294
+ <ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py delete_openconfig_if_aggregate_interfaces_interface_ethernet_config_aggregate_id ${iface} </ACTION >
295
+ </COMMAND >
296
+ <COMMAND
213
297
name =" shutdown"
214
298
help =" Disable the interface" >
215
299
<ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_interfaces_interfaces_interface_config_enabled ${iface} False </ACTION >
@@ -350,5 +434,89 @@ limitations under the License.
350
434
completion =" false"
351
435
/>
352
436
</VIEW >
437
+ <VIEW
438
+ name =" configure-lag-view"
439
+ prompt =" ${SYSTEM_NAME}(conf-if-${po_id})# "
440
+ depth =" 2"
441
+ >
442
+ <!-- Inheritance -->
443
+ <NAMESPACE
444
+ ref =" configure-view"
445
+ help =" false"
446
+ completion =" false"
447
+ />
448
+
449
+ <COMMAND
450
+ name =" no"
451
+ help =" Negate a command or set its defaults"
452
+ />
453
+ <COMMAND
454
+ name =" min-links"
455
+ help =" Configure the minimum number of links in a PortChannel" >
456
+ <PARAM
457
+ name =" min-links"
458
+ help =" Configure the minimum number of links in a PortChannel"
459
+ ptype =" MIN_LINK" />
460
+ <ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_if_aggregate_interfaces_interface_aggregation_config_min_links ${po_id} ${min-links} </ACTION >
461
+ </COMMAND >
462
+ <COMMAND
463
+ name =" no min-links"
464
+ help =" Default the minimum number of links in a port channel" >
465
+ <ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_if_aggregate_interfaces_interface_aggregation_config_min_links ${po_id} 1 </ACTION >
466
+ </COMMAND >
467
+ <COMMAND
468
+ name =" mtu"
469
+ help =" Configure MTU" >
470
+ <PARAM
471
+ name =" mtu"
472
+ help =" MTU of the interface"
473
+ ptype =" RANGE_MTU" />
474
+ <ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_interfaces_interfaces_interface_config_mtu ${po_id} ${mtu} </ACTION >
475
+ </COMMAND >
476
+ <COMMAND
477
+ name =" no mtu"
478
+ help =" Remove MTU" >
479
+ <ACTION >python $SONIC_CLI_ROOT/sonic-cli-if.py patch_openconfig_interfaces_interfaces_interface_config_mtu ${po_id} 9100 </ACTION >
480
+ </COMMAND >
481
+ <COMMAND
482
+ name =" shutdown"
483
+ help =" Disable the interface" >
484
+ <ACTION builtin =" clish_nop" ></ACTION >
485
+ </COMMAND >
486
+ <COMMAND
487
+ name =" no shutdown"
488
+ help =" Enable the interface" >
489
+ <ACTION builtin =" clish_nop" ></ACTION >
490
+ </COMMAND >
491
+ <COMMAND
492
+ name =" ip"
493
+ help =" Interface Internet Protocol config commands"
494
+ />
495
+ <COMMAND
496
+ name =" no ip"
497
+ help =" Interface Internet Protocol config commands"
498
+ >
499
+ </COMMAND >
500
+ <COMMAND
501
+ name =" ip address"
502
+ help =" IP address" >
503
+ <PARAM
504
+ name =" addr"
505
+ help =" IP address with mask"
506
+ ptype =" IP_ADDR_MASK" />
507
+ <ACTION builtin =" clish_nop" ></ACTION >
508
+ </COMMAND >
509
+
510
+ <COMMAND
511
+ name =" no ip address"
512
+ help =" Interface Internet Protocol config commands"
513
+ >
514
+ <PARAM
515
+ name =" addr"
516
+ help =" IP address"
517
+ ptype =" IP_ADDR" />
518
+ <ACTION builtin =" clish_nop" ></ACTION >
519
+ </COMMAND >
520
+ </VIEW >
353
521
</CLISH_MODULE >
354
522
0 commit comments