Obtains information about a RAM role.


Use API Explorer to perform debug operations and generate SDK code examples.

Request parameters

Parameter Type Required? Example value Description
Action String Yes GetRole

The name of this action.

Value: GetRole

RoleName String Yes ECSAdmin

The RAM role name. It must be 1 to 64 characters in length.

Pattern: ^[a-zA-Z0-9\.@\-]+$

Response parameters

Parameter Type Example value Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368 The request ID.
Role N/A N/A The information about the RAM role.
Arn String acs:ram::123456789012****:role/ECSAdmin The Alibaba Cloud Resource Name (ARN) of the RAM role.
AssumeRolePolicyDocument String { "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "RAM": "acs:ram::123456789012****:root" } } ], "Version": "1" } The policy text that specifies one or more entities entrusted to assume the RAM role.
CreateDate String 2015-01-23T12:33:18Z The date and time when the RAM role was created.
Description String ECS administrator The description of the RAM role.
RoleId String 901234567890**** The ID of the RAM role.
RoleName String ECSAdmin The name of the RAM role.
UpdateDate String 2015-01-23T12:33:18Z The date and time when the RAM role was modified.


Request example

&<Common parameters>

Response example

XML format

    <Description>ECS administrator</Description>
    <AssumeRolePolicyDocument>{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "RAM": "acs:ram::123456789012****:root" } } ], "Version": "1" }</AssumeRolePolicyDocument>

JSON format

        "Description":"ECS administrator",
        "AssumeRolePolicyDocument":"{ \"Statement\": [ { \"Action\": \"sts:AssumeRole\", \"Effect\": \"Allow\", \"Principal\": { \"RAM\": \"acs:ram::123456789012****:root\" } } ], \"Version\": \"1\" }",


For a list of error codes, visit the API Error Center.