Queries a list of tag detection tasks for an object.
Operation description
If you use the Tag Policy feature in single-account mode, you can use the current logon account to call this API operation to query the tag detection tasks for the account. If you use the Tag Policy feature in multi-account mode, you can use the management account of a resource directory to call this API operation to query the tag detection tasks for the Root folder, a folder other than the Root folder, or a member in the resource directory. For more information about the modes of the Tag Policy feature, see Modes of the Tag Policy feature.
This topic provides an example on how to call the API operation to query the tag detection tasks for the current logon account. In this example, the Tag Policy feature in single-account mode is used. The response shows that only one tag detection task exists.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | No | The region ID. Set the value to cn-shanghai. | cn-shanghai |
TargetId | string | No | The ID of the object. This parameter specifies a filter condition for the query. | 134254031178**** |
MaxResult | integer | No | The number of entries to return on each page. Default value: 50. Maximum value: 1000. | 50 |
NextToken | string | No | The token that is used to start the next query. | caeba0bbb2be03f84eb48b699f0a**** |
TagKey | string | No | The tag key. This parameter specifies a filter condition for the query. | CostCenter |
TargetType | string | No | The type of the object. This parameter specifies a filter condition for the query. Valid values:
Note
The value of this parameter is not case-sensitive.
| ACCOUNT |
PolicyType | string | No | The use scenario of the tag policy. This parameter specifies a filter condition for the query. Valid values:
| tags |
UserType | string | No | The mode of the Tag Policy feature. This parameter specifies a filter condition for the query. Valid values:
For more information about the modes of the Tag Policy feature, see Modes of the Tag Policy feature. Note
The value of this parameter is not case-sensitive.
| USER |
Response parameters
Examples
Sample success responses
JSON
format
{
"Data": [
{
"TargetId": "134254031178****",
"TargetType": "USER",
"ConfigRuleId": "cr-0lb4866180880069****",
"AggregatorId": "ca-efdc33dc9b37002d****",
"TagKey": "CostCenter",
"Remediation": false,
"PolicyType": "tags",
"TagValue": "Project"
}
],
"RequestId": "7126AECD-D7AD-5073-8E88-DD2BD1FC139E",
"NextToken": "caeba0bbb2be03f84eb48b699f0a****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2023-09-01 | The response structure of the API has changed | see changesets | ||
|