This section provides a sample of configuring basic attributes of an interface using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
Item |
Data |
Description |
---|---|---|
Interface name |
XGigabitEthernet0/0/10 |
- |
Interface description |
port 001 |
- |
Interface type |
ethernetCsmacd |
The interface is a physical interface. |
Interface status |
true |
The interface is enabled. |
Trap sending function |
disabled |
Disable the function of sending a trap when the interface protocol status changes. |
<?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/10</if:name>
<if:description>port 001</if:description>
<if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
<if:enabled>true</if:enabled>
<if:link-up-down-trap-enable>disabled</if:link-up-down-trap-enable>
</if:interface>
</if:interfaces>
</config>
</edit-config>
</rpc>
<?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>
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2">
<rpc-error>
<error-app-tag>-1</error-app-tag>
<error-message>Wrong interface type.</error-message>
<error-info>Error on node /ietf-interfaces:interfaces/interface[name="XGigabitEthernet0/0/10"]/type</error-info>
</rpc-error>
</rpc-reply>