This section describes how to add a global VLAN to a BD using the rpc method.
Operation |
XPATH |
|---|---|
edit-config:merge |
/huawei-bd/bridge-domains/bridge-domain/members/vlan-id |
Item |
Data |
Description |
|---|---|---|
VLAN ID |
50 |
Add global VLAN 50 to a BD. |
<?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-vlan:vlans xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan">
<huawei-vlan:vlan>
<huawei-vlan:id>50</huawei-vlan:id>
</huawei-vlan:vlan>
</huawei-vlan:vlans>
<bd:bridge-domains xmlns:bd="urn:huawei:params:xml:ns:yang:huawei-bd">
<bd:bridge-domain xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0" xc:operation="merge">
<bd:id>10</bd:id>
<bd:members>
<bd:vlan-id>50</bd:vlan-id>
</bd:members>
</bd:bridge-domain>
</bd:bridge-domains>
</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="5"> <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="0">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message>Execute failed reason: The vlanif has been created, delete it first.</error-message>
<error-info>Error on node /huawei-bd:bridge-domains/bridge-domain[id="10"]/members/vlan-id[.="50"]</error-info>
</rpc-error>
</rpc-reply>