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).
Port Management

Port Management

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

Data Model

The configuration model files matching interface management are ietf-interfaces.yang, huawei-traffic-security.yang, huawei-ethernet.yang, huawei-interface.yang and huawei-interfaces.yang.

Table 2-130  Port management

Object

Description

Value Range

Remarks

/ietf-interfaces:interfaces/interface/huawei-traffic:traffic-security/isolate

Indicates that port isolation is enabled.

The value is of the Boolean type:
  • true: Port isolation is enabled.

  • false: Port isolation is disabled.

N/A

/ietf-interfaces:interfaces/interface/huawei-traffic-security:security/binding-config/binding-check-enable

Indicates that IPSG is enabled.

The value is as follows:
  • bit ipv4-check { position 0; }
  • bit ipv6-check { position 1; }
  • bit arp-check { position 2; }
  • bit nd-check { position 3; }

N/A

/ietf-interfaces:interfaces/interface/hw-ethernet:physical-config/speed

Indicates the interface rate.

The value is of the enumerated type:
  • 10Mbps

  • 100Mbps

  • 1Gbps

  • 2.5Gbps

  • 5Gbps

  • 10Gbps

  • 40Gbps

  • 100Gbps

N/A

/ietf-interfaces:interfaces/interface/hw-ethernet:physical-config/duplex

Indicates the duplex mode.

Enumerated value:
  • auto: default duplex mode

  • half: half-duplex mode

  • full: full-duplex mode

N/A

/ietf-interfaces:interfaces-state/interface/huawei-interfaces:common/description

Indicates the interface description.

The value is a string of 1 to 242 case-sensitive characters.

N/A

/ietf-interfaces:interfaces-state/interface/name

Indicates the interface name.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

The interface type varies according to the device models.

/ietf-interfaces:interfaces-state/interface/type

Indicates the interface type.

The value is of the enumerated type:
  • ethernetCsmacd: physical interface, Eth-Trunk interface
  • propVirtual: VLANIF or VBDIF interface
  • softwareLoopback: loopback interface
  • tunnel: tunnel interface
  • other: NULL0, NVE, Mtunnel, or Virtual-Template interface

The value of this parameter must contain iana-if-type.

/ietf-interfaces:interfaces-state/interface/admin-status

Indicates the administrative status of an interface.

The value is of the enumerated type:
  • up
  • down

N/A

/ietf-interfaces:interfaces-state/interface/oper-status

Indicates the interface running status.

The value is of the enumerated type:
  • up
  • down

N/A

/ietf-interfaces:interfaces-state/interface/last-change

Indicates the time of the latest status change.

For details, see the definition in RFC 3339.

N/A

/ietf-interfaces:interfaces-state/interface/if-index

Indicates the interface index.

The value is an integer that ranges from 1 to 2147483647.

N/A

/ietf-interfaces:interfaces-state/interface/phys-address

Indicates the physical address of an interface.

The format is H:H:H:H:H:H, where H is a 2-digit hexadecimal number.

N/A

/ietf-interfaces:interfaces-state/interface/speed

Indicates the interface rate.

The value is an integer.

NA

/ietf-interfaces:interfaces-state/interface/statistics

Port traffic statistics.

The value is an integer.

NA

/ietf-interfaces:interfaces-state/interface/huawei-interfaces:common/description

Indicates the duplex mode.

The value is of the enumerated type:
  • half
  • full

NA

/ietf-interfaces:interfaces-state/interface/hw-ethernet:physical-state/speed

Indicates the interface rate.

The value is of the enumerated type:
  • 10Mbps

  • 100Mbps

  • 1Gbps

  • 2.5Gbps

  • 5Gbps

  • 10Gbps

  • 25Gbps

  • 40Gbps

  • 50Gbps

  • 100Gbps

NA

/ietf-interfaces:interfaces-state/interface/hw-ethernet:physical-state/duplex

Indicates the duplex mode.

The value is of the enumerated type:
  • half
  • full

