This section provides a sample of configuring MAD using the config method.
Operation |
XPATH |
|---|---|
edit-config:config |
/ietf-interfaces:interfaces/interface/huawei-stack:mad-config/detect-mode /ietf-interfaces:interfaces/interface/huawei-stack:mad-config/relay-proxy-enable |
Data Requirements
Item |
Data |
Description |
|---|---|---|
Interface name |
Eth-Trunk3 |
- |
MAD mode |
MAD in relay mode |
- |
Relay function |
True |
- |
Request Example
<?xml version="1.0" encoding="utf-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<edit-config>
<target>
<running/>
</target>
<config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" nc:operation="replace">
<interface>
<name>Eth-Trunk3</name>
<type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</type>
<hw-stack:mad-config xmlns:hw-stack="urn:huawei:params:xml:ns:yang:huawei-stack">
<hw-stack:detect-mode>relay</hw-stack:detect-mode>
<hw-stack:relay-proxy-enable>true</hw-stack:relay-proxy-enable>
</hw-stack:mad-config>
</interface>
</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="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="1">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message>Some ports have been enabled MAD detect mode direct, please cancel the configuration first.</error-message>
<error-info>Error on node /ietf-interfaces:interfaces/interface[name="Eth-Trunk3"]/huawei-stack:mad-config/detect-mode</error-info>
</rpc-error>
</rpc-reply>