Queries the information of a RAM role.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetRole |
The operation that you want to perform. Set the value to GetRole. |
RoleName | String | Yes | ECSAdmin |
The name of the RAM role. The name must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). |
Language | String | No | zh-CN |
The language that is used to return the description of the RAM role. Valid values:
|
Response parameters
Examples
Sample requests
https://resourcemanager.aliyuncs.com/?Action=GetRole
&RoleName=ECSAdmin
&<Common request parameters>
Sample success responses
XML
format
<GetRoleResponse>
<RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
<Role>
<RoleId>90123456789****</RoleId>
<RoleName>ECSAdmin</RoleName>
<RolePrincipalName>ECSAdmin@role.123456.onaliyunservice.com</RolePrincipalName>
<Arn>acs:ram::123456789012****:role/ECSAdmin</Arn>
<IsServiceLinkedRole>true</IsServiceLinkedRole>
<LatestDeletionTask>
<CreateDate>2018-10-23T12:33:18Z</CreateDate>
<DeletionTaskId>ECSAdmin/cc61514b-26eb-4453-ab53-b142eb702a3d</DeletionTaskId>
</LatestDeletionTask>
<Description>ECS administrator</Description>
<MaxSessionDuration>3600</MaxSessionDuration>
<AssumeRolePolicyDocument>{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "RAM": "acs:ram::12345678901234****:root" } } ], "Version": "1" }</AssumeRolePolicyDocument>
<CreateDate>2015-01-23T12:33:18Z</CreateDate>
<UpdateDate>2016-01-23T12:33:18Z</UpdateDate>
</Role>
</GetRoleResponse>
JSON
format
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
"Role": {
"RoleId": "90123456789****",
"RoleName": "ECSAdmin",
"RolePrincipalName": "ECSAdmin@role.123456.onaliyunservice.com",
"Arn": "acs:ram::123456789012****:role/ECSAdmin",
"IsServiceLinkedRole": true,
"LatestDeletionTask": {
"CreateDate": "2018-10-23T12:33:18Z",
"DeletionTaskId": "ECSAdmin/cc61514b-26eb-4453-ab53-b142eb702a3d"
},
"Description": "ECS administrator",
"MaxSessionDuration": 3600,
"AssumeRolePolicyDocument": "{ \"Statement\": [ { \"Action\": \"sts:AssumeRole\", \"Effect\": \"Allow\", \"Principal\": { \"RAM\": \"acs:ram::12345678901234****:root\" } } ], \"Version\": \"1\" }",
"CreateDate": "2015-01-23T12:33:18Z",
"UpdateDate": "2016-01-23T12:33:18Z"
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter.RoleName.InvalidChars | The specified role name contains invalid characters. | The error message returned because the RAM role name contains invalid characters. |
400 | InvalidParameter.RoleName.Length | The maximum length of the role name is exceeded. | The error message returned because the length of the RAM role name has exceeded the upper limit. |
404 | EntityNotExist.Role | The role does not exist. | The error message returned because the RAM role does not exist. |
For a list of error codes, visit the API Error Center.