NA

/ietf-interfaces:interfaces-state/interface/statistics/in-octets

Indicates the number of incoming packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/in-unicast-pkts

Indicates the number of incoming unicast packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/in-broadcast-pkts

Indicates the number of incoming broadcast packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/in-multicast-pkts

Indicates the number of incoming multicast packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/in-discards

Indicates the number of discarded incoming packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/in-errors

Indicates the number of incoming error packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/out-octets

Indicates the number of outgoing packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/out-unicast-pkts

Indicates the number of outgoing unicast packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/out-broadcast-pkts

Indicates the number of outgoing broadcast packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/out-multicast-pkts

Indicates the number of outgoing multicast packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/out-discards

Indicates the number of discarded outgoing packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces-state/interface/statistics/out-errors

Indicates the number of outgoing error packets on an interface.

The value is an integer.

N/A

/ietf-interfaces:interfaces/interface/name

Creates an interface or displays the interface view.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

N/A

/ietf-interfaces:interfaces-state/interface/huawei-interface:common/description

Indicates the interface description.

The value is a string of 1 to 242 case-sensitive characters.

N/A

/ietf-interfaces:interfaces/interface/type

Indicates the interface type.

The value is of the enumerated type:
  • ethernetCsmacd: physical interface, Eth-Trunk interface
  • propVirtual: VLANIF or VBDIF interface
  • softwareLoopback: loopback interface
  • tunnel: tunnel interface
  • other: NULL0, NVE, Mtunnel, or Virtual-Template interface

The value of this parameter must contain iana-if-type.

/ietf-interfaces:interfaces/interface/enabled

Indicates that the interface is enabled.

The value is of the Boolean type:
  • true: The interface is enabled.

  • false: The interface is disabled.

You cannot configure an Eth-Trunk interface that is bound to a cascade port.

/ietf-interfaces:interfaces/interface/link-up-down-trap-enable

Indicates whether the SNMP trap function is enabled.

The value is of the Boolean type:
  • enabled: The function of sending a trap when the interface protocol status changes is enabled.

  • disabled: The function of sending a trap when the interface protocol status changes is disabled.

N/A

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

Indicates the inbound bandwidth usage.

The value is an integer that ranges from 0 to 100.

Only statistics on the bandwidth usage of a physical interface can be collected.

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

Indicates the outbound bandwidth usage.

The value is an integer that ranges from 0 to 100.

Only statistics on the bandwidth usage of a physical interface can be collected.

/ietf-interfaces:interfaces-state/interface/hw-eth-trunk:eth-trunk/trunk-name

Indicates the name of the Eth-Trunk to which the interface is added.

The value is a string of 1 to 32 characters.

NA

/huawei-ethernet:virtual-cable-test/input/ifname

Configures virtual cable test (VCT) on the interface.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

N/A

/huawei-ethernet:port-loopbacktest-internal/input/test-ifname

Configures internal loopback detection on the interface.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

N/A

/huawei-interfaces/interface-status-change/name

Indicates the interface name.

The value is a string of 1 to 64 characters. It consists of the interface type and interface number.

The interface type varies according to the device models.

/huawei-interfaces/interface-status-change/admin-status

Indicates the administrative status of an interface.

The value is of the enumerated type:
  • up
  • down

When the port status changes, the device reports the change to the controller.

/huawei-interfaces/interface-status-change/oper-status

Indicates the interface running status.

The value is of the enumerated type:
  • up
  • down

When the port status changes, the device reports the change to the controller.

Configuring Basic Attributes of an Interface

This section provides a sample of configuring basic attributes of an interface using the rpc method.

Table 2-131  Configuring basic attributes of an interface

Operation

XPATH

rpc

  • /ietf-interfaces:interfaces/interface/name
  • /ietf-interfaces:interfaces/interface/description
  • /ietf-interfaces:interfaces/interface/type
  • /ietf-interfaces:interfaces/interface/enabled
  • /ietf-interfaces:interfaces/interface/link-up-down-trap-enable
