Lists RAM roles.

Debug

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

Request parameters

Parameter Type Required? Example value Description
Action String Yes ListRoles

The name of this action.

Value: ListRoles

Marker String No EXAMPLE The marker. If part of a response is intercepted, you can use this parameter to obtain the intercepted content.
MaxItems Integer No 100

The number of permitted response items. If a response is intercepted when it reaches the maximum value of this parameter, the value of IsTruncated is true.

Value range: 1 to 1,000

Default value: 100

Response parameters

Parameter Type Example value Description
IsTruncated Boolean true Indicates whether a response is intercepted.
Marker String EXAMPLE This parameter is available only when the value of IsTruncated is true. In which case, you can call this action and use the specific marker to obtain the intercepted content.
RequestId String 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB The request ID.
Roles N/A N/A The list of RAM roles.
Arn String acs:ram::123456789012****:role/ECSAdmin The Alibaba Cloud Resource Name (ARN) of a RAM role.
CreateDate String 2015-01-23T12:33:18Z The date and time when a RAM role was created.
Description String ECS administrator The description of a RAM role.
RoleId String 901234567890**** The ID of a RAM role.
RoleName String ECSAdmin The name of a RAM role.
UpdateDate String 2015-01-23T12:33:18Z The date and time when a RAM role was modified.

Example

Request example

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

Response example

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>
      <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/OSSReadonlyAccess</Arn>
      <Description>OSS read-only access</Description>
      <CreateDate>2015-01-23T12:33:18Z</CreateDate>
      <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
    </Role>
  </Roles>
</ListRolesResponse>

JSON format

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

Errors

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