Updates a custom control policy.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
resourcemanager:UpdateControlPolicy |
update |
*ControlPolicy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| PolicyId |
string |
Yes |
The ID of the control policy. |
cp-jExXAqIYkwHN**** |
| NewPolicyName |
string |
No |
The new name of the control policy. The name must be 1 to 128 characters long. It must start with a letter and can contain only letters, digits, and hyphens (-). |
NewControlPolicy |
| NewDescription |
string |
No |
The new description of the control policy. The description must be 1 to 1,024 characters long. It must start with a letter and can contain only letters, digits, underscores (_), and hyphens (-). |
ExampleControlPolicy |
| NewPolicyDocument |
string |
No |
The new policy document. The policy document can be up to 4,096 characters long. For more information about the control policy language, see control policy language. For policy examples, see custom control policy examples. |
{"Version":"1","Statement":[{"Effect":"Deny","Action":["ram:UpdateRole","ram:DeleteRole","ram:AttachPolicyToRole","ram:DetachPolicyFromRole"],"Resource":"acs:ram:*:*:role/ResourceDirectoryAccountAccessRole"}]} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| ControlPolicy |
object |
The details of the control policy. |
|
| UpdateDate |
string |
The time when the control policy was last updated. |
2021-03-18T10:04:55Z |
| Description |
string |
The description of the control policy. |
ExampleControlPolicy |
| EffectScope |
string |
The scope of the control policy. Valid values:
|
RAM |
| AttachmentCount |
string |
The number of entities to which the control policy is attached. |
0 |
| PolicyName |
string |
The name of the control policy. |
NewControlPolicy |
| PolicyId |
string |
The ID of the control policy. |
cp-jExXAqIYkwHN**** |
| CreateDate |
string |
The time when the control policy was created. |
2021-03-18T09:24:19Z |
| PolicyType |
string |
The type of the control policy. Valid values:
|
Custom |
| ControlPolicyType |
string |
RESOURCE_CONTROL_POLICY |
|
| RequestId |
string |
The request ID. |
2DFCE4C9-04A9-4C83-BB14-FE791275EC53 |
Examples
Success response
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",
"ControlPolicyType": "RESOURCE_CONTROL_POLICY"
},
"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 can be up to 4,096 characters in length. |
| 404 | EntityNotExists.ResourceControlPolicy | The specified resource control policy does not exist. | |
| 409 | DeleteConflict.SystemResourceControlPolicy | The system resource control policy cannot be deleted. | |
| 409 | InvalidResourceControlPolicyEnablementStatus | The resource control policy enablement status is not valid to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.