Skip to main content

ListSnapshotSchedules

Retrieves the list of snapshot schedules the specified disk is attached to.

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

const ListDiskSnapshotSchedulesRequest =
cloudApi.compute.disk_service.ListDiskSnapshotSchedulesRequest;

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

const result = await client.listSnapshotSchedules(
ListDiskSnapshotSchedulesRequest.fromPartial({
// diskId: "diskId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListDiskSnapshotSchedulesRequest​

diskId : string​

ID of the disk to list snapshot schedules for.

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

ListDiskSnapshotSchedulesResponse​

snapshotSchedules : SnapshotSchedule​

List of snapshot schedules the specified disk is attached to.

nextPageToken : string​

Token for getting the next page of the list. If the number of results is greater than the specified ListDiskSnapshotSchedulesRequest.page_size, use next_page_token as the value for the ListDiskSnapshotSchedulesRequest.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][5] 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.