调用CreateCustomerGateway接口创建用户网关。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateCustomerGateway | 系统规定参数。取值:CreateCustomerGateway。 |
RegionId | String | 是 | cn-shanghai | 用户网关所在的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
ClientToken | String | 否 | 02fb3da4-130e-11e9-8e44**** | 客户端Token,用于保证请求的幂等性。 由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过64个ASCII字符。 说明 若您未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId不一样。 |
IpAddress | String | 是 | 101.12.XX.XX | 本地数据中心网关设备的公网IP地址。 |
Name | String | 否 | nametest | 用户网关的名称。 名称长度为1~100个字符,不能以 |
Description | String | 否 | desctest | 用户网关的描述信息。 描述信息长度为1~100个字符,不能以 |
Asn | String | 否 | 65530 | 本地数据中心网关设备的自治系统号。 Asn是一个4字节的号码,支持按照两段位的格式进行输入,即:前16位比特.后16位比特。每个段位使用十进制输入。 例如输入123.456,则表示自治系统号:123*65536+456=8061384。 |
AuthKey | String | 否 | AuthKey**** | 本地数据中心网关设备BGP路由协议的认证密钥。 密钥长度为1~64个字符,只支持ASCII字符,不支持空格、中文和半角问号(?)。 |
Tags.N.Key | String | 否 | TagKey | 标签键。一旦输入该值,则不允许为空字符串。 最多支持64个字符,不能以 一次最多支持输入20个标签键。 |
Tags.N.Value | String | 否 | TagValue | 标签值。 标签值最多支持128个字符,可以为空字符串,不能以 一个标签键对应一个标签值。一次最多支持输入20个标签值。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | D32B3C26-6C6C-4988-93E9-D2A6444CE6AE | 请求ID。 |
IpAddress | String | 101.12.XX.XX | 本地数据中心网关设备的公网IP地址。 |
Description | String | desctest | 用户网关的描述信息。 |
CustomerGatewayId | String | cgw-bp1jrawp82av6bws9**** | 用户网关的实例ID。 |
CreateTime | Long | 1493363486000 | 创建用户网关的时间戳。单位:毫秒。 时间戳的格式采用Unix时间戳,表示从格林威治时间1970年01月01日00时00分00秒至创建用户网关时的总时长。 |
Name | String | nametest | 用户网关的名称。 |
示例
请求示例
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"}]
&公共请求参数
正常返回示例
XML
格式
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
格式
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"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | InvalidAuthkey.Malformed | The specified BGP authentication key (%s) is malformed. | 该BGP认证密钥不合法。 |
400 | InvalidIpAddress.AlreadyExist | Specified IpAddress is already exist. | 该IP地址已经存在。原因是同一个用户在同一个地域内,IP地址不可重复。 |
400 | InvalidIpAddress.WrongFormat | Specified IpAddress is invalid. | 该IP不合法。 |
400 | InvalidName | The name is not valid | 该名称格式不合法。 |
400 | InvalidDescription | The description is not valid | 描述格式不合法。 |
400 | Resource.QuotaFull | The quota of resource is full | 资源配额已达上限。 |
400 | IllegalParam.Asn | The specified Asn is invalid. | 指定的Asn不合规范。 |
400 | OperationDenied.MissingAsn | The autonomous system number of the customer gateway is mandatory when BGP authentication key is specified. | 当指定了用户网关的BGP验证密钥时,必须指定自治系统号。 |
400 | InvalidParameter.TagValue | The specified parameter TagValue is invalid. | 指定的参数TagValue不合规范。 |
400 | SizeLimitExceeded.TagNum | The maximum number of tags is exceeded. | 标签数量超限 |
400 | Forbidden.TagKey.Duplicated | The specified tag key already exists. | 标签资源重复 |
400 | InvalidParameter.TagKey | The specified parameter TagKey is invalid. | 指定的参数TagKey不合规范。 |
400 | Duplicated.TagKey | The specified parameter TagKey is duplicated. | 指定的参数TagKey重复。 |
403 | Forbidden.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. | 您没有权限操作指定资源,请申请权限后再操作。 |
409 | OperationConflict | The operation against this instance is too frequent, please try again later. | 对该实例的操作过于频繁,请稍后重试。 |
访问错误中心查看更多错误码。