调用DescribeCustomerGateways接口查询用户网关的信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeCustomerGateways | 系统规定参数。取值:DescribeCustomerGateways。 |
RegionId | String | 是 | cn-shanghai | 用户网关所属的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
CustomerGatewayId | String | 否 | cgw-bp1pvpl9r9adju6l5**** | 用户网关的实例ID。 说明 如果您不指定用户网关的实例ID,则系统默认查询当前地域下所有用户网关的信息。 |
PageNumber | Integer | 否 | 1 | 列表的页码。默认值:1。 |
PageSize | Integer | 否 | 10 | 分页查询时每页的条目数。最大值:50。默认值:10。 |
Tag.N.Key | String | 否 | TagKey | 标签键。一旦输入该值,则不允许为空字符串。 最多支持64个字符,不能以 一次最多支持输入20个标签键。 |
Tag.N.Value | String | 否 | TagValue | 标签值。 标签值最多支持128个字符,可以为空字符串,不能以 一个标签键对应一个标签值。一次最多支持输入20个标签值。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
PageSize | Integer | 10 | 分页查询时每页的条目数。 |
RequestId | String | E82612A9-CB90-4D7E-B394-1DB7F6509B29 | 请求ID。 |
PageNumber | Integer | 1 | 列表的页码。 |
TotalCount | Integer | 1 | 列表条目数。 |
CustomerGateways | Array of CustomerGateway | 用户网关信息列表。 |
|
CustomerGateway | |||
IpAddress | String | 139.32.XX.XX | 本地数据中心网关设备的公网IP地址。 |
Asn | Long | 65530 | 本地数据中心网关设备的自治系统号。 |
Description | String | desctest | 用户网关的描述信息。 |
CustomerGatewayId | String | cgw-bp1pvpl9r9adju6l5**** | 用户网关的实例ID。 |
CreateTime | Long | 1492747187000 | 创建用户网关的时间戳。单位:毫秒。 时间戳的格式采用Unix时间戳,表示从格林威治时间1970年01月01日00时00分00秒至创建用户网关时的总时长。 |
Name | String | nametest | 用户网关的名称。 |
AuthKey | String | AuthKey**** | 本地数据中心网关设备BGP路由协议的认证密钥。 |
Tags | Array of Tag | 用户网关绑定的标签列表。 |
|
Tag | |||
Key | String | TagKey | 标签键。 |
Value | String | TagValue | 标签值。 |
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeCustomerGateways
&RegionId=cn-shanghai
&CustomerGatewayId=cgw-bp1pvpl9r9adju6l5****
&PageNumber=1
&PageSize=10
&Tag=[{"Key":"TagKey","Value":"TagValue"}]
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeCustomerGatewaysResponse>
<PageSize>10</PageSize>
<RequestId>E82612A9-CB90-4D7E-B394-1DB7F6509B29</RequestId>
<PageNumber>1</PageNumber>
<TotalCount>1</TotalCount>
<CustomerGateways>
<IpAddress>139.32.XX.XX</IpAddress>
<Asn>65530</Asn>
<Description>desctest</Description>
<CustomerGatewayId>cgw-bp1pvpl9r9adju6l5****</CustomerGatewayId>
<CreateTime>1492747187000</CreateTime>
<Name>nametest</Name>
<AuthKey>AuthKey****</AuthKey>
<Tags>
<Key>TagKey</Key>
<Value>TagValue</Value>
</Tags>
</CustomerGateways>
</DescribeCustomerGatewaysResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"PageSize" : 10,
"RequestId" : "E82612A9-CB90-4D7E-B394-1DB7F6509B29",
"PageNumber" : 1,
"TotalCount" : 1,
"CustomerGateways" : [ {
"IpAddress" : "139.32.XX.XX",
"Asn" : 65530,
"Description" : "desctest",
"CustomerGatewayId" : "cgw-bp1pvpl9r9adju6l5****",
"CreateTime" : 1492747187000,
"Name" : "nametest",
"AuthKey" : "AuthKey****",
"Tags" : [ {
"Key" : "TagKey",
"Value" : "TagValue"
} ]
} ]
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Forbidden.TagKey.Duplicated | The specified tag key already exists. | 标签资源重复 |
400 | SizeLimitExceeded.TagNum | The maximum number of tags is exceeded. | 标签数量超限 |
400 | InvalidParameter.TagValue | The specified parameter TagValue is invalid. | 指定的参数TagValue不合规范。 |
400 | InvalidParameter.TagKey | The specified parameter TagKey is invalid. | 指定的参数TagKey不合规范。 |
400 | Duplicated.TagKey | The specified parameter TagKey is duplicated. | 指定的参数TagKey重复。 |
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. | 您没有权限操作指定资源,请申请权限后再操作。 |
访问错误中心查看更多错误码。