Gets the details of a control policy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcemanager:GetControlPolicy |
get |
*ControlPolicy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PolicyId |
string |
Yes |
The ID of the control policy. |
cp-SImPt8GCEwiq**** |
| Language |
string |
No |
The language of the returned control policy description. Valid values:
Note
This parameter is valid only for system control policies. |
zh-CN |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The returned data. |
||
| ControlPolicy |
object |
The details of the control policy. |
|
| PolicyDocument |
string |
The content of the control policy. |
{\"Version\":\"1\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ram:UpdateRole\",\"ram:DeleteRole\",\"ram:AttachPolicyToRole\",\"ram:DetachPolicyFromRole\"],\"Resource\":\"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole\"}]} |
| UpdateDate |
string |
The time the control policy was last updated. |
2021-03-18T08:51:33Z |
| Description |
string |
The description of the control policy. |
ExampleControlPolicy |
| EffectScope |
string |
The effective scope of the control policy. Valid values:
|
RAM |
| AttachmentCount |
string |
The number of attachments. |
0 |
| PolicyName |
string |
The name of the control policy. |
test |
| PolicyId |
string |
The ID of the control policy. |
cp-SImPt8GCEwiq**** |
| CreateDate |
string |
The time the control policy was created. |
2021-03-18T08:51:33Z |
| PolicyType |
string |
The type of the control policy. Valid values:
|
Custom |
| ControlPolicyType |
string |
RESOURCE_CONTROL_POLICY |
|
| RequestId |
string |
The ID of the request. |
AB769936-CDFA-4D52-8CE2-A3581800044A |
Examples
Success response
JSON format
{
"ControlPolicy": {
"PolicyDocument": "{\\\"Version\\\":\\\"1\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Deny\\\",\\\"Action\\\":[\\\"ram:UpdateRole\\\",\\\"ram:DeleteRole\\\",\\\"ram:AttachPolicyToRole\\\",\\\"ram:DetachPolicyFromRole\\\"],\\\"Resource\\\":\\\"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole\\\"}]}",
"UpdateDate": "2021-03-18T08:51:33Z",
"Description": "ExampleControlPolicy",
"EffectScope": "RAM",
"AttachmentCount": "0",
"PolicyName": "test",
"PolicyId": "cp-SImPt8GCEwiq****",
"CreateDate": "2021-03-18T08:51:33Z",
"PolicyType": "Custom",
"ControlPolicyType": "RESOURCE_CONTROL_POLICY"
},
"RequestId": "AB769936-CDFA-4D52-8CE2-A3581800044A"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 404 | EntityNotExists.ResourceControlPolicy | The specified resource control policy does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.