No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

S600-E V200R012C00 NETCONF YANG API Reference

This document describes the NETCONF YANG API functions supported by the switch, including the data model and samples.
Rate and give feedback :
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Eth-Trunk Management

Eth-Trunk Management

This section describes the configuration model of Eth-Trunk management and provides examples of XML packets.

Data Model

The configuration model file matching Eth-Trunk management is huawei-eth-trunk.yang.

Table 2-149  Eth-Trunk management

Object

Description

Value

Remarks

/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/trunk-work-mode

Indicates the Eth-Trunk mode.

The value is of the enumerated type:
  • lacp
  • manual

N/A

/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/assign-interface

Indicates the Eth-Trunk member interface.

The value is the type and number of a member interface.

In cloud-based management mode, interfaces cannot be added to Eth-Trunk0.

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

Indicates the Eth-Trunk interface to view the configuration.

The Eth-Trunk interface must exist.

This object only supports the get operation.

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

Displays the ID of the Eth-Trunk interface.

NA

NA

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

Displays the working mode of the Eth-Trunk interface.
  • lacp
  • manual

NA

NA

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

Displays the status of the LACP priority preemption in LACP mode.
  • true: Indicates that priority preemption is enabled.
  • false: Indicates that priority preemption is disabled.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/preempt-delay-time

Displays the LACP preemption delay, in seconds.

NA

NA

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

Displays the load balancing mode of the Eth-Trunk interface.

NA

NA

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

Displays the LACP system priority.

NA

NA

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

Displays the system ID.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/least-active-num

Displays the lower threshold of member links that are in Up state.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/max-active-num

Displays the upper threshold of member links that are in Up state.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/max-bandwidth-affected

Displays the maximum number of connections that affect the Eth-Trunk bandwidth.

NA

NA

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

Displays the status of the Eth-Trunk interface.
  • up: Indicates that the Eth-Trunk interface is working properly.
  • down: Indicates that the interface is physically down.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/up-port-num

Displays the number of member interfaces that are in Up state in the Eth-Trunk interface.

NA

NA

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

Displays the name of a member interface.

NA

NA

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

Displays the index of a member interface.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/oper-status

Displays the status of an Eth-Trunk member interface.
  • up: Indicates that the member interface is working properly.
  • down: Indicates that the interface is physically down.

NA

NA

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

Displays the weight of a member interface.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/remote-sys-id

Displays the system ID of a peer member interface.

NA

NA

/huawei-eth-trunk:eth-trunk-state/interface/eth-trunk-member/remote-sys-pri

Displays the LACP system priority of a peer member interface.

NA

NA

Configuring an Eth-Trunk

This section provides a sample of configuring the Eth-Trunk working mode and adding a member interface using the rpc method.

Table 2-150  Configuring an Eth-Trunk

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/trunk-work-mode

/ietf-interfaces:interfaces/interface/huawei-eth-trunk:eth-trunk/assign-interface

Data Requirements

Table 2-151  Configuring an Eth-Trunk

Item

Data

Description

Working mode of an Eth-Trunk

lacp

Set the working mode of an Eth-Trunk to LACP.

Member interface

GigabitEthernet0/0/1

Add GigabitEthernet0/0/1 to Eth-Trunk1.

Request Example

# Configure the physical interfaces to be added to an Eth-Trunk.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="6" 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/1</if:name>
          <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:interface>
      </if:interfaces>
    </config>
  </edit-config>
</rpc>

# Configure an Eth-Trunk.

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="6" 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>Eth-Trunk1</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <hw-eth-trunk:eth-trunk xmlns:hw-eth-trunk="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
            <hw-eth-trunk:trunk-work-mode>lacp</hw-eth-trunk:trunk-work-mode>
            <hw-eth-trunk:assign-interface>GigabitEthernet0/0/1</hw-eth-trunk:assign-interface>
          </hw-eth-trunk:eth-trunk>
        </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="6">
  <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="12">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message>The port GigabitEthernet0/0/1 has other configurations. Please clear configuration first.The error port is GigabitEthernet0/0/1.</error-message>
    <error-info>Error on node /ietf-interfaces:interfaces/interface[name="Eth-Trunk1"]/huawei-eth-trunk:eth-trunk/assign-interface[.="GigabitEthernet0/0/1"]</error-info>
  </rpc-error>
</rpc-reply>

Example of Querying the Eth-Trunk Configuration

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

Table 2-152  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>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 6359

Downloads: 8

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next