Queries the access control policies that are attached to a folder or member.

This topic provides an example on how to call the API operation to query the access control policies that are 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 ListControlPolicyAttachmentsForTarget

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

TargetId String Yes fd-ZDNPiT****

The ID of the object whose access control policies you want to query. Access control policies can be attached to the following objects:

  • Root folder
  • Subfolders of the Root folder
  • Members
Language String No zh-CN

The language in which you want to return the descriptions of the access control policies. Valid values:

  • zh-CN (default value): Chinese
  • en: English
  • ja: Japanese
Note This parameter is valid only for system access control policies.

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

Response parameters

Parameter Type Example Description
RequestId String C276B600-7B7A-49E8-938C-E16CFA955A82

The ID of the request.

ControlPolicyAttachments Array of ControlPolicyAttachment

The attached access control policies.

ControlPolicyAttachment
Description String ExampleControlPolicy

The description of the access control policy.

EffectScope String RAM

The effective scope of the access control policy. Valid values:

  • All: The access control policy is in effect for Alibaba Cloud accounts, RAM users, and RAM roles.
  • RAM: The access control policy is in effect only for RAM users and RAM roles.
PolicyName String ExampleControlPolicy

The name of the access control policy.

PolicyId String cp-jExXAqIYkwHN****

The ID of the access control policy.

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

The time when the access control policy was attached.

PolicyType String Custom

The type of the access control policy. Valid values:

  • System: system access control policy
  • Custom: custom access control policy

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=ListControlPolicyAttachmentsForTarget
&TargetId=fd-ZDNPiT****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<ListControlPolicyAttachmentsForTargetResponse>
	<RequestId>C276B600-7B7A-49E8-938C-E16CFA955A82</RequestId>
	<ControlPolicyAttachments>
		<ControlPolicyAttachment>
			<PolicyType>System</PolicyType>
			<Description>System access control policy available for all operations on the cloud</Description>
			<AttachDate>2021-03-18T07:27:59Z</AttachDate>
			<PolicyName>FullAliyunAccess</PolicyName>
			<PolicyId>cp-FullAliyunAccess</PolicyId>
		</ControlPolicyAttachment>
		<ControlPolicyAttachment>
			<PolicyType>Custom</PolicyType>
			<Description>ExampleControlPolicy</Description>
			<AttachDate>2021-03-19T02:56:24Z</AttachDate>
			<PolicyName>ExampleControlPolicy</PolicyName>
			<PolicyId>cp-jExXAqIYkwHN****</PolicyId>
		</ControlPolicyAttachment>
	</ControlPolicyAttachments>
</ListControlPolicyAttachmentsForTargetResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "C276B600-7B7A-49E8-938C-E16CFA955A82",
  "ControlPolicyAttachments" : {
    "ControlPolicyAttachment" : [ {
      "PolicyType" : "System",
      "Description": "System access control policy available for all operations on the cloud",
      "AttachDate" : "2021-03-18T07:27:59Z",
      "PolicyName" : "FullAliyunAccess",
      "PolicyId" : "cp-FullAliyunAccess"
    }, {
      "PolicyType" : "Custom",
      "Description" : "ExampleControlPolicy",
      "AttachDate" : "2021-03-19T02:56:24Z",
      "PolicyName" : "ExampleControlPolicy",
      "PolicyId" : "cp-jExXAqIYkwHN****"
    } ]
  }
}

Error codes

HTTP status code Error code Error message Description
404 EntityNotExists.Target The specified target does not exist in the resource directory. The error message returned because the specified object does not exist in the resource directory.

For a list of error codes, see Service error codes.