Queries route entries of a gateway route table.

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
Action String Yes ListGatewayRouteTableEntries

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

RegionId String Yes ap-southeast-6

The region ID of the gateway route table.

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

MaxResults 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 token that determines the start point of the 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.
GatewayRouteTableId String Yes vtb-5ts0ohchwkp3dydt2****

The ID of the gateway route table that you want to query.

DestinationCidrBlock String No 192.168.0.5

The destination CIDR block of the route in the gateway route table.

Response parameters

Parameter Type Example Description
NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

The token that determines the start point of the query. Valid values:

  • If no value is returned for NextToken, no next queries are sent.
  • If a value of NextToken is returned, the value is the token that is used for the subsequent query.
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The request ID.

TotalCount String 1

The total number of entries returned.

GatewayRouteEntryModels Array of GatewayRouteEntryModels

The details of the routes in the gateway route table.

Status String Available

The status of the route. Valid values:

  • Pending
  • Available
  • Modifying
NextHopId String i-bp11gcl0sm85t9bi****

The ID of the next hop.

Description String test

The name of the route.

NextHopType String EcsInstance

The type of the next hop. Valid values:

  • EcsInstance: an Elastic Compute Service (ECS) instance
  • NetworkInterface: an elastic network interface (ENI)
  • Local: a local next hop
DestinationCidrBlock String 192.168.0.5

The destination CIDR block of the route.

Name String name

The name of the route.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter.

NextHops Array of NextHop

The information about the next hop.

NextHopId String vpn-bp10zyaph5cc8b7c7****

The ID of the next hop.

NextHopType String Instance

The type of the next hop. Valid values:

  • Instance (default): an ECS instance
  • HaVip: a high-availability virtual IP address (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
Weight String 100

The weight of the route.

Enabled String 1

Indicates whether the route is available. Valid values:

  • 0: unavailable
  • 1: available

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListGatewayRouteTableEntries
&RegionId=ap-southeast-6
&MaxResults=10
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&GatewayRouteTableId=vtb-5ts0ohchwkp3dydt2****
&DestinationCidrBlock=192.168.0.5
&Common request parameters

Sample success responses

XML format

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

<ListGatewayRouteTableEntriesResponse>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
    <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
    <TotalCount>1</TotalCount>
    <GatewayRouteEntryModels>
        <Status>Available</Status>
        <NextHopId>i-bp11gcl0sm85t9bi****</NextHopId>
        <Description>test</Description>
        <NextHopType>EcsInstance</NextHopType>
        <DestinationCidrBlock>192.168.0.5</DestinationCidrBlock>
        <Name>name</Name>
    </GatewayRouteEntryModels>
</ListGatewayRouteTableEntriesResponse>

JSON format

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

{
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId" : "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
  "TotalCount" : "1",
  "GatewayRouteEntryModels" : [ {
    "Status" : "Available",
    "NextHopId" : "i-bp11gcl0sm85t9bi****",
    "Description" : "test",
    "NextHopType" : "EcsInstance",
    "DestinationCidrBlock" : "192.168.0.5",
    "Name" : "name"
  } ]
}

Error codes

HttpCode Error code Error message Description
400 ResourceNotFound.GatewayRouteTable The specified resource GatewayRouteTable is not found. The error message returned because the specified gateway route table cannot be found.

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