Data Requirements

Item

Data

Description

Interface name

XGigabitEthernet0/0/10

-

Interface description

port 001

-

Interface type

ethernetCsmacd

The interface is a physical interface.

Interface status

true

The interface is enabled.

Trap sending function

disabled

Disable the function of sending a trap when the interface protocol status changes.

Request example
<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="1" 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>XGigabitEthernet0/0/10</if:name>
          <if:description>port 001</if:description>
          <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:link-up-down-trap-enable>disabled</if:link-up-down-trap-enable>
        </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="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="2">
  <rpc-error>
    <error-app-tag>-1</error-app-tag>
    <error-message>Wrong interface type.</error-message>
    <error-info>Error on node /ietf-interfaces:interfaces/interface[name="XGigabitEthernet0/0/10"]/type</error-info>
  </rpc-error>
</rpc-reply>

Querying Interface Status Information

This section provides a sample of querying interface status information using the get method.

Table 2-132  Querying interface status information

Operation

XPATH

get

  • /ietf-interfaces:interfaces-state/interface/name
  • /ietf-interfaces:interfaces-state/interface/type
  • /ietf-interfaces:interfaces-state/interface/admin-status
  • /ietf-interfaces:interfaces-state/interface/oper-status
  • /ietf-interfaces:interfaces-state/interface/last-change
  • /ietf-interfaces:interfaces-state/interface/if-index
  • /ietf-interfaces:interfaces-state/interface/phys-address
  • /ietf-interfaces:interfaces-state/interface/speed
  • /ietf-interfaces:interfaces-state/interface/statistics
  • /ietf-interfaces:interfaces-state/interface/ huawei-interfaces:common/description
  • /ietf-interfaces:interfaces-state/interface/ hw-ethernet:physical-state/speed
  • /ietf-interfaces:interfaces-state/interface/ hw-ethernet:physical-state/duplex

Request example

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

Response example

##### Ok Reply or Operation Successful #####
<?xml version='1.0' encoding='UTF-8'?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="6">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>XGigabitEthernet0/0/3</name>
        <type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</type>
        <oper-status>down</oper-status>
        <if-index>201</if-index>
        <phys-address>00:0b:09:47:5c:23<//phys-address>
        <speed>10000000000</speed>
        <statistics>
          <in-octets>0</in-octets>
          <in-unicast-pkts>0</in-unicast-pkts>
          <in-broadcast-pkts>0</in-broadcast-pkts>
          <in-multicast-pkts>0</in-multicast-pkts>
          <in-discards>0</in-discards>
          <in-errors>0</in-errors>
          <out-octets>0</out-octets>
          <out-unicast-pkts>0</out-unicast-pkts>
          <out-broadcast-pkts>0</out-broadcast-pkts>
          <out-multicast-pkts>0</out-multicast-pkts>
          <out-discards>0</out-discards>
          <out-errors>0</out-errors>
          <description xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">
            <in-bandwidth>0</in-bandwidth>
            <out-bandwidth>0</out-bandwidth>
          </ethernet-statistics>
        </statistics>
        <description xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">toN10</description>
        <common xmlns="urn:huawei:params:xml:ns:yang:huawei-interfaces">
           <description>toN10</description>
        </common>
        <ethernet xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">
          <speed>10Gbps</speed>
          <duplex>full</duplex>
        </ethernet>
     <physical-state xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet">
       <speed>10Gbps</speed>
       <duplex>full</duplex>
      </physical-state>
     </interface>
    </interfaces-state>
  </data>
</rpc-reply>

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 2-133  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>

Querying the Name of an Eth-Trunk into Which an Interface Is Added

This section provides a sample of obtaining the name of an Eth-Trunk into which an interface is added using the get method.

Table 2-134  Querying the name of an Eth-Trunk into which an interface is added

Operation

XPATH

get

