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

NXAPI spanning-tree vlan 1234 priority 16384 with python

scough
Level 1
Level 1

Hi,

we are trying to set up spanning tree for a specific vlan with a specific priority on a Nexus 9k with python using the nxapi.

We were able to create a vlan and name it this way. Spanning-tree is missing.

We want to deliver this cli-command: spanning-tree vlan 1234 priority 16384

https://pubhub.devnetcloud.com/media/dme-docs-10-2-2/docs/Discovery%20Protocols/stp:Vlan/

https://developer.cisco.com/docs/cisco-nexus-3000-and-9000-series-nx-api-rest-sdk-user-guide-and-api-reference-release-9-3x/#!configuring-stp/enabling-or-disabling-spanning-tree-protocol-on-a-vlan

We are trying this url and jsonData:

url = f"https://{ip}/api/mo/sys/stp/inst/vlan-1234.json"
jsonData = {
           "stpVlan": {
                     "attributes": {
                                  "priority": "4"
                                   }
                      }
           }
 
1 Accepted Solution

Accepted Solutions

scough
Level 1
Level 1

It is solved.

The main problem has been the use of VPC!

The config had to be imported into both devices because of vpc.

 

And the json-part should look like this.

"priority": "16384"

 

View solution in original post

1 Reply 1

scough
Level 1
Level 1

It is solved.

The main problem has been the use of VPC!

The config had to be imported into both devices because of vpc.

 

And the json-part should look like this.

"priority": "16384"

 

Review Cisco Networking for a $25 gift card