Creates a customer gateway.

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

Request parameters

Parameter Type Required? Example value Description
Action String Yes CreateCustomerGateway

The name of this action. Value:

CreateCustomerGateway

IpAddress  String Yes 116.62.222.xxx

The IP address of the customer gateway.

RegionId String Yes cn-shanghai

The ID of the region to which the customer gateway belongs.

To query the region ID, callDescribeRegions.

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

A client token used to guarantee the idempotence of requests.

This parameter value is generated by the client and must be unique. It must be 1 to 64 ASCII characters in length.

Description String No customer gateway

 The description of the customer gateway.

The description must be 2 to 256 characters in length. It must start with an English letter. It cannot start with http:// or https://.

Name String No Gateway

The name of the customer gateway.

The name must be 2 to 128 characters in length and can contain letters, numbers. periods (.), underscores (_), and hyphens (-). The name must start with a letter. It cannot start with http:// or https://.

Response parameters

Parameter Type Example value Description
CustomerGatewayId String cgw-bp1aw0a5nfff03xp1pcqc

The ID of the customer gateway.

IpAddress String 100.1.1.2

The IP address of the customer gateway.

Name String test

The name of the customer gateway.

Description String test

The description of the customer gateway.

CreateTime Long 1493363486000

The time at which the customer gateway was created.

RequestId String cgw-bp1aw0a5nfff03xp1pcqc

The ID of the request.

Examples

Request example


https://vpc.aliyuncs.com/?Action=CreateCustomerGateway
&IpAddress=116.62.222.xxx
&RegionId=cn-shanghai
&<CommonParameters>
Response example
  • XML format

    <CreateCustomerGatewayResponse>
      <CustomerGatewayId>cgw-bp1aw0a5nfff03xp1pcqc</CustomerGatewayId>
      <RequestId>185E81B1-3916-4667-B48F-C52409B33F2B</RequestId>
      <CreateTime>1493363486000</CreateTime>
      <IpAddress>100.1.1.2</IpAddress>
    </CreateCustomerGatewayResponse>
    
  • JSON format

    {
    	"CustomerGatewayId":"cgw-bp1jrawp82av6bws9h2ut",
    	"RequestId":"D32B3C26-6C6C-4988-93E9-D2A6444CE6AE",
    	"CreateTime":1493363599000,
    	"IpAddress":"100.1.1.2"
    }

Error codes

HTTP status code Error code Error message Description
403 Forbbiden.SubUser User not authorized to operate on the specified resource as your account is created by another user. You are not authorized to operate on this resource. Please apply for the permission and try again.
403 Forbidden User not authorized to operate on the specified resource. You are not authorized to operate on this resource. For more information, open a ticket.
400 InvalidIpAddress.AlreadyExist Specified IpAddress is already exist. The specified IP address already exists.
400 InvalidIpAddress.WrongFormat Specified IpAddress is invalid. The IP address is invalid.
400 InvalidName The name is not valid The name format is invalid.
400 InvalidDescription The description is not valid The description format is invalid.
400 Resource.QuotaFull The quota of resource is full The resource quota has been reached.

See common error codes