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 V200R011C10 NETCONF YANG API Reference

This document describes the NETCONF 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).
LLDP

LLDP

This section describes the configuration model of LLDP and provides examples of XML packets.

Data Model

The configuration model file of LLDP is huawei-lldp.yang.

Table 2-257  Configuration objects of LLDP

Object

Description

Value

Remarks

/huawei-lldp:lldp/enabled Indicates whether the LLDP function is enabled on the switch. Enumerated value:
  • true: The LLDP function is enabled.
  • false: The LLDP function is disabled.
By default, the LLDP function is enabled on the switch.

N/A

/huawei-device:device/domain-name

Adds a suffix to a device name.

The value is a string of 1 to 255 characters and can contain digits, letters, hyphens (-), underscores (_), and periods (.), but not spaces.

N/A

/huawei-device:device-state/domain-name

Queries the suffix of a device name.

The value is a string.

This object only supports the get operation.

Table 2-258  Switch response information

Object

Description

/ietf-interfaces:interfaces-state/interface/name Indicates the local interface name.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/index Indicates the index of a neighbor.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/chassic-id-sub-type Indicates the ID type of a neighboring device:
  • 1: chassis alias
  • 2: interface alias
  • 3: interface or backplane alias
  • 4: MAC address
  • 5: IP address
  • 6: interface name
  • 7: name of the local device
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/chassis-id Indicates the ID of a neighboring device.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/port-id-sub-type Indicates the ID type of a neighboring interface:
  • 1: interface alias
  • 2: interface or backplane alias
  • 3: MAC address
  • 4: IP address
  • 5: interface name
  • 6: circuit ID of the DHCP agent
  • 7: name of the local device
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/port-id Indicates the ID of a neighboring interface.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/port-description Indicates the description of a neighboring interface.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/system-name Indicates the name of a neighboring device.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/system-description Indicates the description of a neighboring device.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/system-cap-supported Indicates capabilities supported by a neighboring device:
  • cap-repeater: repeater
  • cap-bridge: bridge device
  • cap-wlanAccessPoint: wireless access point
  • cap-router: router
  • cap-telephone: wireless device
  • cap-docsisCableDevice: management station
  • cap-stationOnly: base station
  • cap-other: other capabilities
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/system-cap-enabled Indicates capabilities enabled on a neighboring device:
  • cap-repeater: repeater
  • cap-bridge: bridge device
  • cap-wlanAccessPoint: wireless access point
  • cap-router: router
  • cap-telephone: wireless device
  • cap-docsisCableDevice: management station
  • cap-stationOnly: base station
  • cap-other: other capabilities
Multiple capabilities can be enabled on a neighboring device simultaneously.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/remote-management/subtype Indicates the management address type of a neighboring device:
  • 1: IPv4 address
  • 2: IPv6 address
  • 3: NSAP
  • 4: HDLC
  • 5: BBN 1822
  • 6: MAC address
  • 7: E.163
  • 8: E.164
  • 9: F.69
  • 10: X.121
  • 11: IPX
  • 12: AppleTalk
  • 13: DECnet IV
  • 14: Banyan Vines
  • 15: E.164 with NSAP subaddress
  • 16: DNS
  • 17: Distinguished Name
  • 18: AS number
  • 19: XTP over IPv4
  • 20: XTP over IPv6
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/remote-management/address Indicates the management address of a neighboring device.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/remote-management/if-subtype Indicates the interface index type of the neighbor management address:
  • 1: Unknown
  • 2: interface index
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/remote-management/if-id Indicates the interface index of the neighbor management address.
/ietf-interfaces:interfaces-state/interface/huawei-lldp:lldp/remote-port/remote-management/oid Indicates OID of the neighbor management address.

Configuring LLDP

This section describes how to enable the LLDP function and query the LLDP status using the rpc method.

Table 2-259  Configuring LLDP

Operation

XPATH

rpc

  • /huawei-lldp:lldp/enabled
  • /ietf-interfaces:interfaces-state/interface/name

Data Requirements

Item

Data

Description

Whether to enable the LLDP function on the switch

true

Enable the LLDP function on the switch.