/ietf-interfaces:interfaces-state/interface/hw-eth-trunk:eth-trunk/trunk-name

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:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">
         <hw-eth-trunk:eth-trunk xmlns:hw-eth-trunk="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
          <hw-eth-trunk:trunk-name/>
         </hw-eth-trunk:eth-trunk>
        </if:interfaces>
       </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>
       <eth-trunk xmlns="urn:huawei:params:xml:ns:yang:huawei-eth-trunk">
         <trunk-name>Eth-Trunk10</trunk-name>
       </eth-trunk>
      </interface>
     </interfaces-state>
   </data>
</rpc-reply>

Enabling Port Isolation

This section describes how to enable port isolation using the rpc method.

Table 2-135  Enabling port isolation

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/huawei-traffic:traffic-security/isolate

Data requirement

Table 2-136  Enabling port isolation

Item

Data

Description

Port isolation status

true

Indicates that port isolation is enabled.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="4" 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>XGigabitEthernet0/0/4</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <hw-traffic:traffic-security xmlns:hw-traffic="urn:huawei:params:xml:ns:yang:huawei-traffic">
          <hw-traffic:isolate>true</hw-traffic:isolate>
            </hw-traffic:traffic-security>
          </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="4">
  <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="4">
  <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>

Enabling IPSG on Interface

This section describes how to enable IPSG using the rpc method.

Table 2-137  Enabling IPSG on interface

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/huawei-traffic-security:security/binding-config/binding-check-enable

Data requirement

Table 2-138  Enabling IPSG on interface

Item

Data

Description

IPSG enablement status

arp-check

Indicates that IPSG is enabled on the interface.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="31" 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/2</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <hw-traffic-security:security xmlns:hw-traffic-security="urn:huawei:params:xml:ns:yang:huawei-traffic-security">
            <hw-traffic-security:binding-config>
              <hw-traffic-security:binding-check-enable>arp-check</hw-traffic-security:binding-check-enable>
            </hw-traffic-security:binding-config>
          </hw-traffic-security:security>
        </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="31">
  <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="32">
  <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>

Configuring Interface Speed

This section describes how to configure interface speed using the rpc method.

Table 2-139  Configuring interface speed

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/hw-ethernet:physical-config/speed

Data requirement

Table 2-140  Configuring interface speed

Item

Data

Description

Port speed

100Mbps

Indicates that the interface speed is 100 Mbit/s.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="15" 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/2</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <hw-ethernet:physical-config xmlns:hw-ethernet="urn:huawei:params:xml:ns:yang:huawei-ethernet">
            <hw-if:speed>100Mbps</hw-if:speed>
          </hw-ethernet:physical-config>
        </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="15">
  <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="16">
  <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>

Configuring the Duplex Mode

This section describes how to configure the duplex mode using the rpc method.

Table 2-141  Configuring the duplex mode

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/hw-ethernet:physical-config/duplex

Data requirement

Table 2-142  Configuring the duplex mode

Item

Data

Description

Duplex mode

full

Indicates that the interface works in full duplex mode.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="15" 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/2</if:name>
          <if:type xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type">iana-if-type:ethernetCsmacd</if:type>
          <hw-ethernet:physical-config xmlns:hw-ethernet="urn:huawei:params:xml:ns:yang:huawei-ethernet">
            <hw-ethernet:duplex>full</hw-ethernet:duplex>
          </hw-ethernet:physical-config>
        </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="15">
  <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="15">
  <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>

Querying the Interface Description

This section provides a sample of obtaining the interface description using the get method.

Table 2-143  Querying the interface description

Operation

XPATH

get

/ietf-interfaces:interfaces-state/interface/huawei-interfaces:common/description

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="2" 
    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/3</if:name>
         <huawei-interfaces:common xmlns:huawei-interfaces="urn:huawei:params:xml:ns:yang:huawei-interfaces">
          <huawei-interfaces:description/>
       </huawei-interfaces:common>
     </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="2">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>XGigabitEthernet0/0/3</name>
        <common xmlns="urn:huawei:params:xml:ns:yang:huawei-interfaces">
         <description>toN10</description>
        </common>
      </interface>
    </interfaces-state>
  </data>
