11-28-2022 09:56 PM
I am trying to change the operational state of l2 vlans on a 9500 stack running 17.6.4 with restconf.
I can get the vlan: https://<ip>/restconf/data/Cisco-IOS-XE-native:native/vlan/vlan-list=580
{
"Cisco-IOS-XE-vlan:vlan-list": {
"id": 580,
"name": "0580.SRM.TEST"
}
}
I can successfully shutdown the vlan: https://<ip>/restconf/data/Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list
patch body:
{
"Cisco-IOS-XE-vlan:vlan-list": [
{
"id": 580,
"name": "0580.SRM.TEST",
"shutdown": [
null
]
}
]
}
I am stuck changing the operational state back to active. The current workaround is to delete the vlan and recreate the vlan. Obviously not ideal.
YANG data model is new to me. Not sure how to delete the "shutdown" leaf of the vlan.
list vlan-list {
key "id";
leaf id {
description
"a single VLAN id (allowed value range 1-4094)or Comma-separated VLAN id range.e.g. 99 or 1-30 or 1-20,30,40-50";
type uint16 {
range "1..4094";
}
leaf state {
description
"Operational state of the VLAN";
type enumeration {
enum "active";
enum "suspend";
}
}
leaf shutdown {
description
"Shutdown VLAN switching";
type empty;
}
}
I currently accomplish this on NX-OS with the following but this datacenter is migrating off the 93180 platform to the 9500.
{
"ins_api": {
"version": "1.0",
"type": "cli_conf",
"chunk": "0",
"sid": "1",
"input": "vlan 580 ;no shutdown",
"output_format": "json"
}
}
If anybody has experience with this, I would be greatfull.
Solved! Go to Solution.
11-29-2022 11:34 AM - edited 11-29-2022 11:34 AM
Hi
I don't have access to a RESTCONF enabled switch at the moment, but deleting the shutdown leaf for vlan 580 should just work like this:
DELETE https://<ip>/restconf/data/Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=580/shutdown
HTH
Marcel
11-29-2022 11:34 AM - edited 11-29-2022 11:34 AM
Hi
I don't have access to a RESTCONF enabled switch at the moment, but deleting the shutdown leaf for vlan 580 should just work like this:
DELETE https://<ip>/restconf/data/Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=580/shutdown
HTH
Marcel
12-02-2022 09:14 AM
Thank you so much. I was also able to verify that it works. Really appreciate your guidance on this!
11-30-2022 02:03 AM - edited 11-30-2022 02:04 AM
@BradyPocock I was able to test this on a Cat9k and can confirm that my answer above is correct:
Disable vlan switching (vlan-580):
PATCH https://<ip>/restconf/data/Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=580
{
"Cisco-IOS-XE-vlan:vlan-list": {
"shutdown": [null]
}
}
Activate vlan switching (vlan 580):
DELETE https://<ip>/restconf/data/Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=580/shutdown
(no payload/content)
Marcel
02-24-2024 06:32 AM
You're an angel
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide