All Products
Search
Document Center

Virtual Private Cloud:ListGatewayRouteTableEntries

Last Updated:Aug 29, 2024

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.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
vpc:ListGatewayRouteTableEntrieslist
  • RouteTable
    acs:vpc:{#regionId}:{#accountId}:routetable/{#routetableId}
    none
none

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.

object
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.

object
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