All Products
Search
Document Center

Virtual Private Cloud:DescribeRouteEntryList

Last Updated:Mar 05, 2024

Queries information about route entries in a route table.

Operation description

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.

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:DescribeRouteEntryListRead
  • RouteTable
    acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the route table.

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

cn-hangzhou
RouteTableIdstringYes

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

vtb-bp1r9pvl4xen8s9ju****
RouteEntryIdstringNo

The ID of the route that you want to query.

rte-bp1mnnr2al0naomnp****
DestinationCidrBlockstringNo

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

192.168.2.0/24
RouteEntryNamestringNo

The name of the route entry.

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

abc
IpVersionstringNo

The IP version. Valid values:

  • IPv4
  • IPv6
IPv4
RouteEntryTypestringNo

The route type. Valid values:

  • Custom: custom routes.
  • System: system routes.
  • BGP: BGP routes.
  • CEN: Cloud Enterprise Network (CEN) routes.
  • ECR: Express Connect Router (ECR) routes.
System
NextHopIdstringNo

The ID of the next hop.

vpn-bp10zyaph5cc8b7c7****
NextHopTypestringNo

The next hop type. Valid values:

  • Instance: an Elastic Compute Service (ECS) instance. This is the default value.
  • 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.
  • Ipv4Gateway: an IPv4 gateway.
  • GatewayEndpoint: a gateway endpoint.
  • CenBasic: CEN does not support transit routers.
  • Ecr: Express Connect Router (ECR).
Instance
MaxResultintegerNo

The number of entries per 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.
  • You must specify the token that is obtained from the previous query as the value of NextToken.
FFmyTO70tTpLG6I3FmYAXGKPd****
ServiceTypestringNo

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

Set the value to TR, which specifies that the route is hosted by a transit router.

TR
DestCidrBlockListarrayNo

The destination CIDR blocks of the routes.

stringNo

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

192.168.0.0/24

Response parameters

ParameterTypeDescriptionExample
object

The route details.

NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

  • If no value is returned for NextToken, no next queries are sent.
  • If a value is returned for NextToken, the value is used to retrieve a new page of results.
FFmyTO70tTpLG6I3FmYAXGKPd****
RequestIdstring

The request ID.

14A07460-EBE7-47CA-9757-12CC4761D47A
RouteEntrysobject []

The information about the route.

Statusstring

The route status. Valid values:

  • Pending
  • Available
  • Modifying
Available
Typestring

The route type. Valid values:

  • Custom: custom routes.
  • System: system routes.
  • BGP: BGP routes.
  • CEN: CEN routes.
  • ECR: ECR routes.
Custom
IpVersionstring

The IP version. Valid values: Valid values:

  • ipv4
  • ipv6
IPv4
Descriptionstring

The description of the route.

RouteEntryDescription
RouteEntryNamestring

The name of the route.

aaa
DestinationCidrBlockstring

The destination CIDR block of the route.

192.168.2.0/24
RouteEntryIdstring

The ID of the route.

rte-bp1mnnr2al0naomnp****
RouteTableIdstring

The ID of the route table.

vtb-bp15w5q90d2rk3bww****
GmtModifiedstring

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

2022-05-09T03:00:07Z
NextHopsobject []

The information about the next hops.

NextHopRegionIdstring

The ID of the region where the next hop is deployed.

Note This parameter is returned when the next hop type is set to RouterInterface.
cn-hangzhou
Weightinteger

The weight of the route.

Note This parameter is returned when the next hop type is set to RouterInterface.
100
NextHopIdstring

The ID of the next hop.

vpn-bp10zyaph5cc8b7c7****
Enabledinteger

Indicates whether the route is available. Valid values:

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

The next hop type. 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.
  • Ipv4Gateway: an IPv4 gateway.
  • GatewayEndpoint: a gateway endpoint.
  • CenBasic: CEN does not support transit routers.
  • Ecr: ECR.
Instance
NextHopRelatedInfoobject

The information about the next hop.

InstanceIdstring

The ID of the instance that is associated with the next hop.

vpc-bp1t36rn9l53iwbsf****
InstanceTypestring

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

  • VPC: a VPC
  • VBR: a VBR
  • PCONN: an Express Connect circuit
VPC
RegionIdstring

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

ch-hangzhou
ServiceTypestring

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.

TR
Originstring

The route origin. Valid values:

  • RoutePropagation: The route is created by a dynamic propagation source.
  • SystemCreate: The route is created by the system.
  • CustomCreate: The route is created by a user.
RoutePropagation

Examples

Sample success responses

JSONformat

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
  "RouteEntrys": {
    "RouteEntry": [
      {
        "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": {
          "NextHop": [
            {
              "NextHopRegionId": "cn-hangzhou",
              "Weight": 100,
              "NextHopId": "vpn-bp10zyaph5cc8b7c7****",
              "Enabled": 1,
              "NextHopType": "Instance",
              "NextHopRelatedInfo": {
                "InstanceId": "vpc-bp1t36rn9l53iwbsf****",
                "InstanceType": "VPC",
                "RegionId": "ch-hangzhou"
              }
            }
          ]
        },
        "ServiceType": "TR",
        "Origin": "RoutePropagation"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidRouteTable.NotFound%s-
400IllegalParam.RouteEntryType%s-
400MissingParam.context%s-
400MissingParam.aliUid%s-
400MissingParam.bid%s-
400IllegalParam.IpVersion%s-
400OperationFailed.FilterParamUnderWrongRouteType%s-
400IllegalParam.NextTokenUser nextToken is illegal.-
400IllegalParam.NextTokenExpired%s-
400InvalidNextHop.NotFoundThe specified route entry nexthop does not exist in our records.-
400OperationFailed.QueryCenEntryOperation is denied because getting CEN route entry has failed.Operation is denied because getting CEN route entry has failed.
400OperationDenied.UseGatewayRouteEntryQueryInterfaceUse listGatewayRouteTableEntries to describe gateway route entries.-

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

Change history

Change timeSummary of changesOperation
2024-01-05API Description Update. The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
Output ParametersThe response structure of the API has changed.
2023-07-03The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400