cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1010
Views
0
Helpful
1
Replies

RESTCONF call to GET/UPDATE switchport configured vlan

jorgrive
Cisco Employee
Cisco Employee

Hello All,

I'm unable to figure out the restconf URI needed to GET the configured VLAN for a given switchport interface for IOS-XE.

I would also like to be able to UPDATE a switchport-access VLAN given a port.

 

I've looked at modules but havent had any luck

Cisco-IOS-XE-vlan.yang/Cisco-IOS-XE-vlan-oper.yang - this module appears to provide interface data given the VLAN ID

Cisco-IOS-XE-native.yang

Cisco-IOS-XE-interfaces.yang

  • the "groupting interface-switchport-grouping" looked promising, but it appears to be for settting up config, NOT GETTING config

Cisco-IOS-XE-interfaces-oper.yang

 

I also tried searching through https://yangcatalog.org/yang-search without much luck their either.

 

Is there a way to get the configured switchport-access-vlan for a given port using Cisco-IOS-XE yang models ? If yes, what would the restconf URI be ?

 

If not, is there a workaround ?

For a potential workaround, i'm thinking I could use the vlan-related module to get all vlan memberships, then loop through the membership list and look for the desired interface.

 

Also, what would the URI and request body look like for a RESTCONF api call to update a switchport access vlan, given a port ?

 

1 Reply 1

Alex Stevenson
Cisco Employee
Cisco Employee

Hi @jorgrive,

 

You may want to check out this discussion:

Solved: How to build my own URL for RESTCONF

 

As well as this Cisco Live Presentation:

Model Driven Network Automation with IOS-XE

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: