AccountAccessRuntime / Client / list_roles
list_roles¶
- AccountAccessRuntime.Client.list_roles(**kwargs)¶
Returns the roles that you are entitled to access within a tenant. The results are paginated. Use a returned role with
GetRoleCredentialsto obtain temporary credentials.See also: AWS API Documentation
Request Syntax
response = client.list_roles( tenantId='string', maxResults=123, nextToken='string' )
- Parameters:
tenantId (string) –
[REQUIRED]
The identifier of the tenant whose roles you want to list. A tenant ID begins with
aa-and is 3 to 24 characters long. It can contain lowercase letters, numbers, and hyphens.maxResults (integer) – The maximum number of roles to return in a single response. If more roles are available than the specified value, the response includes a
nextTokenvalue that you can use to retrieve the next page of results. If you don’t specify a value, the service uses a default page size.nextToken (string) – The pagination token from a previous
ListRolesresponse. Use it to retrieve the next page of results. Omit this parameter on the first call.
- Return type:
dict
- Returns:
Response Syntax
{ 'roles': [ { 'accountId': 'string', 'accountName': 'string', 'roleArn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) –
roles (list) –
The list of roles that you can access in the tenant. Each entry describes an Amazon Web Services account and a role.
(dict) –
Describes a role that you can access, including the Amazon Web Services account that contains the role and the role’s ARN.
accountId (string) –
The 12-digit identifier of the Amazon Web Services account that contains the role.
accountName (string) –
The display name of the Amazon Web Services account, if available. This value can be absent when the account name can’t be resolved.
roleArn (string) –
The Amazon Resource Name (ARN) of the role that you can access.
nextToken (string) –
The pagination token to include in a subsequent
ListRolesrequest to retrieve the next page of results. This value is absent when there are no more results to return.
Exceptions