All Products
Search
Document Center

Virtual Private Cloud:ListGatewayRouteTableEntries

Last Updated:Mar 10, 2025

Queries route entries of a gateway route table.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the gateway route table.

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

ap-southeast-6
MaxResultsintegerNo

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

10
NextTokenstringNo

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 value is returned for NextToken, specify the value in the next request to retrieve a new page of results.
FFmyTO70tTpLG6I3FmYAXGKPd****
GatewayRouteTableIdstringYes

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

vtb-5ts0ohchwkp3dydt2****
DestinationCidrBlockstringNo

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

192.168.0.5

Response parameters

ParameterTypeDescriptionExample
object

The route entries in the gateway route table.

NextTokenstring

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 a value is returned for NextToken, the value is used to retrieve a new page of results.
FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The request ID.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0
TotalCountstring

The total number of entries returned.

1
GatewayRouteEntryModelsarray<object>

The details of the routes in the gateway route table.

GatewayRouteEntryModelsobject
Statusstring

The status of the route entry. Valid values:

  • Pending
  • Available
  • Modifying
Available
NextHopIdstring

The ID of the next hop.

i-bp11gcl0sm85t9bi****
Descriptionstring

The name of the route entry.

test
NextHopTypestring

The type of the next hop. Valid values:

  • EcsInstance: Elastic Compute Service (ECS) instance
  • NetworkInterface: elastic network interfaces (ENIs).
  • Local: local next hop
EcsInstance
DestinationCidrBlockstring

The destination CIDR block of the route.

192.168.0.5
Namestring

The name of the route entry.

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

name
NextHopsarray<object>

The information about the next hop.

NextHopobject
NextHopIdstring

The ID of the next hop.

vpn-bp10zyaph5cc8b7c7****
NextHopTypestring

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
Instance
Weightstring

The weight of the route.

100
Enabledstring

Indicates whether the route is available. Valid values:

  • 0: unavailable
  • 1: available
1

Examples

Sample success responses

JSONformat

{
  "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",
      "NextHops": [
        {
          "NextHopId": "vpn-bp10zyaph5cc8b7c7****",
          "NextHopType": "Instance",
          "Weight": "100",
          "Enabled": "1"
        }
      ]
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400ResourceNotFound.GatewayRouteTableThe specified resource GatewayRouteTable is not found.The gateway route table cannot be found.
400IllegalParam.NextTokenThe param of nextToken is illegal-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-08-07API Description Update. The Error code has changedView Change Details