DeleteRole

Last Updated: Nov 10, 2017

Interface description

Deletes a specified role.

Request parameters

Action

  • Type: String
  • Required: Yes
  • Description: Operation interface, required. The parameter value is “DeleteRole”.

RoleName

  • Type: String
  • Required: Yes
  • Description: Role name.

Return parameters

Only public parameters are returned. For details, see Public return parameters.

Required permissions

Action

ram:DeleteRole

Resource

acs:ram:*:${AccountId}:role/${RoleName}

Error messages

InvalidParameter.RoleName.InvalidChars
  • HTTP Status: 400
  • Error Message: The parameter - “RoleNam” contains invalid chars.
InvalidParameter.RoleName.Length
  • HTTP Status: 400
  • Error Message: The parameter - “RoleName” beyond the length limit.
EntityNotExist.Role
  • HTTP Status: 404
  • Error Message: The role does not exist.
DeleteConflict.Role.Policy
  • HTTP Status: 409
  • Error Message: The role CAN NOT has any attached policy while deleting the role.

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=DeleteRole
  2. &RoleName=ECSAdmin
  3. &<Public request parameters>

Return example

XML format

  1. <DeleteRoleResponse>
  2. <RequestId>898FAB24-7509-43EE-A287-086FE4C44394</RequestId>
  3. </DeleteRoleResponse>

JSON format

  1. {
  2. "RequestId": "898FAB24-7509-43EE-A287-086FE4C44394"
  3. }
Thank you! We've received your feedback.