Modify Policy

Last Updated on : 2023-10-09 08:06:21download

Modify the information about the specified policy. Allow action rules and Deny action rules cannot both be empty.

API address

PUT: /v2.0/cloud/iam/policy/{policy_id}

Request parameter

Parameter nameTypeINRequiredDescription
policy_idLonguritrueThe ID of the specified policy.

Description of body

Parameter nameTypeINRequiredDescription
nameString trueThe name of the specified policy.
allow_actionList falseThe Allow action, which describes the specific actions allowed.
deny_actionList falseThe Deny action, which describes the specific actions denied.
descriptionString trueThe description of the specified policy.

Return parameter

Parameter nameTypeDescription
resultObjectThe modification result. Valid values:
  • true: Modified successfully.
  • false: Failed to modify it.
successBooleanIndicates whether the request is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
error_codeStringFor more information, see the error codes.
error_msgStringThe message that is returned if the request fails. It is empty if the request is successful.

Request example

PUT: v2.0/cloud/iam/policy/1
{
  "name": "Policy",
  "description": "Description information",
  "allow_action": [
    "*"
  ]
}

Return example

{
    "tid": "168679625111231687",
    "result": true,
    "t": 1686796251687,
    "success": true
}

Error code

For more information, see error code.