All Products
Search
Document Center

Virtual Private Cloud:DescribeRouteEntryList

Last Updated:Aug 29, 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

There is currently no authorization information disclosed in the API.

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

The information about the route.

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

The information about the next hops.

object
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-08-26The Error code has changedView Change Details
2024-01-05API Description Update. The Error code has changed. The response structure of the API has changedView Change Details
2023-07-03The Error code has changedView Change Details