Queries the list of all RAM roles.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListRoles

The operation that you want to perform. Set the value to ListRoles.

Marker String No EXAMPLE

The marker. If part of a previous response is truncated, you can use this parameter to obtain the truncated part.

MaxItems Integer No 100

The number of entries to return. If a response is truncated because it reaches the value of MaxItems, the value of IsTruncated will be true.

Valid values: 1 to 1000. Default value: 100.

Response parameters

Parameter Type Example Description
IsTruncated Boolean true

Indicates whether the response is truncated.

Marker String EXAMPLE

The marker. This parameter is returned only if the value of IsTruncated is true. If the value is true, you can call this operation again and set the Marker parameter to obtain the truncated part.

RequestId String 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB

The ID of the request.

Roles Array

The information of RAM roles.

Role
Arn String acs:ram::123456789012****:role/ECSAdmin

The Alibaba Cloud Resource Name (ARN) of the RAM role.

CreateDate String 2015-01-23T12:33:18Z

The time when the RAM role was created.

Description String ECS administrator

The description of the RAM role.

MaxSessionDuration Long 3600

The maximum session duration 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 time when the RAM role was modified.

Examples

Sample requests

https://ram.aliyuncs.com/?Action=ListRoles
&<Common request parameters>

Sample success responses

XML format

<ListRolesResponse>
      <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
      <IsTruncated>true</IsTruncated>
      <Marker>EXAMPLE</Marker>
      <Roles>
            <Role>
                  <RoleId>901234567890****</RoleId>
                  <RoleName>ECSAdmin</RoleName>
                  <Arn>acs:ram::123456789012****:role/ECSAdmin</Arn>
                  <Description>ECS administrator</Description>
                  <MaxSessionDuration>3600</MaxSessionDuration>
                  <CreateDate>2015-01-23T12:33:18Z</CreateDate>
                  <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
            </Role>
            <Role>
                  <RoleId>901234567890****</RoleId>
                  <RoleName>OSSReadonlyAccess</RoleName>
                  <Arn>acs:ram::123456789012****:role/ECSAdmin</Arn>
                  <Description>OSS read-only access</Description>
                  <MaxSessionDuration>3600</MaxSessionDuration>
                  <CreateDate>2015-01-23T12:33:18Z</CreateDate>
                  <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
            </Role>
      </Roles>
</ListRolesResponse>

JSON format

{
    "RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
    "IsTruncated": true,
    "Marker": "EXAMPLE",
    "Roles": {
        "Role": [
            {
                "RoleId": "901234567890****",
                "RoleName": "ECSAdmin",
                "Arn": "acs:ram::123456789012****:role/ECSAdmin",
                "Description": "ECS administrator",
                "MaxSessionDuration": 3600,
                "CreateDate": "2015-01-23T12:33:18Z",
                "UpdateDate": "2015-01-23T12:33:18Z"
            },
            {
                "RoleId": "901234567890****",
                "RoleName": "OSSReadonlyAccess",
                "Arn": "acs:ram::123456789012****:role/OSSReadonlyAccess",
                "Description": "OSS read-only access",
                "MaxSessionDuration": 3600,
                "CreateDate": "2015-01-23T12:33:18Z",
                "UpdateDate": "2015-01-23T12:33:18Z"
            }
        ]
    }
}

Error codes

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