Skip to main content

List

Retrieves the list of Role resources.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const ListRolesRequest = cloudApi.iam.role_service.ListRolesRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.RoleServiceClient);

const result = await client.list(
ListRolesRequest.fromPartial({
// pageSize: 0,
// pageToken: "pageToken",
// filter: "filter"
})
);
console.log(result);
})();

ListRolesRequest

pageSize : int64

The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListRolesResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.

pageToken : string

Page token. To get the next page of results, set page_token to the ListRolesResponse.next_page_token returned by a previous list request.

filter : string

A filter expression that filters resources listed in the response.

ListRolesResponse

roles : Role

List of Role resources.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is larger than ListRolesRequest.page_size, use the next_page_token as the value for the ListRolesRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

Role

A Role resource. For more information, see Roles.

id : string

ID of the role.

description : string

Description of the role. 0-256 characters long.