UpdateRole

Last Updated: Aug 26, 2016

Interface description

 Updates a role.

Request parameters

Action

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

RoleName

  • Type: String
  • Required: Yes
  • Description: Role name. It consists of a maximum of 64 characters.
  • Format: ^[a-zA-Z0-9\.@\-]+$

NewAssumeRolePolicyDocument

  • Type: String
  • Required: No
  • Description: Specifies the identity of the role.

Required permissions

Action

ram:UpdateRole

Resource

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

Return parameters

Role

  • Type: [Role Type] (28748)
  • Description: Role information.

Error messages

InvalidParameter.RoleName.InvalidChars
  • HTTP Status:400
  • Error Message:The parameter - “RoleName” contains invalid chars.
InvalidParameter.RoleName.Length
  • HTTP Status:400
  • Error Message:The parameter - “RoleName” beyond the length limit.
InvalidParameter.NewAssumeRolePolicyDocument.Length
  • HTTP Status:400
  • Error Message:The parameter - “NewAssumeRolePolicyDocument” beyond the length limit.
EntityNotExist.Role
  • HTTP Status:404
  • Error Message:The role does not exist.
MalformedPolicyDocument
  • HTTP Status:400
  • Error Message:{The error details}

Operation examples

Request example

  1. https://ram.aliyuncs.com/?Action=UpdateRole
  2. &RoleName=ECSAdmin
  3. &NewAssumeRolePolicyDocument=xxxx //TODO
  4. &<Public request parameters>

Return example

XML format

  1. <UpdateRoleResponse>
  2. <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
  3. <Role>
  4. <RoleId>901234567890123</RoleId>
  5. <RoleName>ECSAdmin</RoleName>
  6. <Arn>acs:ram::1234567890123456:role/ECSAdmin</Arn>
  7. <Description>ECS Administrator role</Description>
  8. <AssumeRolePolicyDocument>{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "RAM": "acs:ram::123456789012345678:root" } } ], "Version": "1" }</AssumeRolePolicyDocument>
  9. <CreateDate>2015-01-23T12:33:18Z</CreateDate>
  10. <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
  11. </Role>
  12. </UpdateRoleResponse>

JSON format

  1. {
  2. "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
  3. "Role": {
  4. "RoleId": "901234567890123",
  5. "RoleName": "ECSAdmin",
  6. "Arn": "acs:ram::1234567890123456:role/ECSAdmin",
  7. "Description": "ECS Administrator role",
  8. "AssumeRolePolicyDocument": "{ \"Statement\": [ { \"Action\": \"sts:AssumeRole\", \"Effect\": \"Allow\", \"Principal\": { \"RAM\": \"acs:ram::123456789012345678:root\" } } ], \"Version\": \"1\" }",
  9. "CreateDate": "2015-01-23T12:33:18Z",
  10. "UpdateDate": "2015-01-23T12:33:18Z"
  11. }
  12. }
Thank you! We've received your feedback.