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

RESTful API Reference

CloudEngine 8800, 7800, 6800, and 5800 V200R002C50

This document describes the OPS APIs supported by the device, including OPS-supported operations, request examples, elements in the requests, response examples, elements in the responses, and response status codes.
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).
Routes

Routes

Create a Static Route

Operation

URI

Description

POST

/staticrt/staticrtbase/srRoutes

Create a static route.

  • Request example
    <?xml version="1.0" encoding="UTF-8"?>
           <srRoutes> 
              <srRoute> 
                 <vrfName>_public_</vrfName> 
                 <afType>ipv4unicast</afType> 
                 <topologyName>base</topologyName> 
                 <prefix>10.111.111.77</prefix> 
                 <maskLength>24</maskLength> 
                 <ifName>Ether3/0/0</ifName> 
                 <destVrfName>_public_</destVrfName> 
                 <nexthop>0.0.0.0</nexthop> 
                 <description></description> 
                 <preference></preference> 
                 <tag></tag> 
                 <bfdEnable>false</bfdEnable> 
                 <sessionName></sessionName> 
                 <trackNqaAdminName></trackNqaAdminName> 
                 <trackNqaTestName></trackNqaTestName> 
                 <isInheritCost>false</isInheritCost> 
                 <isPermanent>false</isPermanent> 
                 <trackEfmIfName>Invalid0</trackEfmIfName> 
                 <isRelayHostRoute>false</isRelayHostRoute> 
              </srRoute> 
           </srRoutes>

    Table 3-772 describes elements in requests.

Table 3-772  Elements in requests

Element

Description

vrfName

Specifies a VPN instance name.

afType

Specifies an address family type.

topologyName

Specifies a topology name.

prefix

Specifies a destination network address.

maskLength

Specifies a mask length.

ifName

Specifies an outbound interface.

destVrfName

Specifies the VPN instance name of the next hop.

nexthop

Specifies a next hop address.

description

Specifies the description information.

preference

Specifies a priority.

tag

Specifies the tag attribute.

bfdEnable

Enables dynamic BFD.

sessionName

Specifies a static BFD session name.

trackNqaAdminName

Specifies the administrator name of an NQA test instance.

trackNqaTestName

Specifies an NQA test instance name.

isInheritCost

Indicates that the cost of an iterated route is inherited.

isPermanent

Specifies whether a route is active permanently.

trackEfmIfName

Specifies an EFM interface name.

isRelayHostRoute

Specifies whether a route is iterated to a host route.

  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?>  
        <ok/>

    Table 3-773 describes status codes in responses.

Table 3-773  Description of status codes in responses

Status Code

Description

200 OK

The operation succeeds.

400 Bad Request

The request cannot be implemented because the request is incorrect in syntax or the information attribute in the request is incorrect.

500 Internal Server Error

Internal errors in services cause a request failure or an unidentified request.

Delete a Static Route

Operation

URI

Description

DELETE

/staticrt/staticrtbase/srRoutes

Delete a static route.

  • Request example
    <?xml version="1.0" encoding="UTF-8"?>
    <srRoutes>
    <srRoute>
    <vrfName>_public_</vrfName>
    <afType>ipv4unicast</afType>
    <topologyName>base</topologyName>
    <prefix>10.111.111.77</prefix>
    <maskLength>24</maskLength>
    <ifName>Ethernet3/0/1</ifName>
    <destVrfName>_public_</destVrfName>
    <nexthop>1.1.1.1</nexthop>
    </srRoute>
    </srRoutes>	

    Table 3-774 describes elements in requests.

Table 3-774  Elements in requests

Element

Description

vrfName

Specifies a VPN instance name.

afType

Specifies an address family type.

topologyName

Specifies a topology name.

prefix

Specifies a destination network address.

maskLength

Specifies a mask length.

ifName

Specifies an outbound interface.

destVrfName

Specifies the VPN instance name of the next hop.

nexthop

Specifies a next hop address.

  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?>  
        <ok/>

    Table 3-775 describes status codes in responses.

Table 3-775  Description of status codes in responses

Status Code

Description

200 OK

The operation succeeds.

400 Bad Request

The request cannot be implemented because the request is incorrect in syntax or the information attribute in the request is incorrect.

500 Internal Server Error

Internal errors in services cause a request failure or an unidentified request.

Query Basic Route Information

Operation

URI

Description

GET

/rm/rmbase/uniAfs/uniAf

Query basic route information.

  • Request example
    <?xml version="1.0" encoding="UTF-8"?>  
     <uniAf>  
         <vrfName></vrfName>  
         <afType>ipv4unicast</afType>  
         <topologys>  
             <topology>  
                 <topologyName></topologyName>  
                 <routes>  
                     <route>  
                         <prefix></prefix>  
                         <maskLength></maskLength>  
                         <protocolId></protocolId>  
                         <preference></preference>  
                         <cost></cost>  
                         <flags></flags>  
                         <nextHop></nextHop>  
                         <ifName></ifName>  
                         <relayNexthop></relayNexthop>  
                         <processId></processId>  
                         <frrType></frrType>  
                         <directNexthop></directNexthop>  
                     </route>  
                 </routes>  
             </topology>  
         </topologys>  
     </uniAf>

    Table 3-776 describes elements in requests.

Table 3-776  Elements in requests

Element

Description

vrfName

Specifies a VPN instance name.

afType

Specifies an address family type.

topologyName

Specifies a topology name.

prefix

Specifies a destination network address.

maskLength

Specifies a mask length.

protocolId

Specifies a routing protocol.

preference

Specifies a priority.

cost

Specifies a route cost.

flags

Specifies the route flag.

nextHop

Specifies a next hop address.

ifName

Specifies an outbound interface.

relayNexthop

Specifies the address of the route to which a route is iterated.

processId

Specifies the process ID of a routing protocol.

frrType

Specifies the FRR type.

directNexthop

Specifies the address of the directly connected next hop.

  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?>  
     <uniAf>  
         <vrfName>_public_</vrfName>  
         <afType>ipv4unicast</afType>  
         <topologys>  
            <topology>  
                <topologyName>base</topologyName>  
                <routes>  
                    <route>  
                        <maskLength>32</maskLength>  
                        <protocolId>Direct</protocolId>  
                        <processId>0</processId>  
                        <preference>0</preference>  
                        <cost>0</cost>  
                        <ifName>InLoopBack0</ifName>  
                        <flags>D</flags>  
                        <frrType>Primary</frrType>  
                        <prefix>255.255.255.255</prefix>  
                        <relayNexthop>0.0.0.0</relayNexthop>  
                        <nextHop>127.0.0.1</nextHop>  
                        <directNexthop>127.0.0.1</directNexthop>  
                  </route>  
                </routes>  
            </topology>  
         </topologys>  
     </uniAf>

    Table 3-777 describes elements in responses.

Table 3-777  Elements in responses

Element

Description

vrfName

Specifies a VPN instance name.

afType

Specifies an address family type.

topologyName

Specifies a topology name.

prefix

Specifies a destination network address.

maskLength

Specifies a mask length.

protocolId

Specifies a routing protocol.

preference

Specifies a priority.

cost

Specifies a route cost.

flags

Specifies the route flag.

nextHop

Specifies a next hop address.

ifName

Specifies an outbound interface.

relayNexthop

Specifies the address of the route to which a route is iterated.

processId

Specifies the process ID of a routing protocol.

frrType

Specifies the FRR type.

directNexthop

Specifies the address of the directly connected next hop.

Table 3-778 describes status codes in responses.

Table 3-778  Description of status codes in responses

Status Code

Description

200 OK

The operation succeeds.

400 Bad Request

The request cannot be implemented because the request is incorrect in syntax or the information attribute in the request is incorrect.

500 Internal Server Error

Internal errors in services cause a request failure or an unidentified request.

Create a Route Policy

Operation

URI

Description

edit-config:create

/rtp/routePolicys

Create a route policy.

  • Request example
<?xml version="1.0" encoding="UTF-8"?>    
<routePolicy> 
 <name>aa</name> 
 <routePolicyNodes> 
      <routePolicyNode operation="create"> 
          <nodeSequence>10</nodeSequence> 
          <matchMode>permit</matchMode> 
          <description>aa</description> 
       </routePolicyNode> 
    </routePolicyNodes> 
</routePolicy>
  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?> 
    <routePolicy> 
     <name>aa</name> 
     <routePolicyNodes> 
          <routePolicyNode> 
              <nodeSequence></nodeSequence> 
              <matchMode></matchMode> 
              <description></description> 
           </routePolicyNode> 
     </routePolicyNodes> 
    </routePolicy>

Table 3-779 describes elements in responses.

Table 3-779  Elements in responses

Element

Description

Value Range

Mandatory/Optional

name

Specifies a policy name.

The value is a string of 1 to 40 characters.

Mandatory

nodeSequence

Specifies a node ID.

The value is an integer ranging from 1 to 4294967295. By default, the number is increased by 10 based on the configuration sequence. The initial number is 10.

Note:

A maximum of 65535 indexes can be configured for each IP prefix list.

Mandatory

matchMode

This parameter indicates the matching mode.

Specifies a matching mode.

permit: indicates that an IP prefix list is in permit mode. In permit mode, if an IP address is within the defined range, the address matches the policy. If the IP address is beyond the defined range, the IP address will be matched against the next node.

Optional

description

Specifies the description of a route policy.

The value is a string of 0 to 80 characters.

Optional

Create an IP-prefix

Operation

URI

Description

edit-config:create

/rtp/prefixFilters/prefixFilter

Create an ip-prefix.

  • Request example
<?xml version="1.0" encoding="UTF-8"?>   
<prefixFilter operation="create">   
    <name>prefix</name>   
    <prefixFilterNodes>   
        <prefixfilternode operation="merge">   
            <nodesequence>10</nodesequence>   
            <matchmode>permit</matchmode>   
            <address>192.168.1.10</address>   
            <masklength>0</masklength>     
        </prefixfilternode>   
    </prefixFilterNodes>   
</prefixFilter>
  • Response example (XML format)
    <?xml version="1.0" encoding="UTF-8"?> 
     <prefixFilter>
          <name>prefix</name>
          <prefixFilterNodes>
           <prefixFilterNode>
              <nodeSequence>10</nodeSequence>
              <matchMode>permit</matchMode>
              <address>192.168.1.10</address>
              <maskLength>0</maskLength>
            </prefixFilterNode>
          </prefixFilterNodes>
      </prefixFilter>
    

Table 3-780 describes elements in responses.

Table 3-780  Elements in responses

Element

Description

Value Range

Mandatory/Optional

name

Specifies the name of an IP prefix.

The name is a string of 1 to 169 case-sensitive characters, with spaces and question marks (?) not supported.

The value must be unique.

Mandatory

nodeSequence

Specifies a node ID.

The value is an integer ranging from 1 to 4294967295. By default, the number is increased by 10 based on the configuration sequence. The initial number is 10.

Note:

A maximum of 65535 indexes can be configured for each IP prefix list.

Mandatory

matchMode

This parameter indicates the matching mode.

Specifies a matching mode.

permit: indicates that an IP prefix list is in permit mode. In permit mode, if an IP address is within the defined range, the address matches the policy. If the IP address is beyond the defined range, the IP address will be matched against the next node.

Optional

address

Specifies the IP address.

The value is in dotted decimal notation.

Optional

maskLength

Specifies the mask length.

The value is an integer ranging from 0 to 32.

Optional

matchNetwork

Specifies to match the network address.

Value:

  • true: Specifies to match the network address.
  • false: Specifies not to match the network address.

Optional

greaterEqual

The minimum value of the mask length.

The value of greater-equal-value is subject to the following rule: mask-length <= greater-equal-value <= less-equal-value <= 32

Optional

lessEqual

The maximum value of the mask length.

The value of less-equal-value is subject to the following rule: mask-length <= greater-equal-value <= less-equal-value <= 32

Optional

Translation
Download
Updated: 2019-03-21

Document ID: EDOC1000166567

Views: 21614

Downloads: 116

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