LLDP neighbor information queried on an interface

GigabitEthernet0/0/1

Query LLDP neighbor information on the interface GigabitEthernet0/0/1.

Request Example

# Enable the LLDP function on the switch.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <huawei-lldp:lldp xmlns:huawei-lldp="urn:huawei:params:xml:ns:yang:huawei-lldp">
        <huawei-lldp:enabled>true</huawei-lldp:enabled>
      </huawei-lldp:lldp>
    </config>
  </edit-config>
</rpc>
# Query LLDP neighbor information on the interface GigabitEthernet0/0/1.
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="14" 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>GigabitEthernet0/0/1</if:name>
          <huawei-lldp:lldp xmlns:huawei-lldp="urn:huawei:params:xml:ns:yang:huawei-lldp">
            <huawei-lldp:remote-port/>
          </huawei-lldp:lldp>
        </if:interface>
      </if:interfaces-state>
    </filter>
  </get>
</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="3">
  <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="3">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message>parse rpc config error.</error-message>
  </rpc-error>
</rpc-reply>
# Returned query result
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="14">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>GigabitEthernet0/0/1</name>
        <lldp xmlns="urn:huawei:params:xml:ns:yang:huawei-lldp">
          <remote-port>
            <index>1</index>
            <port-id-sub-type>5</port-id-sub-type>
            <system-cap-supported>cap-bridge cap-router</system-cap-supported>
            <system-name>S600-E</system-name>
            <remote-management>
              <subtype>1</subtype>
              <address>192.168.10.1</address>
              <if-subtype>2</if-subtype>
              <if-id>44</if-id>
              <oid>0.6.15.43.6.1.4.1.2011.5.25.41.1.2.1.1.1</oid>
            </remote-management>
            <chassis-id>a4c6-4fcd-d060</chassis-id>
            <system-description>S628X-PWR-E
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.170 (S600-E V200R011C10SPC200)
Copyright (C) 2000-2017 HUAWEI TECH CO., LTD</system-description>
            <system-cap-enabled>cap-bridge cap-router</system-cap-enabled>
            <port-id>GigabitEthernet0/0/1</port-id>
            <chassic-id-sub-type>4</chassic-id-sub-type>
            <port-description>GigabitEthernet0/0/1</port-description>
          </remote-port>
        </lldp>
      </interface>
    </interfaces-state>
  </data>
</rpc-reply>

Adding a Suffix to a Device Name

This section describes how to add a suffix to a device name using the config method.

Table 2-260  Adding a suffix to a device name

Operation

XPATH

edit-config:config

/huawei-device:device/domain-name

Data Requirement

Item

Data

Description

Suffix of a device name

www.huawei.com

The suffix of a device name is www.huawei.com.

Request Example

<?xml version='1.0' encoding='UTF-8'?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="0">
  <edit-config>
    <target>
      <running/>
    </target>
    <config>
      <dev:device xmlns:dev="urn:huawei:params:xml:ns:yang:huawei-device">
        <dev:domain-name>www.huawei.com</dev:domain-name>
      </dev:device>
    </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="1">
  <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="1">
  <error/>
</rpc-reply>

Querying the Suffix of a Device Name

This section describes how to query the suffix of a device name using the get method.

Table 2-261  Querying the suffix of a device name

Operation

XPATH

get

/huawei-device:device-state/domain-name

Request Example

Query the suffix of a device name configured on the switch.

<?xml version='1.0' encoding='UTF-8'?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="4">
  <get>
    <filter type="subtree">
      <dev:device-state xmlns:dev="urn:huawei:params:xml:ns:yang:huawei-device">
        <dev:domain-name/>
      </dev:device-state>
    </filter>
  </get>
</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="4">
  <data>
    <device-state xmlns="urn:huawei:params:xml:ns:yang:huawei-device">
      <domain-name>www.huawei.com</domain-name>
    </device-state>
  </data>
</rpc-reply>

If no default domain name suffix is configured on the switch, the following information is displayed after a query request is sent:

<?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: 2019-09-23

Document ID: EDOC1000178028

Views: 4949

Downloads: 0

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