Modifies the configuration of a customer gateway.

Usage notes

  • When you call ModifyCustomerGatewayAttribute, if a value is assigned to AuthKey, the operation is asynchronous. After you call the operation, the information about the customer gateway is returned but the operation is still being performed in the system background. You can call DescribeVpnGateway to query the status of a customer gateway.
    • If a VPN gateway is in the updating state, the configurations are being modified.
    • If a VPN gateway is in the active state, the configurations have been modified.
  • When you call ModifyCustomerGatewayAttribute, if no value is assigned to AuthKey, the operation is synchronous.
  • You cannot repeatedly call ModifyCustomerGatewayAttribute to modify the configurations of a customer gateway within the specified period of time.

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 ModifyCustomerGatewayAttribute

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

RegionId String Yes cn-shanghai

The ID of the region where the NAT gateway is deployed.

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. ClientToken can contain only ASCII characters.

Note If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId may be different for each API request.
CustomerGatewayId String Yes cgw-bp1pvpl9r9adju6l5****

The ID of the customer gateway.

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://.

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 (?).

Response parameters

Parameter Type Example Description
RequestId String 8AA5CE21-2E6A-4530-BDF5-F055849476E6

The ID of the request.

IpAddress String 139.32.XX.XX

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

Description String desctest

The description of the customer gateway.

CustomerGatewayId String cgw-bp1pvpl9r9adju6l5****

The ID of the customer gateway.

CreateTime Long 1492747187000

The timestamp generated when the customer gateway was created.

Name String nametest

The name of the customer gateway.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyCustomerGatewayAttribute
&CustomerGatewayId=cgw-bp1pvpl9r9adju6l5****
&RegionId=cn-shanghai
&<Common request parameters>

Sample success responses

XML format

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

<ModifyCustomerGatewayAttributeResponse>
    <RequestId>8AA5CE21-2E6A-4530-BDF5-F055849476E6</RequestId>
    <IpAddress>139.32.XX.XX</IpAddress>
    <Description>desctest</Description>
    <CustomerGatewayId>cgw-bp1pvpl9r9adju6l5****</CustomerGatewayId>
    <CreateTime>1492747187000</CreateTime>
    <Name>nametest</Name>
</ModifyCustomerGatewayAttributeResponse>

JSON format

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

{
  "RequestId" : "8AA5CE21-2E6A-4530-BDF5-F055849476E6",
  "IpAddress" : "139.32.XX.XX",
  "Description" : "desctest",
  "CustomerGatewayId" : "cgw-bp1pvpl9r9adju6l5****",
  "CreateTime" : 1492747187000,
  "Name" : "nametest"
}

Error codes

HttpCode Error code Error message Description
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 format of the description 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 autonomous system number (ASN).
400 InvalidAuthkey.Malformed The specified BGP authentication key (%s) is malformed. The error message returned because the BGP authentication key is invalid.
400 OperationDenied.VpnFinancialLocked The associated VPN gateway is financially locked. You cannot update the attributes of the customer gateway. The error message returned because the VPN gateway associated with the customer gateway is locked due to overdue payments and you cannot modify the configuration of the customer gateway.
400 OperationDenied.VpnConfiguring The associated VPN gateway is being configured. You cannot update the attributes of the customer gateway. The error message returned because the VPN gateway associated with the customer gateway is being configured and you cannot modify the configuration of the customer gateway.
403 Forbbiden.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 perform this operation on the specified resource. Acquire the required permissions and try again.
404 InvalidCustomerGatewayInstanceId.NotFound The specified customer gateway instance id does not exist. The error message returned because the specified customer gateway instance does not exist. Check whether the ID of the customer gateway is valid.

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