All Products
Search
Document Center

VPN Gateway:DescribeVpnGateways

Last Updated:Mar 04, 2024

Queries VPN gateways in a region.

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:DescribeVpnGatewaysList
  • VpnGateway
    acs:vpc:{#regionId}:{#accountId}:vpngateway/*
  • VpnGateway
    acs:vpc:{#regionId}:{#accountId}:vpngateway/{#VpnInstanceId}
    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
VpcIdstringNo

The ID of the virtual private cloud (VPC) to which the VPN gateway belongs.

vpc-bp1m3i0kn1nd4wiw9****
VpnGatewayIdstringNo

The ID of the VPN gateway.

vpn-bp17lofy9fd0dnvzv****
StatusstringNo

The status of the VPN gateway. Valid values:

  • init
  • provisioning
  • active
  • updating
  • deleting
active
BusinessStatusstringNo

The payment status of the VPN gateway. Valid values:

  • Normal
  • FinancialLocked
Normal
PageNumberintegerNo

The page number. Default value: 1.

1
PageSizeintegerNo

The number of entries per page. Valid values: 1 to 50. Default value: 10.

10
IncludeReservationDatabooleanNo

Specifies whether to return information about pending orders. Valid values:

  • false (default)
  • true
true
Tagobject []No

The value of tag N to add to the resource.

The value of this parameter can be an empty string and cannot exceed 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Each tag key corresponds to one tag value. You can specify at most 20 tag values in each call.

KeystringNo

The tag key. The tag key cannot be an empty string.

It can be at most 64 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

You can specify at most 20 tag keys in each call.

FinanceDept
ValuestringNo

The tag value.

The tag value can be an empty string and cannot exceed 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

Each tag key corresponds to one tag value. You can specify at most 20 tag values in each call.

FinanceJoshua
ResourceGroupIdstringNo

The ID of the resource group to which the VPN gateway belongs.

You can call the ListResourceGroups operation to query the resource group list.

rg-acfmzs372yg****

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

PageSizeinteger

The number of entries returned per page.

10
RequestIdstring

The request ID.

DF11D6F6-E35A-41C3-9B20-6FC8A901FE65
PageNumberinteger

The number of the returned page.

1
TotalCountinteger

The number of entries returned.

1
VpnGatewaysobject []

The information about VPN gateways.

VpnTypestring

The type of the VPN gateway.

Only Normal may be returned, which indicates a standard NAT gateway.

Normal
Statusstring

The status of the VPN gateway. Valid values:

  • init
  • provisioning
  • active
  • updating
  • deleting
active
VpcIdstring

The ID of the virtual private cloud (VPC) to which the VPN gateway belongs.

vpc-bp1m3i0kn1nd4wiw9****
SslMaxConnectionslong

The number of SSL-VPN connections supported by the VPN gateway.

5
Specstring

The maximum bandwidth of the VPN gateway. M indicates Mbit/s.

5M
InternetIpstring
  • If the VPN gateway supports IPsec-VPN connections in single-tunnel mode, the address is the IP address of the VPN gateway and can be used to create an IPsec-VPN connection or an SSL-VPN connection.

  • If the VPN gateway supports IPsec-VPN connections in dual-tunnel mode, the address is the first IP address used to create an IPsec-VPN connection. The address cannot be used to create an SSL-VPN connection.

    If the VPN gateway supports IPsec-VPN connections in dual-tunnel mode, the system assigns two IP addresses to the VPN gateway to create two encrypted tunnels.

47.12.XX.XX
CreateTimelong

The timestamp when the VPN gateway was created. Unit: millisecond.

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

1515383700000
AutoPropagateboolean

Indicates whether BGP routes are automatically advertised to the VPC. Valid values:

  • true
  • false
true
ChargeTypestring

The billing method of the VPN gateway.

The value is fixed as POSTPAY, which indicates the pay-as-you-go billing method.

Example value for the China site (aliyun.com): Prepay. Example value for the International site (alibabacloud.com): POSTPAY.
VpnGatewayIdstring

The ID of the VPN gateway.

vpn-bp17lofy9fd0dnvzv****
Tagstring

The automatically generated tag of the VPN gateway.

  • VpnEnableBgp: indicates whether the VPN gateway supports BGP. Valid values:

    • true
    • false
  • VisuallySsl: indicates whether the VPN gateway allows you to view information about connected SSL clients.

    • true
    • false
  • PbrPriority: indicates whether the VPN gateway allows you to configure priorities for policy-based routes.

    • true
    • false
  • VpnNewImage: indicates whether the VPN gateway is upgraded.

    • true
    • false
  • description: the description of the VPN gateway. This parameter is for internal system use only.

  • VpnVersion: the version of the VPN gateway.

{\"VpnEnableBgp\":\"true\",\"VisuallySsl\":\"true\",\"PbrPriority\":\"true\",\"VpnNewImage\":\"true\",\"description\":\"forwarding1.3.7\",\"VpnVersion\":\"v1.2.4\"}
IpsecVpnstring

Indicates whether IPsec-VPN is enabled for the VPN gateway.

  • enable
  • disable
enable
EndTimelong

The timestamp when the VPN gateway expires. Unit: millisecond.

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

1518105600000
VSwitchIdstring

The ID of the vSwitch to which the VPN gateway belongs.

vsw-bp15lbk8sgtr6r5b0****
Descriptionstring

The description of the VPN gateway.

test
EnableBgpboolean

The BGP status of the VPN gateway.

  • true
  • false
true
BusinessStatusstring

The payment status of the VPN gateway.

  • Normal
  • FinancialLocked
Normal
SslVpnstring

Indicates whether SSL-VPN is enabled for the VPN gateway.

  • enable
  • disable
enable
Namestring

The name of the VPN gateway.

test
NetworkTypestring

The network type of the VPN gateway.

  • public
  • private
public
Tagsobject []

The tags to be added to the VPN gateway.

Keystring

The key of tag N.

FinanceDept
Valuestring

The value of tag N.

FinanceJoshua
ReservationDataobject

The information about pending orders.

Note This parameter is returned only when IncludeReservationData is set to true.
Statusstring

The status of the order that has not taken effect.

  • 1: indicates that the order is an order for renewal or renewal with a specification change and the order has not taken effect.
  • 2: indicates that the order is an order for temporary upgrade and the order has taken effect. After the temporary upgrade expires, the system restores the VPN gateway to its previous specifications. In this case, ReservationIpsec, ReservationMaxConnections, ReservationSpec, and ReservationSsl indicate the previous specification.
1
ReservationOrderTypestring

The type of the order that has not taken effect. Valid values:

  • RENEWCHANGE: renewal with upgrade or downgrade
  • TEMP_UPGRADE: temporary upgrade
  • RENEW: renewal
TEMP_UPGRADE
ReservationIpsecstring

The IPsec-VPN status of the order that has not taken effect. Valid values:

  • enable
  • disable
enable
ReservationSpecstring

The bandwidth of the pending order. Unit: Mbit/s.

5
ReservationSslstring

The SSL-VPN status of the order that has not taken effect. Valid values:

  • enable
  • disable
enable
ReservationMaxConnectionsinteger

The maximum number of concurrent SSL-VPN connections of the pending order.

5
ReservationEndTimestring

If the order type is TEMP_UPGRADE (temporary upgrade), this parameter specifies the time when the temporary upgrade expires.

If the order type is RENEWCHANGE (renewal with a specification change) or RENEW (renewal), this parameter indicates the time when the renewal or renewal with a specification change takes effect.

2021-07-20T16:00:00Z
DisasterRecoveryInternetIpstring

The second IP address assigned by the system to create an IPsec-VPN connection.

This parameter is returned only when the VPN gateway supports the dual-tunnel mode.

47.91.XX.XX
DisasterRecoveryVSwitchIdstring

The ID of the second vSwitch associated with the VPN gateway.

This parameter is returned only when the VPN gateway supports the dual-tunnel mode.

vsw-p0w95ql6tmr2ludkt****
SslVpnInternetIpstring

The IP address of the SSL-VPN connection.

This parameter is returned only when the VPN gateway is a public VPN gateway and supports only the single-tunnel mode. In addition, the VPN gateway must have the SSL-VPN feature enabled.

47.74.XX.XX
ResourceGroupIdstring

The ID of the resource group to which the VPN gateway belongs.

You can call the ListResourceGroups operation to query the resource group information.

rg-acfmzs372yg****

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "DF11D6F6-E35A-41C3-9B20-6FC8A901FE65",
  "PageNumber": 1,
  "TotalCount": 1,
  "VpnGateways": {
    "VpnGateway": [
      {
        "VpnType": "Normal",
        "Status": "active",
        "VpcId": "vpc-bp1m3i0kn1nd4wiw9****",
        "SslMaxConnections": 5,
        "Spec": "5M",
        "InternetIp": "47.12.XX.XX",
        "CreateTime": 1515383700000,
        "AutoPropagate": true,
        "ChargeType": "Example value for the China site (aliyun.com): Prepay. Example value for the International site (alibabacloud.com): POSTPAY.",
        "VpnGatewayId": "vpn-bp17lofy9fd0dnvzv****",
        "Tag": "{\\\"VpnEnableBgp\\\":\\\"true\\\",\\\"VisuallySsl\\\":\\\"true\\\",\\\"PbrPriority\\\":\\\"true\\\",\\\"VpnNewImage\\\":\\\"true\\\",\\\"description\\\":\\\"forwarding1.3.7\\\",\\\"VpnVersion\\\":\\\"v1.2.4\\\"}",
        "IpsecVpn": "enable",
        "EndTime": 1518105600000,
        "VSwitchId": "vsw-bp15lbk8sgtr6r5b0****",
        "Description": "test",
        "EnableBgp": true,
        "BusinessStatus": "Normal",
        "SslVpn": "enable",
        "Name": "test",
        "NetworkType": "public",
        "Tags": {
          "Tag": [
            {
              "Key": "FinanceDept",
              "Value": "FinanceJoshua"
            }
          ]
        },
        "ReservationData": {
          "Status": "1",
          "ReservationOrderType": "TEMP_UPGRADE",
          "ReservationIpsec": "enable",
          "ReservationSpec": "5",
          "ReservationSsl": "enable",
          "ReservationMaxConnections": 5,
          "ReservationEndTime": "2021-07-20T16:00:00Z"
        },
        "DisasterRecoveryInternetIp": "47.91.XX.XX",
        "DisasterRecoveryVSwitchId": "vsw-p0w95ql6tmr2ludkt****",
        "SslVpnInternetIp": "47.74.XX.XX",
        "ResourceGroupId": "rg-acfmzs372yg****"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.TagKeyThe specified parameter TagKey is invalid.The error message returned because the specified tag key is invalid.
400InvalidParameter.TagValueThe specified parameter TagValue is invalid.The error message returned because the specified tag value is invalid.
400Duplicated.TagKeyThe specified parameter TagKey is duplicated.The error message returned because the specified tag key already exists.
400InternalErrorThe request processing has failed due to some unknown error, exception or failure.An internal error occurred.
403Forbidden.SubUserUser not authorized to operate on the specified resource as your account is created by another user.The error message returned because 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
2023-10-19API Description Update. The API operation is not deprecated.. The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
API Deprecation DescriptionThe API operation is not deprecated..
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: ResourceGroupId
Output ParametersThe response structure of the API has changed.
2023-06-30The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
Output ParametersThe response structure of the API has changed.
2023-05-04The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403