STP Management
This section describes the configuration model of STP management and provides examples of XML packets.
Data Model
The configuration model file matching STP management is huawei-stp.yang.
Object |
Description |
Value |
Remarks |
---|---|---|---|
/huawei-stp:stp/enable |
Indicates whether to enable STP. |
The value is of the Boolean type:
|
NA |
/huawei-stp:stp/mode |
Indicates the STP mode. |
The value is of the enumerated type:
|
NA |
/huawei-stp:stp/bpdu-protection |
Indicates whether to enable BPDU protection. |
The value is of the Boolean type:
|
NA |
/huawei-stp:stp/edged-port-enable |
Indicates whether to configure a port as an edge port. |
The value is of the enumerated type:
|
NA |
/huawei-stp:stp/stp-priority/instance-id |
Indicates the STP instance ID. |
The value is an integer in the range from 0 to 4094. |
NA |
/huawei-stp:stp/stp-priority/priority |
Indicates the switching device priority. |
The value is an integer in the range from 0 to 61440. The value must be an integer multiple of 4096, for example, 0, 4096, and 8192. |
NA |
/huawei-stp:stp/stp-mstp/process-list/processid |
Indicates an MSTP process. |
The value is an integer in the range from 1 to 63. |
NA |
/huawei-stp:stp/stp-mstp/process-list/bpdu-protection |
Indicates whether to enable BPDU protection in an MSTP process. |
The value is of the Boolean type:
|
NA |
/huawei-stp:stp/stp-mstp/process-list/stp-priority/instance-id |
Indicates the instance ID of an MSTP process. |
The value is an integer in the range from 0 to 4094. |
NA |
/huawei-stp:stp/stp-mstp/process-list/stp-priority/priority |
Indicates the instance priority of an MSTP process. |
The value is an integer in the range from 0 to 61440. |
NA |
/huawei-stp:stp/stp-mstp/process-list/mode |
Indicates the STP mode of an MSTP process. |
The value is of the enumerated type:
|
NA |
/huawei-stp:stp/stp-mstp/process-list/enabled |
Indicates whether to enable STP in an MSTP process. |
The value is of the Boolean type:
|
NA |
/huawei-stp:stp/stp-mstp/process-list/tc-notify/tc-notify-process |
Indicates whether to enable TC notification in an MSTP process. |
The value is of the Boolean type:
|
NA |
/huawei-stp:stp/region-configuration/region-name |
Indicates the MST region name. |
The value is a string of 1 to 32 characters. |
NA |
/huawei-stp:stp/region-configuration /revision-level |
Indicates the revision level of an MST region. |
The value is an integer in the range from 0 to 65535. |
NA |
/huawei-stp:stp/region-configuration/instance/instance-id |
Indicates the instance ID of an MST region. |
The value is an integer in the range from 0 to 4094. |
NA |
/huawei-stp:stp/region-configuration/instance/map-vlan |
Indicates the mapping VLAN of an MST region. |
The value is an integer in the range from 1 to 4094. |
NA |
/huawei-stp:stp/auto-recovery/cause |
Indicates the auto-recovery cause of an interface in Error-Down state. |
The value is of the enumerated type: bpdu-protection. |
NA |
/huawei-stp:stp/auto-recovery/interval |
Indicates the auto-recovery interval. |
The value is an integer in the range from 30 to 86400. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/enable |
Indicates whether to enable STP on an interface. |
The value is of the Boolean type:
|
NA |
/ietf-interfaces:interface/huawei-stp:stp/edged-port-enable |
Indicates whether to configure a port as an edge port. |
The value is of the enumerated type:
|
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-port-instance/ port-instance/instance-id |
Indicates the instance ID of an interface. |
The value is an integer in the range from 0 to 4094. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-port-instance/port-instance/cost |
Indicates the interface cost of an instance. |
The value is an integer in the range from 1 to 200000000. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-port-instance/port-instance/port-priority |
Indicates the interface priority of an instance. |
The value is an integer in the range from 0 to 240. The value must be an integer multiple of 16, for example, 0, 16, or 32. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/process-mstp-id |
Indicates the process ID of an interface. |
The value is an integer in the range from 1 to 63. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/instance-id |
Indicates the instance ID of a process on an interface. |
The value is an integer in the range from 0 to 4094. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/port-priority |
Indicates the interface priority of a specified instance in a specified process. |
The value is an integer in the range from 0 to 240. The value must be an integer multiple of 16, for example, 0, 16, or 32. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp/stp-mstp-instance/process-mstp/cost |
Indicates the interface cost of a specified process. |
The value is an integer in the range from 1 to 200000000. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp-bind/process-list/process-id |
Indicates the ID of a process bound to an interface. |
The value is an integer in the range from 1 to 63. |
NA |
/ietf-interfaces:interface/huawei-stp:stp/stp-mstp-bind/process-list/link-share-port |
Indicates whether to enable process sharing on an interface. |
The value is of the Boolean type:
|
NA |
/huawei-stp:stp-state-get/request-num |
Indicates the maximum number of spanning tree state records that can be queried at a time. |
The value is an integer in the range from 1 to 1024. If this object is not specified, 1024 records are queried by default. |
NA |
/huawei-stp:stp-state-get/filter-condition/process-id |
Indicates the ID of an MSTP process. |
The value is an integer in the range from 0 to 256. The default value is 0 during the query of VBST state information. |
NA |
/huawei-stp:stp-state-get/filter-condition/mstid-vlan-id |
Indicates the spanning tree instance ID or VLAN ID. |
The value is an integer in the range from 0 to 4094. |
NA |
/huawei-stp:stp-state-get/filter-condition/interface-name |
Indicates the name of an interface. |
The value is a string of 1 to 63 characters and consists of the interface type and interface number. |
NA |
/huawei-stp:stp-state-get/get-next-request/last-process-id |
Indicates the MSTP process ID during the last successful query of the spanning tree state. |
The value is an integer in the range from 0 to 256. The default value is 0 during the query of VBST state information. |
|
/huawei-stp:stp-state-get/get-next-request/last-mstid-vlan-id |
Specifies the spanning tree instance ID or VLAN ID during the last successful query of the spanning tree state. |
The value is an integer in the range from 0 to 4094. |
|
/huawei-stp:stp-state-get/get-next-request/last-interface-name |
Indicates the interface name during the last successful query of the spanning tree state. |
The value is a string of 1 to 63 characters and consists of the interface type and interface number. |
|
/huawei-stp:stp-state-get/has-more |
Indicates whether there is spanning tree state information that is not queried. |
The value is of the Boolean type:
|
NA |
/huawei-stp:stp-state-get/stp-state/process-id |
Indicates the queried MSTP process ID. |
The value is an integer in the range from 0 to 256. The default value is 0 during the query of VBST state information and statistics. |
NA |
/huawei-stp:stp-state-get/stp-state/mstid-vlan-id |
Indicates the queried spanning tree instance ID or VLAN ID. |
The value is an integer in the range from 0 to 4094. |
NA |
/huawei-stp:stp-state-get/stp-state/interface-name |
Indicates the queried interface name. |
The value is a string of 1 to 63 characters and consists of the interface type and interface number. |
NA |
/huawei-stp:stp-state-get/stp-state/mode |
Indicates the queried spanning tree mode. |
The value is of the enumerated type:
|
NA |
/huawei-stp:stp-state-get/stp-state/role |
Indicates the queried interface role. |
The value is of the enumerated type:
|
NA |
/huawei-stp:stp-state-get/stp-state/status |
Indicates the queried interface state. |
The value is of the enumerated type:
|
NA |
/huawei-stp:stp-state-get/stp-state/protection |
Indicates the queried interface protection type. |
The value is of the enumerated type:
|
NA |
Querying the STP State
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 |
XGigabitEthernet1/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>XGigabitEthernet1/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>XGigabitEthernet1/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>
Configuring the STP Mode
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>
Configuring BPDU Protection
This section provides a sample of delivering BPDU protection configurations to the device using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp/bpdu-protection |
Data Requirements
Item |
Data |
Description |
---|---|---|
BPDU protection |
true |
Enable BPDU protection. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" 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:bpdu-protection>true</huawei-stp:bpdu-protection> </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="1"> <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="2"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/bpdu-protection</error-path> <error-message>parse rpc config error.(Invalid value "true1" in "bpdu-protection" element.).</error-message> </rpc-error> </rpc-reply>
Configuring an Edge Port
This section provides a sample of delivering edged-port-enable configurations to the device using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp/edged-port-enable |
Data Requirements
Item |
Data |
Description |
---|---|---|
Edge port |
true |
Configure an interface as an edge port. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="3" 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:edged-port-enable>true</huawei-stp:edged-port-enable> </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="3"> <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="4"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/edged-port-enable</error-path> <error-message>parse rpc config error.(Invalid value "true1" in "edged-port-enable" element.).</error-message> </rpc-error> </rpc-reply>
Configuring the STP Priority
This section provides a sample of delivering stp-priority configurations to the device using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp/stp-priority |
Data Requirements
Item |
Data |
Description |
---|---|---|
STP instance ID |
1 |
Set the STP instance ID to 1. |
STP priority |
4096 |
Set the STP priority of the device to 4096. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="2" 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:stp-priority> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:priority>4096</huawei-stp:priority> </huawei-stp:stp-priority> </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="2"> <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="4"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/stp-priority</error-path> <error-message>parse rpc config error.(Unknown element "instance-id".).</error-message> </rpc-error> </rpc-reply>
Configuring Functions in the MSTP Process View
This section provides a sample of delivering configurations in the MSTP process view to the device using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp/stp-mstp/process-list |
Data Requirements
Item |
Data |
Description |
---|---|---|
MSTP process ID |
1 |
Set the MSTP process ID to 1. |
Whether to enable BPDU protection for the MSTP process |
true |
Enable BPDU protection for the MSTP process. |
Instance ID of the MSTP process |
1 |
Set the instance ID of the MSTP process to 1. |
Priority of a specified instance in the MSTP process |
0 |
Set the priority of instance 1 in MSTP process 1 to 0. |
Whether to enable STP for the MSTP process |
true |
Enable STP for the MSTP process. |
STP mode in the MSTP process |
stp |
Set the STP mode in the MSTP process to stp. |
Whether to enable TC notification for the MSTP process |
true |
Enable TC notification for the MSTP process. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" 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:stp-mstp> <huawei-stp:process-list> <huawei-stp:process-id>1</huawei-stp:process-id> <huawei-stp:bpdu-protection>true</huawei-stp:bpdu-protection> <huawei-stp:stp-priority> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:priority>0</huawei-stp:priority> </huawei-stp:stp-priority> <huawei-stp:enabled>true</huawei-stp:enabled> <huawei-stp:mode>stp</huawei-stp:mode> <huawei-stp:tc-notify> <huawei-stp:tc-notify-process>true</huawei-stp:tc-notify-process> </huawei-stp:tc-notify> </huawei-stp:process-list> </huawei-stp:stp-mstp> </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="1"> <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="5"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/huawei-stp:stp/stp-mstp/process-list</error-path> <error-message>parse rpc config error.(Unknown element "process-id".).</error-message> </rpc-error> </rpc-reply>
Configuring an MST Region
This section provides a sample of delivering MST region configurations to the device using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp/region-configuration |
Data Requirements
Item |
Data |
Description |
---|---|---|
Name of an MST region |
11 |
Set the name of an MST region to 11. |
Revision level of the MST region |
1 |
Set the revision level of the MST region to 1. |
Instance ID of the MST region |
1 |
Set the instance ID of the MST region to 1. |
Mapping VLAN of the MST region |
100 |
Set the mapping VLAN of the MST region to VLAN 100. |
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:region-configuration> <huawei-stp:region-name>11</huawei-stp:region-name> <huawei-stp:revision-level>1</huawei-stp:revision-level> <huawei-stp:instance> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:map-vlan>100</huawei-stp:map-vlan> </huawei-stp:instance> </huawei-stp:region-configuration> </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-> <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-> <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 "region-configuration".).</error-message> </rpc-error> </rpc-reply>
Configuring Auto-Recovery Functions
This section provides a sample of delivering auto-recovery configurations to the device using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/huawei-stp:stp/auto-recovery |
Data Requirements
Item |
Data |
Description |
---|---|---|
Auto-recovery cause for an interface in error-down state |
bpdu-protection |
Set the auto-recovery cause for an interface in error-down state to bpdu-protection. |
Auto-recovery interval |
30 |
Set the auto-recovery interval to 30s. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="5" 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:auto-recovery> <huawei-stp:cause>bpdu-protection</huawei-stp:cause> <huawei-stp:interval>30</huawei-stp:interval> </huawei-stp:auto-recovery> </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="3"> <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="4"> <rpc-error> <error-app-tag>-1</error-app-tag> <error-message>Wrong parameter.</error-message> <error-info>Error on node /huawei-stp:stp/auto-recovery</error-info> </rpc-error> </rpc-reply>
Configuring STP on an Interface
This section provides a sample of delivering interface-based STP configurations to the device using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/ietf-interfaces:interfaces/interface/huawei-stp:stp |
Data Requirements
Item |
Data |
Description |
---|---|---|
Interface name |
Eth-Trunk1 |
Set the interface name to Eth-Trunk1. |
Whether to enable STP on the interface |
true |
Enable STP on the interface. |
Interface as an edge port |
true |
Configure the interface as an edge port. |
Instance ID of the interface |
1 |
Set the instance ID of the interface to 1. |
Cost of a specified instance of the interface |
1 |
Set the cost of instance 1 of the interface to 1. |
Interface priority of a specified instance |
0 |
Set the interface priority of instance 1 to 0. |
Process ID of the interface |
1 |
Set the process ID of the interface to 1. |
Instance ID of a specified process on the interface |
1 |
Set the instance ID of process 1 on the interface to 1. |
Interface priority of a specified instance of a specified process |
0 |
Set the interface priority of instance 1 of process 1 to 0. |
Cost of a specified process on the interface |
1 |
Set the cost of process 1 on the interface to 1. |
Process ID bound to the interface |
1 |
Set the process ID bound to the interface to 1. |
Whether to enable process sharing on the interface |
true |
Enable process sharing on the interface. |
Request Example
<?xml version='1.0' encoding='UTF-8'?> <rpc message-id="11" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>Eth-Trunk1</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type> <huawei-stp:stp xmlns:huawei-stp="urn:huawei:params:xml:ns:yang:huawei-stp"> <huawei-stp:enable>true</huawei-stp:enable> <huawei-stp:edged-port-enable>true</huawei-stp:edged-port-enable> <huawei-stp:stp-port-instance> <huawei-stp:port-instance> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:cost>1</huawei-stp:cost> <huawei-stp:port-priority>0</huawei-stp:port-priority> </huawei-stp:port-instance> </huawei-stp:stp-port-instance> <huawei-stp:port-protection>loop-mode</huawei-stp:port-protection> <huawei-stp:stp-mstp> <huawei-stp:stp-mstp-instance> <huawei-stp:process-mstp> <huawei-stp:process-mstp-id>1</huawei-stp:process-mstp-id> <huawei-stp:instance-id>1</huawei-stp:instance-id> <huawei-stp:port-priority>0</huawei-stp:port-priority> <huawei-stp:cost>1</huawei-stp:cost> </huawei-stp:process-mstp> </huawei-stp:stp-mstp-instance> <huawei-stp:stp-mstp-bind> <huawei-stp:process-list> <huawei-stp:process-id>1</huawei-stp:process-id> <huawei-stp:link-share-port>true</huawei-stp:link-share-port> </huawei-stp:process-list> </huawei-stp:stp-mstp-bind> </huawei-stp:stp-mstp> </huawei-stp:stp> </if:interface> </if:interfaces> </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="11"> <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="12"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-path>/ietf-interfaces:interfaces/interface[name='Eth-Trunk1']/huawei-stp:stp/stp-mstp/stp-mstp-bind/process-list[processid='100000']/processid</error-path> <error-message>parse rpc config error.(Invalid value "100000" in "processid" element.).</error-message> </rpc-error> </rpc-reply>