Creates a customer gateway.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateCustomerGateway

The operation that you want to perform. Set the value to CreateCustomerGateway.

RegionId String Yes cn-shanghai

The region ID of the customer gateway.

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

ClientToken String No 02fb3da4-130e-11e9-8e44****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.
IpAddress String Yes 101.12.XX.XX

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

Name String No nametest

The name of the customer gateway.

The name must be 1 to 100 characters in length, and cannot start with http:// or https://.

Description String No desctest

The description of the customer gateway.

The description must be 1 to 100 characters in length, and cannot start with http:// or https://.

Asn String No 65530

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

Asn is a 4-byte number. You can enter the number in two segments and separate the first 16 bits from the following 16 bits with a period (.). Enter the number in each segment in the decimal format.

For example, if you enter 123.456, the ASN is: 123 × 65536 + 456 = 8061384.

AuthKey String No AuthKey****

The authentication key of the BGP routing protocol for the gateway device in the data center.

The key must be 1 to 64 characters in length. It can contain only ASCII characters and cannot contain spaces or question marks (?).

Tags.N.Key String No TagKey

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.

Tags.N.Value String No TagValue

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.

Response parameters

Parameter Type Example Description
RequestId String D32B3C26-6C6C-4988-93E9-D2A6444CE6AE

The ID of the request.

IpAddress String 101.12.XX.XX

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

Description String desctest

The description of the customer gateway.

CustomerGatewayId String cgw-bp1jrawp82av6bws9****

The ID of the customer gateway.

CreateTime Long 1493363486000

The timestamp generated when the customer gateway was created. Unit: milliseconds.

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.

Name String nametest

The name of the customer gateway.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateCustomerGateway
&RegionId=cn-shanghai
&ClientToken=02fb3da4-130e-11e9-8e44****
&IpAddress=101.12.XX.XX
&Name=nametest
&Description=desctest
&Asn=65530
&Tags=[{"Key":"Tagkey","Value":"Tagvalue"}]
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateCustomerGatewayResponse>
    <RequestId>D32B3C26-6C6C-4988-93E9-D2A6444CE6AE</RequestId>
    <IpAddress>101.12.XX.XX</IpAddress>
    <Description>desctest</Description>
    <CustomerGatewayId>cgw-bp1jrawp82av6bws9****</CustomerGatewayId>
    <CreateTime>1493363486000</CreateTime>
    <Name>nametest</Name>
</CreateCustomerGatewayResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "D32B3C26-6C6C-4988-93E9-D2A6444CE6AE",
  "IpAddress" : "101.12.XX.XX",
  "Description" : "desctest",
  "CustomerGatewayId" : "cgw-bp1jrawp82av6bws9****",
  "CreateTime" : 1493363486000,
  "Name" : "nametest"
}

Error codes

HttpCode Error code Error message Description
400 InvalidAuthkey.Malformed The specified BGP authentication key (%s) is malformed. The error message returned because the BGP authentication key is invalid.
400 InvalidIpAddress.AlreadyExist Specified IpAddress is already exist. The error message returned because the specified IP address already exists. The error message returned because one user in one region cannot use duplicate IP addresses.
400 InvalidIpAddress.WrongFormat Specified IpAddress is invalid. The error message returned because the specified IP address is invalid.
400 InvalidName The name is not valid The error message returned because the format of the name is invalid.
400 InvalidDescription The description is not valid The error message returned because the description is specified in an invalid format.
400 Resource.QuotaFull The quota of resource is full The error message returned because the resource quota is exhausted.
400 IllegalParam.Asn The specified Asn is invalid. The error message returned because the value of the ASN is invalid.
400 OperationDenied.MissingAsn The autonomous system number of the customer gateway is mandatory when BGP authentication key is specified. The error message returned because when you specify the BGP authentication key, you must also specify an ASN.
400 InvalidParameter.TagValue The specified parameter TagValue is invalid. The error message returned because the specified tag value is invalid.
400 SizeLimitExceeded.TagNum The maximum number of tags is exceeded. The error message returned because the number of tags exceeds the upper limit.
400 Forbidden.TagKey.Duplicated The specified tag key already exists. The error message returned because the tag key already exists.
400 InvalidParameter.TagKey The specified parameter TagKey is invalid. The error message returned because the specified tag key is invalid.
400 Duplicated.TagKey The specified parameter TagKey is duplicated. The error message returned because the specified tag key already exists.
403 Forbidden.SubUser User 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.
403 Forbidden User not authorized to operate on the specified resource. The error message returned because you are unauthorized to manage the specified resource. Acquire the required permissions and try again.
409 OperationConflict The operation against this instance is too frequent, please try again later. The error message returned because operations are performed on the gateway at a high frequency. Try again later.

For a list of error codes, see Service error codes.