All Products
Search
Document Center

Cloud Enterprise Network:ListTransitRouterRouteEntries

Last Updated:Nov 19, 2024

Queries the details about routes in the route tables of an Enterprise Edition transit router.

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

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
cen:ListTransitRouterRouteEntriesget
*TransitRouterRouteEntry
acs:cen:*:{#accountId}:centransitrouterroutentry/{#centransitrouterroutentryId}
*TransitRouterRouteTable
acs:cen:*:{#accountId}:centransitrouterroutetable/{#centransitrouterroutetableId}
*TransitRouterRouteEntry
acs:cen:*:{#accountId}:centransitrouterroutentry/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MaxResultsintegerNo

The number of entries per page. Valid values: 1 to 100. Default value: 20.

20
TransitRouterRouteEntryDestinationCidrBlockdeprecatedstringNo

The destination CIDR block of the route. This parameter is to be deprecated. We recommend that you use the RouteFilter parameter.

192.168.0.0/24
TransitRouterRouteEntryStatusstringNo

The status of the route. Valid values:

  • All
  • Active (default)
  • Rejected
  • Prohibited
  • Standby
  • Candidate

If you do not specify a value, routes in the active state are queried.

Active
TransitRouterRouteTableIdstringYes

The ID of the route table of the Enterprise Edition transit router.

vtb-bp1dudbh2d5na6b50****
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.
fce19****
TransitRouterRouteEntryNamesarrayNo

The route name.

stringNo

The route name.

The name is optional. If you enter a name, it must be 1 to 128 characters in length, and cannot start with http:// or https://.

Note You can use this parameter to query only static routes in the specified route table. This parameter conflicts with other query conditions except for TransitRouterRouteEntryIds.
testname
TransitRouterRouteEntryIdsarrayNo

The route ID.

stringNo

The route ID.

Note You can use this parameter to query only static routes in the specified route table. This parameter conflicts with other query conditions except for TransitRouterRouteEntryNames.
rte-oklkgwmj97z6dn****
TransitRouterRouteEntryTypestringNo

The route type. Valid values:

  • Propagated: automatically learned by the route table.
  • Static: static routes.
Propagated
TransitRouterRouteEntryNextHopTypestringNo

The next hop type. Valid values:

  • BlackHole: routes network traffic to a black hole.
  • Attachment: routes network traffic to a network instance connection.
Attachment
TransitRouterRouteEntryNextHopIdstringNo

The ID of the network instance connection that you want to specify as the next hop.

tr-attach-nls9fzkfat8934****
TransitRouterRouteEntryNextHopResourceIdstringNo

The next hop ID.

vpc-m5ent6du8deaq5*****
TransitRouterRouteEntryNextHopResourceTypestringNo

The next hop type. Valid values:

  • VPC
  • VBR
  • TR
  • VPN
VPC
TransitRouterRouteEntryOriginResourceIdstringNo

The source instance ID.

vpc-m5ent6du8deaq5*****
TransitRouterRouteEntryOriginResourceTypestringNo

The source instance type. Valid values:

  • VPC
  • VBR
  • TR
  • VPN
VPC
PrefixListIdstringNo

The prefix list ID.

pl-6ehtn5kqxgeyy08fi****
RouteFilterarray<object>No

The filter conditions.

objectNo

The filter conditions.

KeystringNo

The match pattern for filtering CIDR blocks. Valid values:

  • PrefixExactMatchCidrs: exact matching.
  • LongestPrefixMatchCidrs: longest prefix matching. You can specify IP addresses and CIDR blocks.
  • SubnetOfMatchCidrs: subnet matching. The subnets of the specified CIDR blocks, including the CIDR block, are matches against the match conditions.
  • SupernetOfMatchCidrs: supernet matching. The supernets of the CIDR block, including the CIDR block, are matched against the match conditions.

By default, the logical operator among filter conditions is AND. Information about a route entry is returned only if the route entry matches all filter conditions. Filter conditions must be unique.

PrefixExactMatchCidrs
ValuearrayNo

The filter value.

stringNo

Specify a filter value based on the Key. You can specify multiple values for a key. The logical operator among values is OR, which indicates that a route entry is a match if the request matches one of the values. You can specify at most 500 values for each match condition.
IPv4 addresses and CIDR blocks and IPv6 addresses and CIDR blocks are supported.

192.168.1.0/24

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

NextTokenstring

A pagination token. It 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 the token that determines the start point of the next query.
fce19****
RequestIdstring

The request ID.

C3835E5E-1504-4344-B1BB-98A4110F1079
TotalCountinteger

The total number of entries returned.

6
MaxResultsinteger

The number of entries per page.

20
TransitRouterRouteEntriesarray<object>

A list of route entries.

TransitRouterRouteEntryobject

The information about the route.

TransitRouterRouteEntryIdstring

The route ID.

Note This parameter is returned only for static routes.
rte-oklkgwmj97z6dn****
TransitRouterRouteEntryDestinationCidrBlockstring

The destination CIDR block of the route entry. An IPv4 or IPv6 CIDR block is returned.

192.168.0.0/24
TransitRouterRouteEntryTypestring

The type of the route. Valid values:

  • Static: static routes.
  • Propagated: automatically learned by the route table.
Static
CreateTimestring

The time when the route entry was created.

The time follows the ISO8601 standard in the YYYY-MM-DDThh:mmZ format. The time is displayed in UTC.

Note This parameter is returned only for static routes.
2021-06-15T07:01Z
TransitRouterRouteEntryNamestring

The route name.

Note This parameter is returned only for static routes.
testname
TransitRouterRouteEntryStatusstring

The route status. Valid values:

  • Active
  • Rejected
  • Prohibited
  • Standby
  • Candidate
  • Creating
  • Deleting
Active
TransitRouterRouteEntryNextHopTypestring

The next hop type. Valid values:

  • BlackHole: a blackhole route. Packets destined for the destination CIDR block of the route are dropped.
  • Attachment: a network instance connection. Packets destined for the destination CIDR block of the route are forwarded to the specified network instance connection.
BlackHole
TransitRouterRouteEntryNextHopIdstring

The next hop ID. This parameter is not returned if the route is a blackhole route.

tr-attach-vx6iwhjr1x1j78****
TransitRouterRouteEntryDescriptionstring

The route description.

Note This parameter is returned only for static routes.
CidrRoute
OperationalModeboolean

Indicates whether the route can be managed. Valid values:

  • true: The route can be managed. You can delete the route.
  • false: The route cannot be managed because it is automatically generated by the system.
false
Tagstring

The route tag.

Only PermitVbr may be returned, which indicates that the route is advertised only to the route tables of the virtual border routers (VBRs) that are connected to the transit router.

Note This parameter is returned only for routes whose CIDR blocks are automatically generated by the system.
PermitVbr
TransitRouterRouteEntryNextHopResourceIdstring

The next hop ID.

vpc-m5ent6du8deaq5*****
TransitRouterRouteEntryNextHopResourceTypestring

The next hop type. Valid values:

  • VPC
  • VBR
  • TR
  • VPN
VPC
TransitRouterRouteEntryOriginResourceTypestring

The source instance type. Valid values:

  • VPC
  • VBR
  • TR
  • VPN
VPC
TransitRouterRouteEntryOriginResourceIdstring

The source instance ID.

vpc-m5ent6du8deaq5*****
PrefixListIdstring

The prefix list ID.

pl-k1ainl66z3527773d****
PathAttributesobject

The route attributes.

Communitiesarray

The route community.

Communitystring

The community attributes of the routes.

65501:1
AsPathsarray

The route AS path.

AsPathstring

The AS path of the route.

65501
OriginInstanceIdstring

The source instance ID.

vbr-m5ent6du8deaq5*****
OriginInstanceTypestring

The source instance type. Valid values:

  • VPC
  • VBR
  • TR
  • VPN
  • CCN
VBR
OriginRouteTypestring

The route type. Valid values:

  • System
  • Custom
  • static
  • BGP
  • BlackHole
BGP
Preferenceinteger

The route priority.

A smaller value indicates a higher priority.

50

Examples

Sample success responses

JSONformat

{
  "NextToken": "fce19****",
  "RequestId": "C3835E5E-1504-4344-B1BB-98A4110F1079",
  "TotalCount": 6,
  "MaxResults": 20,
  "TransitRouterRouteEntries": [
    {
      "TransitRouterRouteEntryId": "rte-oklkgwmj97z6dn****",
      "TransitRouterRouteEntryDestinationCidrBlock": "192.168.0.0/24",
      "TransitRouterRouteEntryType": "Static",
      "CreateTime": "2021-06-15T07:01Z",
      "TransitRouterRouteEntryName": "testname",
      "TransitRouterRouteEntryStatus": "Active",
      "TransitRouterRouteEntryNextHopType": "BlackHole",
      "TransitRouterRouteEntryNextHopId": "tr-attach-vx6iwhjr1x1j78****",
      "TransitRouterRouteEntryDescription": "CidrRoute",
      "OperationalMode": false,
      "Tag": "PermitVbr",
      "TransitRouterRouteEntryNextHopResourceId": "vpc-m5ent6du8deaq5*****",
      "TransitRouterRouteEntryNextHopResourceType": "VPC",
      "TransitRouterRouteEntryOriginResourceType": "VPC",
      "TransitRouterRouteEntryOriginResourceId": "vpc-m5ent6du8deaq5*****",
      "PrefixListId": "pl-k1ainl66z3527773d****",
      "PathAttributes": {
        "Communities": [
          "65501:1"
        ],
        "AsPaths": [
          "65501"
        ],
        "OriginInstanceId": "vbr-m5ent6du8deaq5*****\n",
        "OriginInstanceType": "VBR",
        "OriginRouteType": "BGP",
        "Preference": 50
      }
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400IllegalParam.TransitRouterRouteTableIdTransitRouterRouteTableId is illegal.The error message returned because the route table ID of the transit router (TransitRouterRouteTableId) is invalid.
400IllegalParam.TransitRouterRouteEntryStatusTransitRouterRouteEntryStatus is illegal.The error message returned because the status of the route on the transit router (TransitRouterRouteEntryStatus) is invalid.
400IllegalParam.NextTokenNextToken is illegal.The error message returned because the NextToken parameter is set to an invalid value.
400ParamExclusive.RouteEntryIdsAndStatusTransitRouterRouteEntryIds and TransitRouterRouteEntryStatus is mutually exclusive.The error message returned because the TransitRouterRouteEntryIds and TransitRouterRouteEntryStatus parameters conflict with each other.
400InvalidTransitRouterRouteTableId.NotFoundTransitRouterRouteTableId is not found.The error message returned because the specified route table ID of the transit router does not exist.
400FilterKeyDuplicated.RouteFilterThe keys in RouteFilter are duplicated.The error message returned because RouteFilter contains duplicate key values.
400InvalidFilterKeyThe key in filter is invalid.The key in filter is invalid.
400IllegalParam.TransitRouterRouteEntryNextHopTypeTransitRouterRouteEntryNextHopType is invalid.The error message returned because the TransitRouterRouteEntryNextHopType parameter is set to an invalid value.
400IllegalParam.TransitRouterRouteEntryNextHopAttachmentIdTransitRouterRouteEntryNextHopAttachmentId is invalid.The error message returned because TransitRouterRouteEntryNextHopAttachmentId is set to an invalid value.
400IllegalParam.TransitRouterRouteEntryNextHopResourceIdTransitRouterRouteEntryNextHopResourceId is invalid.The error message returned because TransitRouterRouteEntryNextHopResourceId is set to an invalid value.
400IllegalParam.TransitRouterRouteEntryNextHopResourceTypeTransitRouterRouteEntryNextHopResourceType is invalid.The error message returned because TransitRouterRouteEntryNextHopResourceType is set to an invalid value.
400IllegalParam.TransitRouterRouteEntryOriginResourceIdTransitRouterRouteEntryOriginResourceId is invalid.The error message returned because TransitRouterRouteEntryOriginResourceId is set to an invalid value.
400IllegalParam.TransitRouterRouteEntryOriginResourceTypeTransitRouterRouteEntryOriginResourceType is invalid.The error message returned because TransitRouterRouteEntryOriginResourceType is set to an invalid value.
400IllegalParam.TransitRouterRouteEntryTypeTransitRouterRouteEntryType is invalid.The error message returned because TransitRouterRouteEntryType is set to an invalid value.
400IllegalParam.PrefixExactMatchCidrPrefixExactMatchCidr is invalid.The error message returned because PrefixExactMatchCidr is set to an invalid value.
400IllegalParam.LongestPrefixMatchCidrLongestPrefixMatchCidr is invalid.The error message returned because LongestPrefixMatchCidr is set to an invalid value.
400IllegalParam.SubnetOfMatchCidrSubnetOfMatchCidr is invalid.The error message returned because SubnetOfMatchCidr is set to an invalid value.
400IllegalParam.SupernetOfMatchCidrSupernetOfMatchCidr is invalid.The error message returned because SupernetOfMatchCidr is set to an invalid value.
400InvalidNameName is invalid.The error message returned because the specified name is invalid.
400IllegalParam.TextMatchCidrThe TextMatchCidr specified in the parameter is illegal.The TextMatchCidr specified in the parameter is illegal.
400InvalidParameterInvalid parameter.The error message returned because the parameter is set to an invalid value.
400UnauthorizedThe AccessKeyId is unauthorized.The error message returned because you do not have the permissions to perform this operation.
404InvalidRouteTableId.NotFoundThe specified RouteTableId is not found.The specified route table ID does not exist.

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

Change history

Change timeSummary of changesOperation
2024-07-10The Error code has changedView Change Details
2023-12-13The Error code has changedView Change Details
2023-07-13The Error code has changed. The response structure of the API has changedView Change Details
2023-07-07The Error code has changed. The response structure of the API has changedView Change Details
2023-07-07The Error code has changed. The response structure of the API has changedView Change Details
2023-04-04The Error code has changedView Change Details
2023-03-02The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details