All Products
Search
Document Center

VPN Gateway:DescribeVpnPbrRouteEntries

Last Updated:Nov 13, 2024

Queries policy-based routes configured for a VPN gateway.

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
vpc:DescribeVpnPbrRouteEntriesget
  • VpnGateway
    acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnGatewayId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the VPN gateway.

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

cn-zhangjiakou
VpnGatewayIdstringYes

The ID of the VPN gateway.

vpn-bp1a3kqjiiq9legfx****
PageNumberintegerNo

The page number. Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Maximum value: 50. Default value: 10.

10

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

PageSizeinteger

The number of entries per page.

10
RequestIdstring

The request ID.

5BE01CD7-5A50-472D-AC14-CA181C5C03BE
PageNumberinteger

The page number.

1
TotalCountinteger

The number of entries returned.

1
VpnPbrRouteEntriesarray<object>

The list of policy-based routes.

VpnPbrRouteEntryobject
NextHopstring

The next hop of the policy-based route.

vco-bp15oes1py4i66rmd****
Weightinteger

The weight of the policy-based route.

For a VPN gateway that supports IPsec-VPN connections in single-tunnel mode, the weight of a policy-based route indicates the priority of the route.

  • 100: a high priority If multiple policy-based routes with the same source CIDR block and destination CIDR block exist, the IPsec-VPN connection associated with the policy-based route is the active connection.
  • 0: a low priority If multiple policy-based routes with the same source CIDR block and destination CIDR block exist, the IPsec-VPN connection associated with the policy-based route is the standby connection.
Note For a VPN gateway that does not support IPsec-VPN connections in single-tunnel mode, this parameter does not take effect.
0
RouteDeststring

The destination CIDR block of the policy-based route.

10.0.0.0/24
Statestring

The status of the policy-based route. Valid values:

  • published: advertised to the VPC route table.
  • normal: not advertised to the VPC route table.
published
CreateTimelong

The time when the policy-based route was created. Unit: millisecond.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1492747187000
VpnInstanceIdstring

The ID of the VPN gateway.

vpn-bp1a3kqjiiq9legfx****
RouteSourcestring

The source CIDR block of the policy-based route.

192.168.0.0/24
Priorityinteger

The priority of the policy-based route.

A smaller value indicates a higher priority.

10
NextHopTunnelIdstring

The ID of the tunnel associated with the next hop of the policy-based route.

This parameter is returned only if the VPN gateway supports IPsec-VPN connections in dual-tunnel mode.

tun-opsqc4d97wni2****

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "5BE01CD7-5A50-472D-AC14-CA181C5C03BE\t",
  "PageNumber": 1,
  "TotalCount": 1,
  "VpnPbrRouteEntries": {
    "VpnPbrRouteEntry": [
      {
        "NextHop": "vco-bp15oes1py4i66rmd****\t",
        "Weight": 0,
        "RouteDest": "10.0.0.0/24",
        "State": "published",
        "CreateTime": 1492747187000,
        "VpnInstanceId": "vpn-bp1a3kqjiiq9legfx****",
        "RouteSource": "192.168.0.0/24",
        "Priority": 10,
        "NextHopTunnelId": "tun-opsqc4d97wni2****"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidVpnInstanceId.NotFoundThe specified VPN was not found.-
400InvalidVpnGatewayInstanceId.NotFoundThe specified vpn gateway instance id does not exist.The specified VPN gateway does not exist. Check whether the specified VPN gateway is valid.
403Forbbiden.SubUserUser not authorized to operate on the specified resource as your account is created by another user.You are unauthorized to perform this operation on the specified resource. Acquire the required permissions and try again.
403ForbiddenUser not authorized to operate on the specified resource.You do not have the permissions to manage the specified resource. Apply for the permissions and try again.

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

Change history

Change timeSummary of changesOperation
2024-01-04The Error code has changedView Change Details
2023-10-19API Description Update. The Error code has changedView Change Details
2023-06-13The Error code has changed. The response structure of the API has changedView Change Details