All Products
Search
Document Center

Resource Management:ListRoles

Last Updated:Aug 31, 2026

Queries the list of roles by calling ListRoles.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

PageNumber

integer

No

The page number.

Minimum value: 1. Default value: 1.

1

PageSize

integer

No

The number of entries per page.

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

10

Language

string

No

The language type. The role description is returned in the specified language. Valid values:

  • en: English.

  • zh-CN: Chinese.

  • ja: Japanese.

zh-CN

Response elements

Element

Type

Description

Example

object

PageNumber

integer

The page number.

1

PageSize

integer

The number of entries per page.

10

RequestId

string

The request ID.

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

Roles

object

Role

array<object>

The role information.

array<object>

The role information.

Arn

string

The resource descriptor of the role.

acs:ram::123456789012****:role/ECSAdmin

CreateDate

string

The time when the role was created. The time is in RFC 3339 format and displayed in UTC, indicated by Z.

2015-01-23T12:33:18Z

Description

string

The description of the role.

ECS management role

IsServiceLinkedRole

boolean

Indicates whether the role is a service-linked role.

true

LatestDeletionTask

object

The information about the most recent deletion task.

CreateDate

string

The time when the deletion task was created. The time is in RFC 3339 format and displayed in UTC, indicated by Z.

2018-10-23T12:33:18Z

DeletionTaskId

string

The ID of the deletion task.

ECSAdmin/cc61514b-26eb-4453-ab53-b142eb70****

MaxSessionDuration

integer

The maximum session duration of the role.

3600

RoleId

string

The ID of the role.

90123456789****

RoleName

string

The name of the role.

ECSAdmin

RolePrincipalName

string

The name of the authorized role.

ECSAdmin@role.123456.onaliyunservice.com

UpdateDate

string

The time when the role was last updated. The time is in RFC 3339 format and displayed in UTC, indicated by Z.

2016-01-23T12:33:18Z

TotalCount

integer

The total number of roles.

2

Examples

Success response

JSON format

{
  "PageNumber": 1,
  "PageSize": 10,
  "RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
  "Roles": {
    "Role": [
      {
        "Arn": "acs:ram::123456789012****:role/ECSAdmin",
        "CreateDate": "2015-01-23T12:33:18Z",
        "Description": "ECS管理角色",
        "IsServiceLinkedRole": true,
        "LatestDeletionTask": {
          "CreateDate": "2018-10-23T12:33:18Z",
          "DeletionTaskId": "ECSAdmin/cc61514b-26eb-4453-ab53-b142eb70****"
        },
        "MaxSessionDuration": 3600,
        "RoleId": "90123456789****",
        "RoleName": "ECSAdmin",
        "RolePrincipalName": "ECSAdmin@role.123456.onaliyunservice.com",
        "UpdateDate": "2016-01-23T12:33:18Z"
      }
    ]
  },
  "TotalCount": 2
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.