< Home

Querying the Bandwidth Usage of an Interface

This section provides a sample of querying the bandwidth usage of an interface using the get method.

Table 1 Querying the bandwidth usage of an interface

Operation

XPATH

get

  • /ietf-interfaces:interfaces-state/interface/statistics/huawei-ethernet:ethernet-statistics/in-bandwidth
  • /ietf-interfaces:interfaces-state/interface/statistics/huawei-ethernet:ethernet-statistics/out-bandwidth

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>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >