Queries the objects to which a tag policy is attached.
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 object to which a tag policy is attached. The object is the current logon 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 objects to which a tag policy is attached. The objects include the Root folder, folders other than the Root folder, and members 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 objects to which the tag policy with an ID of p-de62a0bf400e4b69****
is attached. In this example, the Tag Policy feature in multi-account mode is used. The response shows that the tag policy is attached to two members in the related resource directory.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | No | The region ID. Set the value to cn-shanghai. | cn-shanghai |
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**** |
PolicyId | string | Yes | The ID of the tag policy. | p-de62a0bf400e4b69**** |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"Targets": [
{
"TargetId": "195320939469****",
"TargetType": 0
}
],
"RequestId": "2EE71C8D-6DB8-56AC-8B05-3D4C0116E6A1",
"IsRd": true,
"RdId": "rd-3G****",
"NextToken": "caeba0bbb2be03f84eb48b699f0a****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2023-12-08 | The internal configuration of the API is changed, but the call is not affected | see changesets | ||
|