< Home

Querying Routing Entries

This section provides a sample of querying routing entries using the rpc method.

Table 1 Querying routing entries

Operation

XPATH

rpc

  • /huawei-route-management:route-entry-get/get-num
  • /huawei-route-management:route-entry-get/destination-address

Data Requirements

Item

Data

Description

Maximum number of routing entries that can be queried at a time

10

-

IP address

10.1.1.0

-

Mask of an IP address

24

-

Query type

ip

-

Request Example

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <hw-route-management:route-entry-get xmlns:hw-route-management="urn:huawei:yang:huawei-route-management">
    <hw-route-management:get-num>10</hw-route-management:get-num>
    <hw-route-management:destination-address>
      <hw-route-management:ip-address>10.1.1.1</hw-route-management:ip-address>
      <hw-route-management:ip-mask>24</hw-route-management:ip-mask>
      <hw-route-management:search-type>ip</hw-route-management:search-type>
    </hw-route-management:destination-address>
  </hw-route-management:route-entry-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="1">
  <route-entry-get xmlns="urn:huawei:params:xml:ns:yang:huawei-route-management">
    <route-entry-details>
      <ip-address>10.1.1.0</ip-address>
      <ip-mask>24</ip-mask>
      <vpn-instance/>
      <protocol>Direct</protocol>
      <cost>0</cost>
      <nexthop>1.1.1.1</nexthop>
      <interface>Tunnel1</interface>
      <preference>0</preference>
      <flags>D</flags>
    </route-entry-details>
    <summary>1</summary>
    <has-more>false</has-more>
  </route-entry-get>
</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">
  <route-entry-get xmlns="urn:huawei:params:xml:ns:yang:huawei-route-management">
    <has-more>false</has-more>
  </route-entry-get>
</rpc-reply>
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >