This section provides a sample of querying the STP state using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp-state-get |
Data Requirements
Item |
Data |
Description |
---|---|---|
Maximum number of spanning tree state records that can be queried at a time |
10 |
Query a maximum of 10 spanning tree state records at a time. |
MSTP process ID |
0 |
- |
STP instance ID |
0 |
- |
Interface name |
XGigabitEthernet0/0/22 |
- |
Request Example
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<huawei-stp:stp-state-get xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp">
<huawei-stp:request-num>10</huawei-stp:request-num>
<huawei-stp:filter-condition>
<huawei-stp:process-id>0</huawei-stp:process-id>
<huawei-stp:mstid-vlan-id>0</huawei-stp:mstid-vlan-id>
<huawei-stp:interface-name>XGigabitEthernet0/0/22</huawei-stp:interface-name>
</huawei-stp:filter-condition>
</huawei-stp:stp-state-get>
</rpc>
Response Example
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<stp-state-get xmlns="urn:huawei:params:xml:ns:yang:huawei-stp">
<has-more>false</has-more>
<stp-state>
<process-id>0</process-id>
<mstid-vlan-id>0</mstid-vlan-id>
<interface-name>XGigabitEthernet0/0/22</interface-name>
<mode>mstp</mode>
<role>designated</role>
<status>forwarding</status>
<protection>none</protection>
</stp-state>
</stp-state-get>
</rpc-reply>
Sample of successful response
<?xml version='1.0' encoding='UTF-8'?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <rpc-error> <error-path>/huawei-stp:stp-state-get/filter-condition/process-id</error-path> <error-message>Value "257" does not satisfy the constraint "0..256" (range, length, or pattern).</error-message> </rpc-error> </rpc-reply>