Skip to main content

ListTagResources

Description

call ListTagResources to query the list of tags bound to one or more ECS resources.

Request Method

POST

Request Path

/apsara/route/Ecs/ListTagResources

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
Tag.N.KeyBODYstringNoFinanceDeptKeythe tag key used to accurately find ECS resources. The value range of the tag key length is 1 to 128. The value range of n is 1~20. Tag.N is used to accurately find ECS resources bound to the specified tag and consists of a key-value pair. only specify tag. N.Key, returns all resources associated with the tag key. only specify Tag.N.Value, error InvalidParameter.TagValue. When multiple label key-value pairs are specified at the same time, only ECS resources that meet all label key-value pairs at the same time will be found.
ResourceId.NBODYrepeatlistNoi-bp1j6qtvdm8w0z1o0***ECS resource ID. Value range of n: 1~50
NextTokenBODYstringNocaeba0bbb2be03f84eb48b699f0a4883The next query starts Token.
regionIdBODYstringYesNo sample value for this parameter.region id
Tag.N.ValueBODYstringNoFinanceDeptValuethe tag value used to accurately find ECS resources. The value range of the label value length is 1 to 128. Value range of n: 1~20
ResourceTypeBODYstringYesinstanceresource type. Value range: instance:ECS instance disk: block storage snapshot: snapshot image: mirror securitygroup: security group volume: storage volume eni: ENI ddh: dedicated host keypair:SSH key pair
TagFilter.N.TagKeyBODYstringYesenvFuzzy tag key used to find ECS resources. The value range of the tag key length is 1 to 128. The value range of n: 1~5 TagFilter.N is used to vaguely find ECS resources bound to the specified tag, consists of a key and one or more values. Fuzzy queries may have a delay of 2 seconds, and only the number of resources after fuzzy filtering is less than or equal to 5000. fuzzy search through tag key (TagFilter. n. tagkey ) when ECS resources, label value (TagFilter.N.TagValues.N) must be empty. For example, when fuzzy search for ECS resources with tag key environment,TagFilter. 1.TagKey can be set to env, and TagFilter. 1.TagValues must be empty. pass the label value (TagFilter.N.TagValues.N) when fuzzy searching ECS resources, the tag key (TagFilter.N.TagKey) must be set to an exact value. For example, the fuzzy search tag key is env, when the label value is when product ECS resources,TagFilter. 1. tagkey must be precisely set to env,TagFilter. 1.TagValues.1 can be set to proc. there is an intersection between tag keys, that is, only ECS resources that meet all tag keys specified by you will be found. the tag values under the same tag key are combined, that is, ECS resources that meet any tag value you specify for the tag key will be found. description TagFilter.N and tag. N parameters cannot be used at the same time, otherwise, an error message will be returned.
RegionIdBODYstringYescn-qingdao-env17-d01the region ID to which the resource belongs. You can call the DescribeRegions to view the latest Alibaba Cloud region list.
TagFilter.N.TagValues.NBODYrepeatlistNoproductthe tag value used when searching ECS resources. The value range of the label value length is 1 to 128. Value range of n: 1~5
versionBODYstringNo2016-01-01version of api

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}