Skip to main content

List

Retrieves the list of sinks in the specified folder.

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

const ListSinksRequest = cloudApi.logging.sink_service.ListSinksRequest;

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

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

ListSinksRequest

folderId : string

Folder ID of the sinks to return.

To get a folder ID make a yandex.cloud.resourcemanager.v1.FolderService.List request.

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 ListSinkssResponse.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 ListSinksResponse.next_page_token returned by a previous list request.

filter : string

A filter expression that filters sinks listed in the response.

The expression must specify:

  1. The field name. Currently filtering can only be applied to the Sink.name field.
  2. An = operator.
  3. The value in double quotes ("). Must be 3-63 characters long and match the regular expression [a-z][-a-z0-9]{1,61}[a-z0-9]. Example of a filter: name="my-sink".

ListSinksResponse

sinks : Sink

List of sinks in the specified folder.

nextPageToken : string

Token for getting the next page of the list. If the number of results is greater than the specified ListSinksRequest.page_size, use next_page_token as the value for the ListSinksRequest.page_token parameter in the next list request.

Each subsequent page will have its own next_page_token to continue paging through the results.

Sink

Yds
streamName : string

Fully qualified name of data stream

S3
bucket : string

Object storage bucket

prefix : string

Prefix to use for saved log object names

id : string

Sink ID.

folderId : string

Sink folder ID.

cloudId : string

Sink cloud ID.

createdAt : google.protobuf.Timestamp

Sink creation time.

name : string

Sink name.

description : string

Sink description.

labels : string

Sink labels.

serviceAccountId : string

Logs will be written to the sink on behalf of this service account

One of sink

Logs destination

  • yds : Yds

    Yandex data stream

  • s3 : S3

    Object storage

Yds

streamName : string

Fully qualified name of data stream

S3

bucket : string

Object storage bucket

prefix : string

Prefix to use for saved log object names