</rpc-reply>

Configuring VCT on an Interface

This section describes how to configure virtual cable test (VCT) on an interface using the rpc method.

Table 2-144  Configuring VCT on an interface

Operation

XPATH

rpc

/huawei-ethernet:virtual-cable-test/input/ifname

Data requirement

Item

Data

Description

Interface

GigabitEthernet0/0/1

VCT is configured on the interface.
Request example
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2ac0550f-49dc-11e7-b586-f0bc1781395f">
  <hw-ethernet:virtual-cable-test xmlns:hw-ethernet="urn:huawei:params:xml:ns:yang:huawei-ethernet">
    <hw-ethernet:ifname>GigabitEthernet0/0/1</hw-ethernet:ifname>
  </hw-ethernet:virtual-cable-test>
</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="2ac0550f-49dc-11e7-b586-f0bc1781395f">
  <result>
    <virtualcabletest-state-result>
      <virtualcabletest-pairastatus>normal</virtualcabletest-pairastatus>
      <virtualcabletest-pairbstatus>normal</virtualcabletest-pairbstatus>
      <virtualcabletest-paircstatus>normal</virtualcabletest-paircstatus>
      <virtualcabletest-pairdstatus>normal</virtualcabletest-pairdstatus>
      <virtualcabletest-pairalength>0</virtualcabletest-pairalength>
      <virtualcabletest-pairblength>0</virtualcabletest-pairblength>
      <virtualcabletest-pairclength>0</virtualcabletest-pairclength>
      <virtualcabletest-pairdlength>0</virtualcabletest-pairdlength>
    </virtualcabletest-state-result>
  </result>
</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="cfc47140-49dc-11e7-8c66-f0bc1781395f">
  <rpc-error>
    <error-message>valid user-defined rpc fail.</error-message>
  </rpc-error>
</rpc-reply>

Configuring Internal Loopback Detection on an Interface

This section describes how to configure internal loopback detection on an interface using the rpc method.

Table 2-145  Configuring internal loopback detection on an interface

Operation

XPATH

rpc

/huawei-ethernet:port-loopbacktest-internal/input/test-ifname

Data requirement

Item

Data

Description

Interface

GigabitEthernet0/0/1

Internal loopback detection is configured on the interface.
Request example
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="b05d8080-49dc-11e7-85f6-f0bc1781395f">
  <hw-ethernet:port-loopbacktest-internal xmlns:hw-ethernet="urn:huawei:params:xml:ns:yang:huawei-ethernet">
    <hw-ethernet:test-ifname>GigabitEthernet0/0/1</hw-ethernet:test-ifname>
  </hw-ethernet:port-loopbacktest-internal>
</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="b05d8080-49dc-11e7-85f6-f0bc1781395f">
  <data>
    <test_result>0</test_result>
  </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="cfc47140-49dc-11e7-8c66-f0bc1781395f">
  <rpc-error>
    <error-message>valid user-defined rpc fail.</error-message>
  </rpc-error>
</rpc-reply>

Reporting a Port Status Change Alarm

This section describes how a device reports an alarm when the port status changes.

Table 2-146  Reporting a Port Status Change Alarm

Operation

XPATH

notification

/huawei-interfaces/interface-status-change

Alarm example
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
   <eventTime>2018-03-30T16:34:59Z</eventTime>
      <interface-status-change xmlns="urn:huawei:params:xml:ns:yang:huawei-interfaces">
        <name>Vlanif100</name>
           <admin-status>down</admin-status>
           <oper-status>down</oper-status>
     </interface-status-change>
</notification>
Translation
Download
Updated: 2018-09-01

Document ID: EDOC1100037962

Views: 6401

Downloads: 8

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