Updates a custom access control policy.
Operation description
In this example, the name of the access control policy whose ID is cp-jExXAqIYkwHN****
is changed to NewControlPolicy
.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
resourcemanager:UpdateControlPolicy | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PolicyId | string | Yes | The ID of the access control policy. | cp-jExXAqIYkwHN**** |
NewPolicyName | string | No | 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 |
NewDescription | string | No | 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 |
NewPolicyDocument | string | No | 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"}]} |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"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 code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter.NewPolicyDocument.Length | Unable to save your policy. A policy contains a maximum of 4096 characters. | Failed to save the policy. The policy document cannot exceed 4,096 characters in length. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|