This section provides a sample of configuring the STP mode using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp/enable /huawei-stp:stp/mode |
Data Requirements
Item |
Data |
Description |
---|---|---|
STP |
true |
Enable STP. |
STP mode |
stp |
Set the STP mode to stp. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:enabled>true</huawei-stp:enabled> <huawei-stp:mode>stp</huawei-stp:mode> </huawei-stp:stp> </config> </edit-config> </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="0"> <ok/> </rpc-reply>
Sample of failed 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-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp</error-path> <error-message>parse rpc config error.(Unknown element "enabled".).</error-message> </rpc-error> </rpc-reply>