Skip to content

Configure Automatic VM Snapshots

PUT
/notebooks/{Instance_id}/snapshots/
curl --request PUT \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/snapshots/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"snapshot_enabled": true,
"snapshot_schedule_cron": "0 2 * * *",
"snapshot_retention_count": 7
}'

Turns automatic snapshots on or off for the Virtual Machine, or changes their schedule. Scheduled snapshots are named scheduled-snapshot- with the date and time in India time. Beyond the number to keep, the oldest scheduled snapshot is removed; snapshots you took by hand are never removed. Turning the schedule off keeps the snapshots already taken. Send the whole body each time, with snapshot_enabled as a JSON boolean.

Instance_id
required
integer

Instance ID

project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json
object
snapshot_enabled
required

true to take snapshots on the schedule, false to stop.

boolean

Example

true
snapshot_schedule_cron

Five-field cron expression: minute, hour, day of month, month, day of week. Read as India time (IST). Defaults to 0 */6 * * *, every 6 hours.

string

Example

0 2 * * *
snapshot_retention_count

How many scheduled snapshots to keep, from 1 to 60. Defaults to 7.

integer

Example

7

The schedule after the change

Media typeapplication/json
object
code
integer
message
string
data
object
snapshot_enabled

true when automatic snapshots are on.

boolean
snapshot_schedule_cron

The schedule, as a five-field cron expression in India time (IST).

string
snapshot_retention_count

How many scheduled snapshots to keep, from 1 to 60.

integer
snapshot_last_run_at

When the schedule last took a snapshot.

string
nullable
snapshot_next_run_at

When it takes the next one. null when automatic snapshots are off.

string
nullable
policy

The stored schedule record: id, vm_id, enabled, schedule_cron, retention_count, last_run_at, status, location, created_at, updated_at. null for a VM that never had a schedule.

object
errors
object

Example

{
"code": 200,
"message": "Automatic snapshots enabled",
"data": {
"snapshot_enabled": true,
"snapshot_schedule_cron": "0 */6 * * *",
"snapshot_retention_count": 7,
"snapshot_last_run_at": null,
"snapshot_next_run_at": "2026-10-21T12:30:00Z",
"policy": null
},
"errors": {}
}

snapshot_enabled is missing, the cron expression is not valid, the number to keep is outside 1 to 60, or, when turning snapshots on, the plan does not support them. errors is keyed by the field.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
object

Example

{
"code": 400,
"message": "Bad Request",
"data": {},
"errors": {
"snapshot_retention_count": "snapshot_retention_count must be between 1 and 60."
}
}

No VM with that ID in the project and region.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 404,
"message": "Bad Request",
"data": {},
"errors": "Invalid Request! Notebook not found"
}

Turning snapshots on is refused because the VM’s storage has no snapshot class.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 412,
"message": "Precondition Failed",
"data": {},
"errors": "Automatic snapshots can't be enabled for this VM: <reason>"
}