Queries the details of an access control policy.
This topic provides an example on how to call the API operation to query the details of the access control policy whose ID is cp-SImPt8GCEwiq****
.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetControlPolicy | The operation that you want to perform. Set the value to GetControlPolicy. |
PolicyId | String | Yes | cp-SImPt8GCEwiq**** | The ID of the access control policy. |
Language | String | No | zh-CN | The language in which you want to return the description of the access control policy. 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 |
---|---|---|---|
ControlPolicy | Object | The details of the access control policy. |
|
PolicyDocument | String | {\"Version\":\"1\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ram:UpdateRole\",\"ram:DeleteRole\",\"ram:AttachPolicyToRole\",\"ram:DetachPolicyFromRole\"],\"Resource\":\"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole\"}]} | The document of the access control policy. |
UpdateDate | String | 2021-03-18T08:51:33Z | The time when the access control policy was updated. |
Description | String | ExampleControlPolicy | The description of the access control policy. |
EffectScope | String | RAM | The effective scope of the access control policy. Valid values:
|
AttachmentCount | String | 0 | The number of times that the access control policy is referenced. |
PolicyName | String | test | The name of the access control policy. |
PolicyId | String | cp-SImPt8GCEwiq**** | The ID of the access control policy. |
CreateDate | String | 2021-03-18T08:51:33Z | The time when the access control policy was created. |
PolicyType | String | Custom | The type of the access control policy. Valid values:
|
RequestId | String | AB769936-CDFA-4D52-8CE2-A3581800044A | The ID of the request. |
Examples
Sample requests
https://resourcemanager.aliyuncs.com/?Action=GetControlPolicy
&PolicyId=cp-SImPt8GCEwiq****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<?xml version="1.0" encoding="UTF-8" ?>
<GetControlPolicyResponse>
<ControlPolicy>
<PolicyType>Custom</PolicyType>
<UpdateDate>2021-03-18T08:51:33Z</UpdateDate>
<Description>ExampleControlPolicy</Description>
<AttachmentCount>0</AttachmentCount>
<PolicyName>test</PolicyName>
<PolicyDocument>{"Version":"1","Statement":[{"Effect":"Deny","Action":["ram:UpdateRole","ram:DeleteRole","ram:AttachPolicyToRole","ram:DetachPolicyFromRole"],"Resource":"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole"}]}</PolicyDocument>
<CreateDate>2021-03-18T08:51:33Z</CreateDate>
<PolicyId>cp-SImPt8GCEwiq****</PolicyId>
<EffectScope>RAM</EffectScope>
</ControlPolicy>
<RequestId>AB769936-CDFA-4D52-8CE2-A3581800044A</RequestId>
</GetControlPolicyResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"ControlPolicy" : {
"PolicyType" : "Custom",
"UpdateDate" : "2021-03-18T08:51:33Z",
"Description" : "ExampleControlPolicy",
"AttachmentCount" : 0,
"PolicyName" : "test",
"PolicyDocument" : "{\"Version\":\"1\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ram:UpdateRole\",\"ram:DeleteRole\",\"ram:AttachPolicyToRole\",\"ram:DetachPolicyFromRole\"],\"Resource\":\"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole\"}]}",
"CreateDate" : "2021-03-18T08:51:33Z",
"PolicyId" : "cp-SImPt8GCEwiq****",
"EffectScope" : "RAM"
},
"RequestId" : "AB769936-CDFA-4D52-8CE2-A3581800044A"
}
Error codes
For a list of error codes, see Service error codes.