Skip to main content

List

List communities in specified organization.

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

const ListCommunitiesRequest =
cloudApi.datasphere.community_service.ListCommunitiesRequest;

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

const result = await client.list(
ListCommunitiesRequest.fromPartial({
// pageSize: 0,
// pageToken: "pageToken",
// nameOrDescriptionPattern: "nameOrDescriptionPattern",
// ownedById: "ownedById",
// listPublic: true,
organizationId: "organizationId",
})
);
console.log(result);
})();

ListCommunitiesRequest

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 ListCommunitiesResponse.next_page_token that can be used to get the next page of results in subsequent list requests.

pageToken : string

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

nameOrDescriptionPattern : string

Community name or description pattern. Only communities with names or descriptions matching specified pattern will be returned.

ownedById : string

ID of the user. Only communities owned by specified user will be returned.

listPublic : bool

If set to true, only public communities will be returned.

organizationId : string

ID of the organization to list communities in.

ListCommunitiesResponse

communities : Community

List of communities matching filters in list communities request.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is larger than ListCommunitiesRequest.page_size, use the next_page_token as the value for the ListCommunitiesRequest.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.

Community

id : string

ID of the community.

createdAt : google.protobuf.Timestamp

Time when community was created.

name : string

Name of the community.

description : string

Description of the comminuty.

labels : string

Labels of the community.

createdById : string

ID of the user who created the community.

organizationId : string

ID of the organization to which community belongs.

zoneId : string

ID of the zone where this community was created