Queries 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.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

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

Language String No zh-CN

The language that is used to return the descriptions of the RAM roles. Valid values:

  • en: English
  • zh-CN: Chinese
  • ja: Japanese

Response parameters

Parameter Type Example Description
PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

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

The ID of the request.

Roles Array

The information of the 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.

IsServiceLinkedRole Boolean true

Indicates whether the RAM role is a service linked role.

LatestDeletionTask Struct

The information of the most recent deletion task.

CreateDate String 2018-10-23T12:33:18Z

The time when the deletion task was created.

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

The ID of the deletion task.

MaxSessionDuration Long 3600

The maximum session duration of the RAM role.

RoleId String 90123456789****

The ID of the RAM role.

RoleName String ECSAdmin

The name of the RAM role.

RolePrincipalName String ECSAdmin@role.123456.onaliyunservice.com

The name of the RAM role after authorization.

UpdateDate String 2016-01-23T12:33:18Z

The time when the RAM role was updated.

TotalCount Integer 2

The total number of RAM roles.

Examples

Sample requests

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

Sample success responses

XML format

<ListRolesResponse>
	  <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
	  <PageNumber>1</PageNumber>
	  <PageSize>10</PageSize>
	  <TotalCount>2</TotalCount>
	  <Roles>
		    <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-b142eb70****</DeletionTaskId>
			      </LatestDeletionTask>
			      <Description>ECS administrator</Description>
                  <MaxSessionDuration>3600</MaxSessionDuration>
			      <CreateDate>2015-01-23T12:33:18Z</CreateDate>
			      <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
		    </Role>
		    <Role>
			      <RoleId>90123456789****</RoleId>
			      <RoleName>OSSReadonlyAccess</RoleName>
			      <RolePrincipalName>OSSReadonlyAccess@role.123456.onaliyunservice.com</RolePrincipalName>
			      <Arn>acs:ram::123456789012****:role/OSSReadonlyAccess</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",
	"PageNumber": 1,
	"PageSize": 10,
	"TotalCount": 2,
	"Roles": {
		"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-b142eb70****"
				},
				"Description": "ECS administrator",
                "MaxSessionDuration": 3600,
				"CreateDate": "2015-01-23T12:33:18Z",
				"UpdateDate": "2015-01-23T12:33:18Z"
			},
			{
				"RoleId": "90123456789****",
				"RoleName": "OSSReadonlyAccess",
				"RolePrincipalName": "OSSReadonlyAccess@role.123456.onaliyunservice.com",
				"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.