调用DescribeTagKeys接口返回标签键。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
ResourceType | String | 否 | VPC | 资源类型,取值:
说明 输入的资源类型取值不区分大小写。 |
Keyword | String | 否 | keyword | 标签键。 |
RegionId | String | 是 | cn-hangzhou | 资源所属的地域ID。 您可以通过调用DescribeRegions接口获取地域ID。 |
NextToken | String | 否 | FFmyTO70tTpLG6I3FmYAXGKPd**** | 是否拥有下一次查询的令牌(Token)。取值:
|
MaxResult | Integer | 否 | 50 | 分页大小,取值范围:1~50,默认值:50。 |
Action | String | 是 | DescribeTagKeys | 系统规定参数。取值:DescribeTagKeys。 |
ResourceId.N | String | 否 | vpc-bp16qjewdsunr41m1**** | 资源ID。最多支持输入50个资源ID。 说明 当输入该参数时,必须输入ResourceType参数。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
NextToken | String | FFmyTO70tTpLG6I3FmYAXGKPd**** | 是否拥有下一次查询的令牌(Token)。取值:
|
RequestId | String | DE65F6B7-7566-4802-9007-96F2494AC512 | 请求ID。 |
TagKeys | Array of TagKey | 标签键集合。 |
|
TagKey | |||
Type | String | Custom | 标签键的类型。取值:
|
TagKey | String | FinanceDept | 标签键。 |
示例
请求示例
http(s)://[Endpoint]/?ResourceType=VPC
&Keyword=keyword
&RegionId=cn-hangzhou
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResult=50
&Action=DescribeTagKeys
&ResourceId=["vpc-bp16qjewdsunr41m1****"]
&公共请求参数
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeTagKeysResponse>
<NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
<RequestId>DE65F6B7-7566-4802-9007-96F2494AC512</RequestId>
<TagKeys>
<Type>Custom</Type>
<TagKey>FinanceDept</TagKey>
</TagKeys>
</DescribeTagKeysResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
"RequestId" : "DE65F6B7-7566-4802-9007-96F2494AC512",
"TagKeys" : [ {
"Type" : "Custom",
"TagKey" : "FinanceDept"
} ]
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | BothEmpty.TagsAndResources | The specified Tags and ResourcesIds are not allow to both empty. | 标签和资源组不能同时为空 |
400 | MissingParameter.TagKey | The input parameter TagKey that is mandatory for processing this request is not supplied. | 缺少参数TagKey |
400 | MissingParameter.TagValue | The input parameter TagValue that is mandatory for processing this request is not supplied. | 缺少参数TagValue |
400 | InvalidTagKey | The tag keys are not valid. | 无效的标签索引 |
400 | InvalidTagValue | The tag values are not valid. | 无效的标签值 |
400 | InvalidInstanceType.NotFound | The instance type is not found | 实例类型没有找到 |
400 | InvalidInstanceIds.NotFound | The instanceIds are not found | 实例ID没有找到 |
400 | Forbidden.TagKeys | The request do not allow to operate the tag keys | 没有权限操作TagKeys |
400 | QuotaExceeded.TagNum | Custom Tags quota exceeded | quota超限 |
400 | Forbidden.NotAllowedCategary | The System tag is not valid | 系统tag无效 |
400 | Forbidden.TagKeys | The request does not allow operate this tagkeys | 该请求不允许操作此 tagkey |
400 | Forbidden.TagKey.Duplicated | The specified tag key already exists. | 标签资源重复 |
400 | SizeLimitExceeded.TagNum | The maximum number of tags is exceeded. | 标签数量超限 |
400 | SizeLimitExceeded.ResourceId | The maximum number of resource IDs is exceeded. | 资源组ID数目超限 |
403 | Forbidden | User not authorized to operate on the specified resource. | 您没有权限操作指定资源,请申请权限后再操作。 |
访问错误中心查看更多错误码。