Skip to main content

Get

Returns the specified snapshot schedule.

To get the list of available snapshot schedules, make a List request.

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

const GetSnapshotScheduleRequest =
cloudApi.compute.snapshot_schedule_service.GetSnapshotScheduleRequest;

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

const result = await client.get(
GetSnapshotScheduleRequest.fromPartial({
// snapshotScheduleId: "snapshotScheduleId"
})
);
console.log(result);
})();

GetSnapshotScheduleRequest

snapshotScheduleId : string

ID of the snapshot schedule to return.

To get a schedule ID, make a SnapshotScheduleService.List request.

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][3] 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.