< Home

Querying Information About CDP Neighbors

This section provides a sample of querying information about CDP neighbors using the get method.

Table 1 Querying information about CDP neighbors
Operation XPATH
get /ietf-interfaces:interfaces-state/interface/huawei-lldp:cdp

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/>
          <huawei-lldp:cdp xmlns:huawei-lldp="urn:huawei:params:xml:ns:yang:huawei-lldp"/>
        </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="6">
  <data>
    <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
      <interface>
        <name>GigabitEthernet0/0/1</name>
        <cdp xmlns="urn:huawei:params:xml:ns:yang:huawei-lldp">
          <remote-port>
            <index>1</index>
            <device-id>hw20180927</device-id>
            <port-id>GigabitEthernet0/0/10</port-id>
            <system-platform>huawei</system-platform>
            <system-mac-address>00:22:11:2d:e3:00</system-mac-address>
            <system-capabilities>router switch igmp</system-capabilities>
          </remote-port>
        </cdp>
      </interface>
    </interfaces-state>
  </data>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic