This section describes how to add a Layer 2 sub-interface in default encapsulation mode to a BD using the rpc method.
Operation |
XPATH |
---|---|
edit-config:merge |
/huawei-bd/bridge-domains/bridge-domain/members/interface-name |
Item |
Data |
Description |
---|---|---|
Interface name |
XGigabitEthernet0/0/3 |
Add a Layer 2 sub-interface in default encapsulation mode to a BD. |
<?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> <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <if:interface> <if:name>XGigabitEthernet0/0/3</if:name> <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>> <huawei-vlan:vlan xmlns:huawei-vlan="urn:huawei:params:xml:ns:yang:huawei-vlan"> <huawei-vlan:port-link-type>trunk</huawei-vlan:port-link-type> </huawei-vlan:vlan> </if:interface> </if:interfaces> <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:interface-name>XGigabitEthernet0/0/3</bd:interface-name> </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="1">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message>Execute failed reason: Wrong parameter found at '^' position.</error-message>
<error-info>Error on node /huawei-bd:bridge-domains/bridge-domain[id="10"]/members/interface-name[.="XGigabitEthernet0/0/3"]</error-info>
</rpc-error>
</rpc-reply>