This section provides a sample of querying routing entries using the rpc method.
Operation |
XPATH |
---|---|
rpc |
|
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 |
- |
<?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>
# 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>