调用ModifyCustomerGatewayAttribute接口修改用户网关的配置。
使用说明
- 调用ModifyCustomerGatewayAttribute接口时,如果参数AuthKey不为空时,该接口为异步接口,即系统先返回用户网关的信息,但该用户网关的配置尚未修改成功,系统后台的修改任务仍在进行。您可以调用DescribeVpnGateway查询用户网关的配置的修改状态:
- 当VPN网关实例处于updating状态时,表示用户网关的配置正在修改中。
- 当VPN网关实例处于active状态时,表示用户网关的配置修改成功。
- 调用ModifyCustomerGatewayAttribute接口时,如果参数AuthKey为空时,该接口为同步接口。
- ModifyCustomerGatewayAttribute接口不支持并发修改同一个用户网关的配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ModifyCustomerGatewayAttribute |
系统规定参数。取值:ModifyCustomerGatewayAttribute。 |
RegionId | String | 是 | cn-shanghai |
用户网关所属的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
ClientToken | String | 否 | 02fb3da4-130e-11e9-8e44**** |
客户端Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken只支持ASCII字符。 说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。
|
CustomerGatewayId | String | 是 | cgw-bp1pvpl9r9adju6l5**** |
用户网关的实例ID。 |
Name | String | 否 | nametest |
用户网关的名称。 名称长度为1~100个字符,不能以 |
Description | String | 否 | desctest |
用户网关的描述信息。 描述信息长度为1~100个字符,不能以 |
AuthKey | String | 否 | AuthKey**** |
本地数据中心网关设备BGP路由协议的认证密钥。 密钥长度为1~64个字符,只支持ASCII字符,不支持空格、中文和半角问号(?)。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 8AA5CE21-2E6A-4530-BDF5-F055849476E6 |
请求ID。 |
IpAddress | String | 139.32.XX.XX |
本地数据中心网关设备的公网IP地址。 |
Description | String | desctest |
用户网关的描述信息。 |
CustomerGatewayId | String | cgw-bp1pvpl9r9adju6l5**** |
用户网关的实例ID。 |
CreateTime | Long | 1492747187000 |
创建用户网关的时间戳。 |
Name | String | nametest |
用户网关的名称。 |
示例
请求示例
http(s)://[Endpoint]/?Action=ModifyCustomerGatewayAttribute
&CustomerGatewayId=cgw-bp1pvpl9r9adju6l5****
&RegionId=cn-shanghai
&<公共请求参数>
正常返回示例
XML
格式
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
格式
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"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidName | The name is not valid | 该名称格式不合法。 |
400 | InvalidDescription | The description is not valid | 描述格式不合法。 |
400 | OperationDenied.MissingAsn | The autonomous system number of the customer gateway is mandatory when BGP authentication key is specified. | 当指定了用户网关的BGP验证密钥时,必须指定自治系统号。 |
400 | InvalidAuthkey.Malformed | The specified BGP authentication key (%s) is malformed. | 该BGP认证密钥不合法。 |
400 | OperationDenied.VpnFinancialLocked | The associated VPN gateway is financially locked. You cannot update the attributes of the customer gateway. | 关联的VPN网关已经欠费锁定,无法修改用户网关的相关配置。 |
400 | OperationDenied.VpnConfiguring | The associated VPN gateway is being configured. You cannot update the attributes of the customer gateway. | 关联的VPN网关正在配置中,无法修改用户网关的相关配置。 |
403 | Forbbiden.SubUser | User not authorized to operate on the specified resource as your account is created by another user. | 您没有权限操作该资源,请您申请操作权限后再试。 |
403 | Forbidden | User not authorized to operate on the specified resource. | 您没有权限操作指定资源,请申请权限后再操作。 |
404 | InvalidCustomerGatewayInstanceId.NotFound | The specified customer gateway instance id does not exist. | 指定的用户网关实例不存在,请您检查用户网关实例ID是否正确。 |
访问错误中心查看更多错误码。