Published On: August 6ᵗʰ, 2019 02:12

API Reference for Cisco Enterprise Network Function Virtualization Infrastructure Software

Table 1. Spanning-Tree Individual Elements APIs

Action

Method

Payload Required

API

To get the spanning tree configuration

GET

No

/api/running/switch/spanning-tree?deep

To define Bridge Protocol Data Unit (BPDU) handling when the spanning tree is disabled globally or on a single interface

GET

No

/api/running/switch/spanning-tree?select=bpdu

To enable the spanning-tree functionality

GET

No

/api/running/switch/spanning-tree?select=enable

To configure the spanning-tree bridge forward time, which is the amount of time a port remains in the listening and learning states before entering the forwarding state.

GET

No

/api/running/switch/spanning-tree?select=forward-time

To select the Spanning Tree Protocol (STP) protocol

GET

No

/api/running/switch/spanning-tree?select=mode

To configure the number of times Hello messages of the device is broadcasted to other devices.

GET

No

/api/running/switch/spanning-tree?select=hello-time

To configure the STP maximum age

GET

No

/api/running/switch/spanning-tree?select=max-age

To shutdown an interface if it receives a loopback BPDU

GET

No

/api/running/switch/spanning-tree?select=loopback-guard

To configure the path cost for MST calculations.

GET

No

/api/running/switch/spanning-tree/pathcost?deep

To set the default path cost method.

GET

No

/api/running/switch/spanning-tree/pathcost?select=method

To configure the device STP priority, which is used to determine which bridge is selected as the root bridge.

GET

No

/api/running/switch/spanning-tree?select=priority

Example: GET Spanning-Tree APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?deep

Example: GET Spanning-Tree bpdu APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=bpdu

Example: GET Spanning-Tree enable APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=enable

Example: GET Spanning-Tree forward-time APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=forward-time

Example: GET Spanning-Tree mode APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=mode

Example: GET Spanning-Tree hello-time APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=hello-time

Example: GET Spanning-Tree max-age APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=max-age

Example: GET Spanning-Tree loopback-guard APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=loopback-guard

Example: GET Spanning-Tree pathcost APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree/pathcost?deep

Example: GET Spanning-Tree pathcost method APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree/pathcost?select=method

Example: GET Spanning-Tree priority APIs

curl -k -u admin:admin -X GET https://209.165.201.1/api/running/switch/spanning-tree?select=priority

Create Spanning-Tree APIs

Table 2. Create Spanning-Tree APIs

Action

Method

Payload Required

API

To create the spanning-tree elements

PATCH

Yes

/api/running/switch/spanning-tree

Example for Create Spanning-Tree APIs Payload

<spanning-tree><bpdu>filtering</bpdu></spanning-tree>

Example for Create Spanning-Tree APIs Payload

<spanning-tree><forward-time>18</forward-time></spanning-tree>
Table 3. Description for Create Spanning-Tree APIs Payload

Property

Type

Description

Mandatory/Default Value

forward-time

Integer

Specifies the spanning-tree forward time in seconds. (Range: 4–30)

Yes

Example for Create Spanning-Tree APIs Payload

<spanning-tree><mode>rstp</mode></spanning-tree>
Table 4. Description for Create Spanning-Tree APIs Payload

Property

Type

Description

Mandatory/Default Value

mode

String

Specifies the STP, RSTP or MSTP mode

Yes

Example for Create Spanning-Tree APIs Payload

<spanning-tree><hello-time>6</hello-time></spanning-tree>
Table 5. Description for Create Spanning-Tree APIs Payload

Property

Type

Description

Mandatory/Default Value

hello-time

Integer

Specifies the spanning-tree Hello time in seconds. (Range: 1–10)

Yes

Example for Create Spanning-Tree APIs Payload

<spanning-tree><max-age>24</max-age></spanning-tree>
Table 6. Description for Create Spanning-Tree APIs Payload

Property

Type

Description

Mandatory/Default Value

max-age

Integer

Specifies the spanning-tree bridge maximum age in seconds. (Range:6–40)

Yes

Example for Create Spanning-Tree APIs Payload

<spanning-tree><loopback-guard></loopback-guard></spanning-tree>

Example for Create Spanning-Tree APIs Payload

<spanning-tree><method>short</method></spanning-tree>
Table 7. Description for Create Spanning-Tree APIs Payload

Property

Type

Description

Mandatory/Default Value

method

String

Specifies the default port path costs

Yes

Example for Create Spanning-Tree APIs Payload

<spanning-tree><priority>8192</priority></spanning-tree>
Table 8. Description for Create Spanning-Tree APIs Payload

Property

Type

Description

Mandatory/Default Value

priority

String

Specifies the device priority for the specified spanning-tree instance.

yes

Example: PATCH Create Spanning-Tree bpdu APIs

curl -k -u admin:admin -d "<spanning-tree><bpdu>filtering</bpdu></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Create Spanning-Tree forward-time APIs

curl -k -u admin:admin -d "<spanning-tree><forward-time>18</forward-time></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Create Spanning-Tree mode APIs

curl -k -u admin:admin -d "<spanning-tree><mode>rstp</mode></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Create Spanning-Tree hello-time APIs

curl -k -u admin:admin -d "<spanning-tree><hello-time>6</hello-time></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Create Spanning-Tree max-age APIs

curl -k -u admin:admin -d "<spanning-tree><max-age>24</max-age></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Create Spanning-Tree loopback-guard APIs

curl -k -u admin:admin -d "<spanning-tree><loopback-guard></loopback-guard></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Create Spanning-Tree method APIs

curl -k -u admin:admin -d "<spanning-tree><method>short</method></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree/pathcost -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Create Spanning-Tree priority APIs

curl -k -u admin:admin -d "<spanning-tree><priority>8192</priority></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Modify Spanning-Tree APIs

Table 9. Modify Spanning-Tree APIs

Action

Method

Payload Required

API

To modify the spanning-tree elements

PATCH

Yes

/api/running/switch/spanning-tree

Example: PATCH Modify Spanning-Tree bpdu APIs

curl -k -u admin:admin -d "<spanning-tree><bpdu>filtering</bpdu></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Modify Spanning-Tree forward-time APIs

curl -k -u admin:admin -d "<spanning-tree><forward-time>18</forward-time></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Modify Spanning-Tree mode APIs

curl -k -u admin:admin -d "<spanning-tree><mode>rstp</mode></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Modify Spanning-Tree hello-time APIs

curl -k -u admin:admin -d "<spanning-tree><hello-time>6</hello-time></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Modify Spanning-Tree max-age APIs

curl -k -u admin:admin -d "<spanning-tree><max-age>24</max-age></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Modify Spanning-Tree loopback-guard APIs

curl -k -u admin:admin -d "<spanning-tree><loopback-guard></loopback-guard></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Modify Spanning-Tree method APIs

curl -k -u admin:admin -d "<spanning-tree><method>short</method></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree/pathcost -H "Content-Type: application/vnd.yang.data+xml"

Example: PATCH Modify Spanning-Tree priority APIs

curl -k -u admin:admin -d "<spanning-tree><priority>8192</priority></spanning-tree>" -X PATCH https://209.165.201.1/api/running/switch/spanning-tree -H "Content-Type: application/vnd.yang.data+xml"

Delete Spanning-Tree APIs

Table 10. Delete Spanning-Tree APIs

Action

Method

Payload Required

API

To restore the default configuration

DELETE

No

/api/running/switch/spanning-tree/bpdu

To disable the spanning-tree functionality.

DELETE

No

/api/running/switch/spanning-tree/enable

To restore the default configuration

DELETE

No

/api/running/switch/spanning-tree/forward-time

To restore the default configuration

DELETE

No

/api/running/switch/spanning-tree/mode

To restore the default configuration

DELETE

No

/api/running/switch/spanning-tree/hello-time

To restore the default configuration

DELETE

No

/api/running/switch/spanning-tree/max-age

To restore the default configuration

DELETE

No

/api/running/switch/spanning-tree/loopback-guard

To restore the default configuration

DELETE

No

/api/running/switch/spanning-tree/pathcost

To restore the default device spanning-tree priority.

DELETE

No

/api/running/switch/spanning-tree/priority

Example: DELETE Delete Spanning-Tree bpdu APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/bpdu

Example: DELETE Delete Spanning-Tree APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/enable

Example: DELETE Delete Spanning-Tree forward-time APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/forward-time

Example: DELETE Delete Spanning-Tree mode APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/mode

Example: DELETE Delete Spanning-Tree hello-time APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/hello-time

Example: DELETE Delete Spanning-Tree max-age APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/max-age

Example: DELETE Delete Spanning-Tree loopback-guard APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/loopback-guard

Example: DELETE Delete Spanning-Tree pathcost APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/pathcost

Example: DELETE Delete Spanning-Tree priority APIs

curl -k -u admin:admin -X DELETE https://209.165.201.1/api/running/switch/spanning-tree/priority