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
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:
|
Language | String | No | zh-CN | The language in which you want to return the descriptions of the access control policies. Valid values:
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:
|
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:
|
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.