Skip to main content

List

Retrieves the list of snapshot schedules in the specified folder.

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

const ListSnapshotSchedulesRequest =
cloudApi.compute.snapshot_schedule_service.ListSnapshotSchedulesRequest;

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

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

ListSnapshotSchedulesRequest

folderId : string

ID of the folder to list snapshot schedules in.

To get the 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 ListSnapshotSchedulesResponse.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 ListSnapshotSchedulesResponse.next_page_token returned by a previous list request.

filter : string

A filter expression that filters snapshot schedules listed in the response.

The expression must specify:

  1. The field name. Currently you can use filtering only on SnapshotSchedule.name field.
  2. An operator. Can be either = or != for single values, IN or NOT IN for lists of values.
  3. The value. 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-schedule.
orderBy : string

A sorting expression that sorts snapshot schedules listed in the response.

The expression must specify the field name from SnapshotSchedule and ascending or descending order, e.g. createdAt desc.

Default value: id asc.

ListSnapshotSchedulesResponse

snapshotSchedules : SnapshotSchedule

List of snapshot schedules 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 ListSnapshotSchedulesRequest.page_size, use next_page_token as the value for the ListSnapshotSchedulesRequest.page_token parameter in the next list request.

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

SnapshotSchedule

A snapshot schedule. For details about the concept, see documentation.

Status
  • STATUS_UNSPECIFIED

  • CREATING

    The snapshot schedule is being created.

  • ACTIVE

    The snapshot schedule is on: new disk snapshots will be created, old ones deleted (if [SnapshotSchedule.retention_policy][8] is specified).

  • INACTIVE

    The schedule is interrupted, snapshots won't be created or deleted.

  • DELETING

    The schedule is being deleted.

  • UPDATING

    Changes are being made to snapshot schedule settings or a list of attached disks.

id : string

ID of the snapshot schedule.

folderId : string

ID of the folder that the snapshot schedule belongs to.

createdAt : google.protobuf.Timestamp

Creation timestamp.

name : string

Name of the snapshot schedule.

The name is unique within the folder.

description : string

Description of the snapshot schedule.

labels : string

Snapshot schedule labels as key:value pairs.

status : Status

Status of the snapshot schedule.

schedulePolicy : SchedulePolicy

Frequency settings of the snapshot schedule.

One of retentionPolicy

Retention policy of the snapshot schedule.

  • retentionPeriod : google.protobuf.Duration
    Retention period of the snapshot schedule. Once a snapshot created by the schedule reaches this age, it is

    automatically deleted.

  • snapshotCount : int64
    Retention count of the snapshot schedule. Once the number of snapshots created by the schedule exceeds this

    number, the oldest ones are automatically deleted. E.g. if the number is 5, the first snapshot is deleted after the sixth one is created, the second is deleted after the seventh one is created, and so on.

snapshotSpec : SnapshotSpec

Attributes of snapshots created by the snapshot schedule.

SchedulePolicy

A resource for frequency settings of a snapshot schedule.

startAt : google.protobuf.Timestamp

Timestamp for creating the first snapshot.

expression : string

Cron expression for the snapshot schedule (UTC+0).

The expression must consist of five fields (Minutes Hours Day-of-month Month Day-of-week) or be one of nonstandard predefined expressions (e.g. @hourly). For details about the format, see documentation

SnapshotSpec

A resource for attributes of snapshots created by the snapshot schedule.

description : string

Description of the created snapshot.

labels : string

Snapshot labels as key:value pairs.