Last updated: 2019-11-29 18:29:34


1. API Description

Domain name for API request:

This API (DescribeVpnGateways) is used to query the VPN gateway list.

A maximum of 100 requests can be initiated per second for this API.

Note: This API supports Finance regions. Since Finance regions and non-Finance regions are isolated and not interconnected. If the common parameter Region is a Finance region (such as ap-shanghai-fsi), you need to specify a domain name containing the Finance region that should be identical to the value of Region field, for example:

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: DescribeVpnGateways
Version Yes String Common parameter. The value used for this API: 2017-03-12
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
VpnGatewayIds.N No Array of String VPN gateway instance ID, such as vpngw-f49l6u0z. A maximum of 100 instances are allowed for each request. VpnGatewayIds and Filters cannot be specified at the same time.
Filters.N No Array of FilterObject Filter object attributes
Offset No Integer Offset
Limit No Integer Number of requested objects

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Number of instances matching the filter condition.
VpnGatewaySet Array of VpnGateway Details of VPN gateway instances.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InvalidVpnGatewayId.Malformed Invalid VPN gateway. The VPN instance ID is invalid.
InvalidVpnGatewayId.NotFound Invalid VPN gateway. The VPN instance does not exist. Verify whether the resource information you entered is correct.

5. Example

Example 1 Query VPN gateways

Input example
&<Common request parameters>

Output example

  "Response": {
    "RequestId": "74883e1b-5901-46de-ae1e-d6e2cf591c5b",
    "TotalCount": 10,
    "VpnGatewaySet": [
        "CreatedTime": "2018-03-25 16:05:22",
        "ExpiredTime": "0000-00-00 00:00:00",
        "InstanceChargeType": "POSTPAID_BY_HOUR",
        "InternetMaxBandwidthOut": 5,
        "IsAddressBlocked": false,
        "PublicIpAddress": "",
        "RenewFlag": "NOTIFY_AND_AUTO_RENEW",
        "State": "PENDING",
        "Type": "IPSEC",
        "VpcId": "vpc-ngenl4az",
        "VpnGatewayId": "vpngw-rn2yn85v",
        "VpnGatewayName": "TEST_POSTPAID"
        "CreatedTime": "2017-02-08 12:55:00",
        "ExpiredTime": "0000-00-00 00:00:00",
        "InstanceChargeType": "PREPAID",
        "InternetMaxBandwidthOut": 5,
        "IsAddressBlocked": false,
        "PublicIpAddress": "",
        "RenewFlag": "NOTIFY_AND_AUTO_RENEW",
        "State": "PENDING",
        "Type": "IPSEC",
        "VpcId": "vpc-lzwkkgyz",
        "VpnGatewayId": "vpngw-fa4hsbed",
        "VpnGatewayName": "leo-test-3"

6. Other Resources

Cloud API 3.0 comes with the following development tools to make it easier to call the API.