This section provides a sample of configuring a VLAN pool using the config method.
Operation |
XPATH |
|---|---|
edit-config:config |
|
| Item | Data | Description |
|---|---|---|
| Name of a VLAN pool | april | Name of the VLAN pool is april. |
| Range of VLANs added to the VLAN pool | 10..20 | Add VLAN 10 to VLAN 20 to the VLAN pool. |
| VLAN assignment algorithm in a VLAN pool | even | Sets the VLAN assignment algorithm to even. |
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="6" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config>
<target>
<running/>
</target>
<config>
<huawei-vlan:vlan-pools xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
<huawei-vlan:vlan-pool>
<huawei-vlan:name>april</huawei-vlan:name>
<huawei-vlan:vlans>10..20</huawei-vlan:vlans>
<huawei-vlan:assignment-method>even</huawei-vlan:assignment-method>
</huawei-vlan:vlan-pool>
</huawei-vlan:vlan-pools>
</config>
</edit-config>
</rpc>
# 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="6"> <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="6">
<rpc-error>
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-path>/huawei-vlan:vlan-pools/vlan-pool[name='april']/vlans[.='10-20']</error-path>
<error-message>parse rpc config error.(Invalid value in "vlans" element.).</error-message>
</rpc-error>
</rpc-reply>