This section provides a sample of querying the bandwidth usage of an interface using the get method.
Operation |
XPATH |
---|---|
get |
|
Request example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get>
<filter type="subtree">
<if:interfaces-state xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<if:interface>
<if:name>XGigabitEthernet0/0/1</if:name>
<if:statistics>
<hw-ethernet:ethernet-statistics xmlns:hw-ethernet="urn:huawei:params:xml:ns:yang:huawei-ethernet"/>
</if:statistics>
</if:interface>
</if:interfaces-state>
</filter>
</get>
</rpc>
Response example
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<data>
<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
<name>XGigabitEthernet0/0/1</name>
<statistics>
<ethernet-statistics xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet">
<in-bandwidth>0</in-bandwidth>
<out-bandwidth>0</out-bandwidth>
</ethernet-statistics>
</statistics>
</interface>
</interfaces-state>
</data>
</rpc-reply>