All Products
Search
Document Center

Resource Management:GetControlPolicy

Last Updated:Jun 25, 2024

Queries the details of an access control policy.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
PolicyIdstringYes

The ID of the access control policy.

cp-SImPt8GCEwiq****
LanguagestringNo

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

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

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

ControlPolicyobject

The details of the access control policy.

PolicyDocumentstring

The document of the access control policy.

{\"Version\":\"1\",\"Statement\":[{\"Effect\":\"Deny\",\"Action\":[\"ram:UpdateRole\",\"ram:DeleteRole\",\"ram:AttachPolicyToRole\",\"ram:DetachPolicyFromRole\"],\"Resource\":\"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole\"}]}
UpdateDatestring

The time when the access control policy was updated.

2021-03-18T08:51:33Z
Descriptionstring

The description of the access control policy.

ExampleControlPolicy
EffectScopestring

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.
RAM
AttachmentCountstring

The number of times that the access control policy is referenced.

0
PolicyNamestring

The name of the access control policy.

test
PolicyIdstring

The ID of the access control policy.

cp-SImPt8GCEwiq****
CreateDatestring

The time when the access control policy was created.

2021-03-18T08:51:33Z
PolicyTypestring

The type of the access control policy. Valid values:

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

The ID of the request.

AB769936-CDFA-4D52-8CE2-A3581800044A

Examples

Sample success responses

JSONformat

{
  "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"
  },
  "RequestId": "AB769936-CDFA-4D52-8CE2-A3581800044A"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history