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

Parameter Type Required Example Description
RegionId String Yes cn-hangzhou

The region ID of the route table.

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

RouteTableId String Yes vtb-bp1r9pvl4xen8s9ju****

The ID of the route table.

RouteEntryId String No rte-bp1mnnr2al0naomnp****

The ID of the route that you want to query.

DestinationCidrBlock String No 192.168.2.0/24

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

RouteEntryName String No abc

The route name.

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

IpVersion String No ipv4

The IP version. Valid values:

  • ipv4
  • ipv6
RouteEntryType String No System

The route type. Valid values:

  • Custom
  • System
  • BGP
  • CEN
NextHopId String No vpn-bp10zyaph5cc8b7c7****

The ID of the next hop.

NextHopType String No Instance

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
MaxResult Integer No 10

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

NextToken String No FFmyTO70tTpLG6I3FmYAXGKPd****

The pagination token that is used in the next request to retrieve a new page of results. Valid values:

  • You do not need to specify this parameter for the first request.
  • If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.
Action String Yes DescribeRouteEntryList

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

ServiceType String No TR

Specifies whether the route is hosted. If you leave the parameter empty, the route is not hosted.

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

DestCidrBlockList.N String No 192.168.0.0/24

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

Response parameters

Parameter Type Example Description
NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. Valid values:

  • If NextToken is empty, no next page exists.
  • If NextToken is not empty, the value of NextToken can be used in the next request to retrieve a new page of results.
RequestId String 14A07460-EBE7-47CA-9757-12CC4761D47A

The request ID.

RouteEntrys Array of RouteEntry

The information about the route.

RouteEntry
Status String Available

The status of the route. Valid values:

  • Pending
  • Available
  • Modifying
Type String System

The route type. Valid values:

  • Custom
  • System
  • BGP
  • CEN
IpVersion String ipv4

The IP version. Valid values:

  • ipv4
  • ipv6
Description String RouteEntryDescription

The description of the route.

RouteEntryName String aaa

The route name.

DestinationCidrBlock String 192.168.2.0/24

The destination CIDR block of the route.

RouteEntryId String rte-bp1mnnr2al0naomnp****

The ID of the route.

RouteTableId String vtb-bp15w5q90d2rk3bww****

The ID of the route table.

GmtModified String 2022-05-09T03:00:07Z

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

NextHops Array of NextHop

The information about the next hop.

NextHop
NextHopRegionId String cn-hangzhou

The region ID of the next hop.

Note This parameter is returned if the next hop type is set to RouterInterface.
Weight Integer 100

The weight of the route.

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

The ID of the next hop.

Enabled Integer 1

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.
NextHopType String Instance

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
NextHopRelatedInfo Object

The information about the next hop.

InstanceId String vpc-bp1t36rn9l53iwbsf****

The ID of the instance associated with the next hop.

InstanceType String VPC

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

  • VPC: a VPC
  • VBR: a VBR
  • PCONN: an Express Connect circuit
RegionId String ch-hangzhou

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

ServiceType String TR

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

If TR is returned, 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

HttpCode Error code Error message Description
400 OperationFailed.QueryCenEntry Operation is denied because getting CEN route entry has failed. The system failed to query the CEN routes.
400 OperationDenied.UseGatewayRouteEntryQueryInterface Use 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, see Service error codes.