调用CreateCustomerGateway接口创建用户网关。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
vpc:CreateCustomerGateway |
create |
*CustomerGateway
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
用户网关所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-shanghai |
| ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 由客户端生成该参数值,要保证在不同请求间唯一,最大值不超过 64 个 ASCII 字符。 说明
若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 不一样。 |
02fb3da4-130e-11e9-8e44**** |
| IpAddress |
string |
是 |
输入本地数据中心网关设备的静态 IP 地址。
不支持使用以下 IP 地址,否则无法建立 IPsec-VPN 连接:
|
101.12.XX.XX |
| Name |
string |
否 |
用户网关的名称。 名称长度为 1~100 个字符,不能以 |
nametest |
| Description |
string |
否 |
用户网关的描述信息。 描述信息长度为 1~100 个字符,不能以 |
desctest |
| Asn |
string |
否 |
如果 IPsec-VPN 连接计划启用 BGP 动态路由协议,则需要配置本地数据中心网关设备的自治系统号 ASN(Autonomous System Number)。自治系统号取值范围:1~4294967295,不支持使用 45104。 Asn 是一个 4 字节的号码,支持按照两段位的格式进行输入,即:前 16 位比特.后 16 位比特。每个段位使用十进制输入。 例如输入 123.456,则表示自治系统号:123*65536+456=8061384。 说明
|
65530 |
| AuthKey |
string |
否 |
本地数据中心网关设备 BGP 路由协议的认证密钥。 密钥长度为 1~64 个字符,只支持 ASCII 字符,不支持空格、中文和半角问号(?)。 |
AuthKey**** |
| Tags |
array<object> |
否 |
用户网关待添加的标签列表。 一次最多支持为用户网关添加 20 个标签。 |
|
|
object |
否 |
标签信息。 |
||
| Key |
string |
否 |
标签键。一旦输入该值,则不允许为空字符串。 最多支持 64 个字符,不能以 一次最多支持输入 20 个标签键。 |
TagKey |
| Value |
string |
否 |
标签值。 标签值最多支持 128 个字符,可以为空字符串,不能以 一个标签键对应一个标签值。一次最多支持输入 20 个标签值。 |
TagValue |
| ResourceGroupId |
string |
否 |
用户网关所属的资源组 ID。
|
rg-aek2qo2h4jy**** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果 |
||
| RequestId |
string |
请求 ID。 |
D32B3C26-6C6C-4988-93E9-D2A6444CE6AE |
| IpAddress |
string |
本地数据中心网关设备的静态 IP 地址。 |
101.12.XX.XX |
| Description |
string |
用户网关的描述信息。 |
desctest |
| CustomerGatewayId |
string |
用户网关的实例 ID。 |
cgw-bp1jrawp82av6bws9**** |
| CreateTime |
integer |
创建用户网关的时间戳。单位:毫秒。 时间戳的格式采用 Unix 时间戳,表示从格林威治时间 1970 年 01 月 01 日 00 时 00 分 00 秒至创建用户网关时的总时长。 |
1493363486000 |
| Name |
string |
用户网关的名称。 |
nametest |
示例
正常返回示例
JSON格式
{
"RequestId": "D32B3C26-6C6C-4988-93E9-D2A6444CE6AE",
"IpAddress": "101.12.XX.XX",
"Description": "desctest",
"CustomerGatewayId": "cgw-bp1jrawp82av6bws9****",
"CreateTime": 1493363486000,
"Name": "nametest"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 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. | |
| 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重复。 |
| 400 | OperationFailed.NoRamPermission | Vpn Service has no permission to operate your IDaaS instances. | Vpn服务没有权限操作您的IDaaS实例 |
| 400 | CreateVpnUserGatewayQuotaFull.QuotaFull | The number of created VPN customer gateways exceeds the quota. | 创建VPN用户网关数量超出配额。 |
| 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. | 对该实例的操作过于频繁,请稍后重试。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。