This section describes how to configure interface speed using the rpc method.
Operation |
XPATH |
---|---|
rpc |
/ietf-interfaces:interfaces/interface/hw-ethernet:physical-config/speed |
Data requirement
Item |
Data |
Description |
---|---|---|
Port speed |
100Mbps |
Indicates that the interface speed is 100 Mbit/s. |
Request example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="15" 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>GigabitEthernet0/0/2</if:name>
<if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
<hw-ethernet:physical-config xmlns:hw-ethernet="urn:huawei:params:xml:ns:yang:huawei-ethernet">
<hw-if:speed>100Mbps</hw-if:speed>
</hw-ethernet:physical-config>
</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="15"> <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="16"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-message>parse rpc config error.</error-message> </rpc-error> </rpc-reply>