< Home

Example of Querying the Eth-Trunk Configuration

This section provides a sample of querying the Eth-Trunk configuration information using the get method.

Table 1 Displaying the Eth-Trunk configuration

Operation

XPATH

get

/huawei-eth-trunk:eth-trunk-state/interface

Data Requirement

Item

Data

Description

Eth-Trunk name

Eth-Trunk100

Displays the configuration of Eth-Trunk100 in LACP mode.

Eth-Trunk name

Eth-Trunk101

Displays the configuration of Eth-Trunk101 in manual mode.

Request Example 1

# Displays the configuration of Eth-Trunk100 in LACP mode.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <hw-eth-trunk:eth-trunk-state xmlns:hw-eth-trunk="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
        <hw-eth-trunk:interface>
          <hw-eth-trunk:name>Eth-Trunk100</hw-eth-trunk:name>
        </hw-eth-trunk:interface>
      </hw-eth-trunk:eth-trunk-state>
    </filter>
  </get>
</rpc>

Response Example 1

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="3">
  <data>
    <eth-trunk-state xmlns="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
      <interface>
        <name>Eth-Trunk100</name>
        <lag-id>100</lag-id>
        <trunk-work-mode>lacp</trunk-work-mode>
        <preempt-mode>false</preempt-mode>
        <load-balance>dst-mac</load-balance>
        <system-priority>32768</system-priority>
        <system-id>00:0b:09:47:5c:23</system-id>
        <least-active-num>1</least-active-num>
        <max-active-num>32</max-active-num>
        <oper-status>up</oper-status>
        <up-port-num>1</up-port-num>
        <eth-trunk-member>
          <name>XGigabitEthernet0/0/6</name>
          <index>204</index>
          <oper-status>down</oper-status>
          <weight>1</weight>
          <remote-sys-id>00:00:00:00:00:00</remote-sys-id>
          <remote-sys-pri>0</remote-sys-pri>
        </eth-trunk-member>
        <eth-trunk-member>
          <name>XGigabitEthernet0/0/12</name>
          <index>210</index>
          <oper-status>up</oper-status>
          <weight>1</weight>
          <remote-sys-id>f8:4a:bf:e7:d4:60</remote-sys-id>
          <remote-sys-pri>32768</remote-sys-pri>
        </eth-trunk-member>
      </interface>
    </eth-trunk-state>
  </data>
</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="3">
  <data/>
</rpc-reply>

Request Example 2

# Displays the configuration of Eth-Trunk101 in manual mode.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="4" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <hw-eth-trunk:eth-trunk-state xmlns:hw-eth-trunk="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
        <hw-eth-trunk:interface>
          <hw-eth-trunk:name>Eth-Trunk101</hw-eth-trunk:name>
        </hw-eth-trunk:interface>
      </hw-eth-trunk:eth-trunk-state>
    </filter>
  </get>
</rpc>

Response Example 2

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="4">
  <data>
    <eth-trunk-state xmlns="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
      <interface>
        <name>Eth-Trunk101</name>
        <trunk-work-mode>manual</trunk-work-mode>
        <load-balance>dst-ip</load-balance>
        <least-active-num>1</least-active-num>
        <max-bandwidth-affected>32</max-bandwidth-affected>
        <oper-status>up</oper-status>
        <up-port-num>1</up-port-num>
        <eth-trunk-member>
          <name>XGigabitEthernet0/0/18</name>
          <index>216</index>
          <oper-status>up</oper-status>
          <weight>1</weight>
        </eth-trunk-member>
      </interface>
    </eth-trunk-state>
  </data>
</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="4">
  <data/>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic