Queries routes in a route table.

Usage notes

Before you call the DeleteRouteEntry operation to delete a route, you can call this operation to query the next hop of the route that you want to delete.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
RegionIdStringYescn-hangzhou

The region ID of the route table.

You can call the DescribeRegions operation to query the most recent region list.

RouteTableIdStringYesvtb-bp1r9pvl4xen8s9ju****

The ID of the route table.

RouteEntryIdStringNorte-bp1mnnr2al0naomnp****

The ID of the route that you want to query.

DestinationCidrBlockStringNo192.168.2.0/24

The destination CIDR block of the route. IPv4 and IPv6 CIDR blocks are supported.

RouteEntryNameStringNoabc

The name of the route.

The name must be 1 to 128 characters in length, and cannot start with http:// or https://.

IpVersionStringNoipv4

The IP version. Valid values:

  • ipv4
  • ipv6
RouteEntryTypeStringNoSystem

The type of the route. Valid values:

  • Custom: a custom route
  • System: a system route
  • BGP: a BGP route
  • CEN: a Cloud Enterprise Network (CEN) route
NextHopIdStringNovpn-bp10zyaph5cc8b7c7****

The ID of the next hop.

NextHopTypeStringNoInstance

The type of the next hop. Valid values:

  • Instance (default): an Elastic Compute Service (ECS) instance
  • HaVip: a high-availability virtual IP address (HAVIP)
  • VpnGateway: a VPN gateway
  • NatGateway: a NAT gateway
  • NetworkInterface: a secondary elastic network interface (ENI)
  • RouterInterface: a router interface
  • IPv6Gateway: an IPv6 gateway
  • Attachment: a transit router
MaxResultIntegerNo.10

The number of entries to return on each page. Valid values: 1 to 100. Default value: 10.

NextTokenStringNoFFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If this is your first query and no next queries are to be sent, ignore this parameter.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
ActionStringYesDescribeRouteEntryList

The operation that you want to perform. Set the value to DescribeRouteEntryList.

ServiceTypeStringNoTR

Specifies whether to host the route. If the parameter is empty, the route is not hosted.

If you set the value to TR, the route is hosted by a transit router.

DestCidrBlockList.NStringNo192.168.0.0/24

The destination CIDR blocks of the route. You can specify at most 20 destination CIDR blocks.

Response parameters

ParameterTypeExampleDescription
NextTokenStringFFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If NextToken is empty, it indicates that no next query is to be sent.
  • If a value of NextToken is returned, the value is the token that is used for the subsequent query.
RequestIdString14A07460-EBE7-47CA-9757-12CC4761D47A

The ID of the request.

RouteEntrysArray of RouteEntry

The information about the routes.

RouteEntry
StatusStringAvailable

The status of the route. Valid values:

  • Pending: The route is being configured.
  • Available: The route is available.
  • Modifying: The route is being modified.
TypeStringCustom

The type of the route. Valid values:

  • Custom: a custom route
  • System: a system route
  • BGP: a BGP route
  • CEN: a CEN route
IpVersionStringipv4

The IP version. Valid values:

  • ipv4
  • ipv6
DescriptionStringRouteEntryDescription

The description of the route.

RouteEntryNameStringaaa

The name of the route.

DestinationCidrBlockString192.168.2.0/24

The destination CIDR blocks of the route.

RouteEntryIdStringrte-bp1mnnr2al0naomnp****

The ID of the route.

RouteTableIdStringvtb-bp15w5q90d2rk3bww****

The ID of the route table.

GmtModifiedString2022-05-09T03:00:07Z

The time when the route was modified. The time is displayed in YYYY-MM-DDThh:mm:ssZ format in UTC.

NextHopsArray of NextHop

The information about the next hops.

NextHop
NextHopRegionIdStringcn-hangzhou

The region ID of the next hop.

Note This parameter is returned if the next hop type is set to RouterInterface.
WeightInteger100

The weight of the route.

Note This parameter is returned if the next hop type is set to RouterInterface.
NextHopIdStringvpn-bp10zyaph5cc8b7c7****

The ID of the next hop.

EnabledInteger1

Indicates whether the route is available. Valid values:

  • 0: unavailable
  • 1: available
Note This parameter is returned if the next hop type is set to RouterInterface.
NextHopTypeStringInstance

The type of the next hop. Valid values:

  • Instance: an ECS instance
  • HaVip: an HAVIP
  • VpnGateway: a VPN gateway
  • NatGateway: a NAT gateway
  • NetworkInterface: a secondary ENI
  • RouterInterface: a router interface
  • IPv6Gateway: an IPv6 gateway
  • Attachment: a transit router
NextHopRelatedInfoObject

The information about the next hop.

InstanceIdStringvpc-bp1t36rn9l53iwbsf****

The ID of the instance associated with the next hop.

InstanceTypeStringVPC

The type of the instance associated with the next hop. Valid values:

  • VPC: a virtual private cloud (VPC)
  • VBR: a VBR
  • PCONN: an Express Connect circuit
RegionIdStringch-hangzhou

The region ID of the instance associated with the next hop.

ServiceTypeStringTR

Indicates whether the route is hosted. If the parameter is empty, the route is not hosted.

If the value is set to TR, the route is hosted by a transit router.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-hangzhou
&RouteTableId=vtb-bp1r9pvl4xen8s9ju****
&RouteEntryId=rte-bp1mnnr2al0naomnp****
&DestinationCidrBlock=192.168.2.0/24
&RouteEntryName=abc
&IpVersion=ipv4
&RouteEntryType=System
&NextHopId=vpn-bp10zyaph5cc8b7c7****
&NextHopType=Instance
&MaxResult=10
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&Action=DescribeRouteEntryList
&ServiceType=TR
&DestCidrBlockList=["192.168.0.0/24"]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeRouteEntryListResponse>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
    <RequestId>14A07460-EBE7-47CA-9757-12CC4761D47A</RequestId>
    <RouteEntrys>
        <Status>Available</Status>
        <Type>Custom</Type>
        <IpVersion>ipv4</IpVersion>
        <Description>RouteEntryDescription</Description>
        <RouteEntryName>aaa</RouteEntryName>
        <DestinationCidrBlock>192.168.2.0/24</DestinationCidrBlock>
        <RouteEntryId>rte-bp1mnnr2al0naomnp****</RouteEntryId>
        <RouteTableId>vtb-bp15w5q90d2rk3bww****</RouteTableId>
        <GmtModified>2022-05-09T03:00:07Z</GmtModified>
        <NextHops>
            <NextHopRegionId>cn-hangzhou</NextHopRegionId>
            <Weight>100</Weight>
            <NextHopId>vpn-bp10zyaph5cc8b7c7****</NextHopId>
            <Enabled>1</Enabled>
            <NextHopType>Instance</NextHopType>
            <NextHopRelatedInfo>
                <InstanceId>vpc-bp1t36rn9l53iwbsf****</InstanceId>
                <InstanceType>VPC</InstanceType>
                <RegionId>ch-hangzhou</RegionId>
            </NextHopRelatedInfo>
        </NextHops>
        <ServiceType>TR</ServiceType>
    </RouteEntrys>
</DescribeRouteEntryListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId" : "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "RouteEntrys" : [ {
    "Status" : "Available",
    "Type" : "Custom",
    "IpVersion" : "ipv4",
    "Description" : "RouteEntryDescription",
    "RouteEntryName" : "aaa",
    "DestinationCidrBlock" : "192.168.2.0/24",
    "RouteEntryId" : "rte-bp1mnnr2al0naomnp****",
    "RouteTableId" : "vtb-bp15w5q90d2rk3bww****",
    "GmtModified" : "2022-05-09T03:00:07Z",
    "NextHops" : [ {
      "NextHopRegionId" : "cn-hangzhou",
      "Weight" : 100,
      "NextHopId" : "vpn-bp10zyaph5cc8b7c7****",
      "Enabled" : 1,
      "NextHopType" : "Instance",
      "NextHopRelatedInfo" : {
        "InstanceId" : "vpc-bp1t36rn9l53iwbsf****",
        "InstanceType" : "VPC",
        "RegionId" : "ch-hangzhou"
      }
    } ],
    "ServiceType" : "TR"
  } ]
}

Error codes

HttpCodeError codeError messageDescription
400OperationFailed.QueryCenEntryOperation is denied because getting CEN route entry has failed.The error message returned because the system failed to query the CEN routes.
400OperationDenied.UseGatewayRouteEntryQueryInterfaceUse listGatewayRouteTableEntries to describe gateway route entries.To query the routes of a gateway route table, call the listGatewayRouteTableEntries operation.

For a list of error codes, visit the API Error Center.