All Products
Search
Document Center

Virtual Private Cloud:DescribeCustomerGateways

Last Updated:Aug 29, 2024

Queries customer gateways.

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 ID of the region where the customer gateway is deployed.

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

cn-shanghai
CustomerGatewayIdstringNo

The ID of the customer gateway.

Note If you do not specify a customer gateway ID, the system queries all customer gateways in the current region by default.
cgw-bp1pvpl9r9adju6l5****
PageNumberintegerNo

The page number. Default value: 1.

1
PageSizeintegerNo

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

10
Tagarray<object>No

The tags to be added to the customer gateway.

objectNo
KeystringNo

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

The tag key can be up to 64 characters in length and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

You can specify at most 20 tag keys at a time.

TagKey
ValuestringNo

The value of the tag.

The tag value can be up to 128 characters in length. It can be an empty string. 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 at a time.

TagValue
ResourceGroupIdstringNo

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

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

rg-acfmzs372yg****

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

PageSizeinteger

The number of entries returned per page.

10
RequestIdstring

The request ID.

E82612A9-CB90-4D7E-B394-1DB7F6509B29
PageNumberinteger

The page number.

1
TotalCountinteger

The number of returned entries.

1
CustomerGatewaysarray<object>

The information about customer gateways.

object
IpAddressstring

The IP address of the gateway device in the data center.

139.32.XX.XX
Asnlong

The autonomous system number (ASN) of the gateway device in the data center.

65530
Descriptionstring

The description of the customer gateway.

desctest
CustomerGatewayIdstring

The customer gateway ID.

cgw-bp1pvpl9r9adju6l5****
CreateTimelong

The time when the customer gateway 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
Namestring

The name of the customer gateway.

nametest
AuthKeystring

The authentication key that is used to connect to the gateway device in the data center by using Border Gateway Protocol (BGP).

AuthKey****
Tagsarray<object>

The tags that are added to the customer gateway.

object
Keystring

The key of the tag.

TagKey
Valuestring

The value of the tag.

TagValue
ResourceGroupIdstring

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

You can call the ListResourceGroups operation to query resource groups.

rg-acfmzs372yg****

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "E82612A9-CB90-4D7E-B394-1DB7F6509B29",
  "PageNumber": 1,
  "TotalCount": 1,
  "CustomerGateways": {
    "CustomerGateway": [
      {
        "IpAddress": "139.32.XX.XX",
        "Asn": 65530,
        "Description": "desctest",
        "CustomerGatewayId": "cgw-bp1pvpl9r9adju6l5****",
        "CreateTime": 1492747187000,
        "Name": "nametest",
        "AuthKey": "AuthKey****",
        "Tags": {
          "Tag": [
            {
              "Key": "TagKey",
              "Value": "TagValue"
            }
          ]
        },
        "ResourceGroupId": "rg-acfmzs372yg****"
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Forbidden.TagKey.DuplicatedThe specified tag key already exists.The tag resources are duplicate.
400SizeLimitExceeded.TagNumThe maximum number of tags is exceeded.The number of tags has reached the upper limit.
400InvalidParameter.TagValueThe specified parameter TagValue is invalid.The error message returned because the specified tag value is invalid.
400InvalidParameter.TagKeyThe specified parameter TagKey is invalid.The error message returned because the specified tag key is invalid.
400Duplicated.TagKeyThe specified parameter TagKey is duplicated.The error message returned because the specified tag key already exists.
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
2023-10-19API Description Update. The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details