Queries the details of a control policy.
In this example, the details of the control policy cp-SImPt8GCEwiq****
are queried.
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 control policy. |
Language | String | No | zh-CN |
The language that is used to return the description of the control policy. Valid values:
|
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ControlPolicy | Struct |
The details of the control policy. |
|
AttachmentCount | String | 0 |
The number of times that the control policy is referenced. |
CreateDate | String | 2021-03-18T08:51:33Z |
The time when the policy was created. |
Description | String | ExampleControlPolicy |
The description of the control policy. |
EffectScope | String | RAM |
The effective scope of the control policy. Valid values:
|
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 control policy. |
PolicyId | String | cp-SImPt8GCEwiq**** |
The ID of the control policy. |
PolicyName | String | test |
The name of the control policy. |
PolicyType | String | Custom |
The type of the control policy. Valid values:
|
UpdateDate | String | 2021-03-18T08:51:33Z |
The time when the control policy was updated. |
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
<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
{
"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, visit the API Error Center.