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

Port Management

Data Model

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

Table 2-112  Port management

Object

Description

Value Range

Remarks

/ietf-interfaces:interfaces/interface/huawei-traffic-security: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; }

N/A

/ietf-interfaces:interfaces/interface/huawei-interface:ethernet/media

Indicates the interface type.

Enumerated value:
  • fiber: optical interface mode

  • copper: electrical interface mode

N/A

/ietf-interfaces:interfaces/interface/huawei-interface:ethernet/speed

Indicates the auto-negotiation mode.

Enumerated value:
  • 10 Mbit/s

  • 100 Mbit/s

  • 1 Gbit/s

  • 2.5 Gbit/s

N/A

/ietf-interfaces:interfaces/interface/huawei-interface:ethernet/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-interface: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

N/A

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

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 value is in the format of H-H-H. Each H is a hexadecimal number of 1 to 4 digits.

N/A

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

Indicates the interface rate.

The value is of the enumerated type:
  • 10 Mbps

  • 100 Mbps

  • 1 Gbps

  • 2.5 Gbps

N/A

/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/interface/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

N/A

/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:
  • true: The function of sending a trap when the interface protocol status changes is enabled.

  • false: 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.

/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

Configuring Basic Attributes of an Interface

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

Table 2-113  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>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-114  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

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/10</if:name>
        </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/10</name>
        <type>ethernetCsmacd</type>
        <admin-status>down</admin-status>
        <oper-status>down</oper-status>
        <if-index>41</if-index>
        <last-change>2017-09-08T15:57:05+08:00</last-change>
        <phys-address>00:0b:09:2c:28:0a</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>
          <ethernet-statistics xmlns="urn:huawei:params:xml:ns:yang:huawei-ethernet">
            <in-bandwidth>0</in-bandwidth>
            <out-bandwidth>0</out-bandwidth>
          </ethernet-statistics>
        </statistics>
        <description xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">port 001</description>
        <ethernet xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">
          <speed>10Gbps</speed>
          <duplex>full</duplex>
        </ethernet>
      </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-115  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>

Enabling Port Isolation

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

Table 2-116  Enabling port isolation

Operation

XPATH

rpc

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

Data requirement

Table 2-117  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="7" 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>ethernetCsmacd</if:type>
          <if:enabled>true</if:enabled>
          <hw-traffic-security:security xmlns:hw-traffic-security="urn:huawei:params:xml:ns:yang:huawei-traffic-security">
            <hw-traffic-security:isolate>true</hw-traffic-security:isolate>
          </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="7">
  <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="8">
  <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-118  Enabling IPSG on interface

Operation

XPATH

rpc

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

Data requirement

Table 2-119  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="urn:ietf:params:xml:ns:yang:iana-if-type">iana: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-120  Configuring interface speed

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/huawei-interface:ethernet/speed

Data requirement

Table 2-121  Configuring interface speed

Item

Data

Description

Port speed

100

Indicates that the interface speed is 100 Mbit/s.

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="27" 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="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</if:type>
          <hw-if:ethernet xmlns:hw-if="urn:huawei:params:xml:ns:yang:huawei-interface">
            <hw-if:media>copper</hw-if:media>
            <hw-if:speed>100Mbps</hw-if:speed>
          </hw-if:ethernet>
        </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="27">
  <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="28">
  <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-122  Configuring the duplex mode

Operation

XPATH

rpc

/ietf-interfaces:interfaces/interface/huawei-interface:ethernet/duplex

Data requirement

Table 2-123  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="25" 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="urn:ietf:params:xml:ns:yang:iana-if-type">iana:ethernetCsmacd</if:type>
          <hw-if:ethernet xmlns:hw-if="urn:huawei:params:xml:ns:yang:huawei-interface">
            <hw-if:media>copper</hw-if:media>
            <hw-if:duplex>full</hw-if:duplex>
          </hw-if:ethernet>
        </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="25">
  <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="26">
  <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-124  Querying the interface description

Operation

XPATH

get

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

Request example

<?xml version='1.0' encoding='UTF-8'?>
<rpc message-id="16" 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: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="16">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>XGigabitEthernet0/0/1</name>
        <admin-status>up</admin-status>
        <oper-status>down</oper-status>
        <description xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">xge001</description>
        <ethernet xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">
          <speed>10Gbps</speed>
          <duplex>full</duplex>
        </ethernet>
      </interface>
      <interface>
        <name>Eth-Trunk1</name>
        <admin-status>up</admin-status>
        <oper-status>down</oper-status>
        <description xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">trunk1</description>
      </interface>
      <interface>
        <name>Vlanif1158</name>
        <admin-status>up</admin-status>
        <oper-status>up</oper-status>
        <description xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">upstream port</description>
      </interface>
      <interface>
        <name>Vlanif2</name>
        <admin-status>down</admin-status>
        <oper-status>down</oper-status>
        <description xmlns="urn:huawei:params:xml:ns:yang:huawei-interface">vlanif2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</description>
      </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-125  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-126  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>
Translation
Download
Updated: 2019-09-23

Document ID: EDOC1000178028

Views: 4966

Downloads: 0

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