Queries the objects to which a specific control policy is attached.

In this example, the folders or member accounts to which the control policy cp-jExXAqIYkwHN**** is attached are queried. The returned result shows that the control policy is attached to the folder fd-ZDNPiT****.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListTargetAttachmentsForControlPolicy

The operation that you want to perform. Set the value to ListTargetAttachmentsForControlPolicy.

PolicyId String Yes cp-jExXAqIYkwHN****

The ID of the control policy.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Valid values: 1 to 100. Default value: 10.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String B32BD3D6-1089-41F3-8E70-E0079BC7D760

The ID of the request.

TargetAttachments Array of TargetAttachment

The list of objects to which the control policy is attached.

TargetAttachment
AttachDate String 2021-03-19T02:56:24Z

The time when the control policy was attached to the object.

TargetId String fd-ZDNPiT****

The ID of the object.

TargetName String Dev_Department

The name of the object.

TargetType String Folder

The type of the object. Valid values:

  • Root: Root folder
  • Folder: child folder of the Root folder
  • Account: member account
TotalCount Integer 1

The total number of objects to which the control policy is attached.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=ListTargetAttachmentsForControlPolicy
&PolicyId=cp-jExXAqIYkwHN****
&<Common request parameters>

Sample success responses

XML format

<ListTargetAttachmentsForControlPolicyResponse>
	  <TotalCount>1</TotalCount>
	  <RequestId>B32BD3D6-1089-41F3-8E70-E0079BC7D760</RequestId>
	  <PageSize>10</PageSize>
	  <PageNumber>1</PageNumber>
	  <TargetAttachments>
		    <TargetAttachment>
			      <AttachDate>2021-03-19T02:56:24Z</AttachDate>
			      <TargetType>Folder</TargetType>
			      <TargetName>Dev_Department</TargetName>
			      <TargetId>fd-ZDNPiT****</TargetId>
		    </TargetAttachment>
	  </TargetAttachments>
</ListTargetAttachmentsForControlPolicyResponse>

JSON format

{
  "TotalCount": 1,
  "RequestId": "B32BD3D6-1089-41F3-8E70-E0079BC7D760",
  "PageSize": 10,
  "PageNumber": 1,
  "TargetAttachments": {
    "TargetAttachment": [
      {
        "AttachDate": "2021-03-19T02:56:24Z",
        "TargetType": "Folder",
        "TargetName": "Dev_Department",
        "TargetId": "fd-ZDNPiT****"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the API Error Center.