All Products
Search
Document Center

:UpdateControlPolicy

Last Updated:Jun 25, 2024

Updates a custom 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-jExXAqIYkwHN****
NewPolicyNamestringNo

The new name of the access control policy.

The name must be 1 to 128 characters in length. The name can contain letters, digits, and hyphens (-) and must start with a letter.

NewControlPolicy
NewDescriptionstringNo

The new description of the access control policy.

The description must be 1 to 1,024 characters in length. The description can contain letters, digits, underscores (_), and hyphens (-) and must start with a letter.

ExampleControlPolicy
NewPolicyDocumentstringNo

The new document of the access control policy.

The document can be a maximum of 4,096 characters in length.

For more information about the languages of access control policies, see Languages of access control policies.

For more information about the examples of access control policies, see Examples of custom access control policies.

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

Response parameters

ParameterTypeDescriptionExample
object

The returned result.

ControlPolicyobject

The details of the access control policy.

UpdateDatestring

The time when the access control policy was updated.

2021-03-18T10:04:55Z
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.

NewControlPolicy
PolicyIdstring

The ID of the access control policy.

cp-jExXAqIYkwHN****
CreateDatestring

The time when the access control policy was created.

2021-03-18T09:24:19Z
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.

2DFCE4C9-04A9-4C83-BB14-FE791275EC53

Examples

Sample success responses

JSONformat

{
  "ControlPolicy": {
    "UpdateDate": "2021-03-18T10:04:55Z",
    "Description": "ExampleControlPolicy",
    "EffectScope": "RAM",
    "AttachmentCount": "0",
    "PolicyName": "NewControlPolicy",
    "PolicyId": "cp-jExXAqIYkwHN****",
    "CreateDate": "2021-03-18T09:24:19Z",
    "PolicyType": "Custom"
  },
  "RequestId": "2DFCE4C9-04A9-4C83-BB14-FE791275EC53"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.NewPolicyDocument.LengthUnable to save your policy. A policy contains a maximum of 4096 characters.Failed to save the policy. The policy document can be up to 4,096 characters in length.

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

Change history

Change timeSummary of changesOperation
No change history