Skip to content

Set Snapshot Schedule

POST
/dbaas/{managed_db_id}/snapshots/schedule/
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/dbaas/{managed_db_id}/snapshots/schedule/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"frequency": "weekly",
"start_time": "03:30",
"day_of_week": 0,
"retention_count": 14
}'

Turns automatic snapshots on, or changes the schedule, and returns it. All times are in IST (Asia/Kolkata). Fields you leave out keep their saved values; a database that never had a schedule starts from daily at 02:00, keeping 7. After each scheduled snapshot, scheduled snapshots beyond retention_count are deleted, oldest first; manual snapshots are never deleted by the schedule. A scheduled run is skipped while the database is not Running or Degraded. Refused while the database is Terminating or Failed. Needs the Create permission for DBaaS.

managed_db_id
required
integer

Database 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
frequency

daily runs once a day at start_time. weekly runs once a week on day_of_week at start_time. hourly runs every hour at the minute of start_time. custom_cron runs on cron_expression.

string
Allowed values: daily weekly hourly custom_cron

Example

daily
start_time

Time of day in IST, HH:MM on a 24-hour clock. For daily, weekly and hourly.

string
/^([01]\d|2[0-3]):[0-5]\d$/

Example

02:00
day_of_week

0 (Sunday) to 6 (Saturday). Required for weekly.

integer
<= 6

Example

0
cron_expression

For custom_cron: a 5-field cron expression (minute hour day-of-month month weekday), read in IST. Left out, the saved expression is kept (for a database that never had a schedule, 0 */6 * * *, every 6 hours).

string

Example

0 */6 * * *
retention_count

How many scheduled snapshots to keep, 1 to 60.

integer
>= 1 <= 60

Example

7

Example

{
"frequency": "weekly",
"start_time": "03:30",
"day_of_week": 0,
"retention_count": 14
}

The schedule as saved

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

Whether automatic snapshots are on.

boolean
frequency
string
Allowed values: daily weekly hourly custom_cron
start_time

Time of day in IST, as HH:MM on a 24-hour clock.

string
nullable
day_of_week

For weekly: 0 (Sunday) to 6 (Saturday).

integer
nullable
cron_expression

The 5-field cron expression the schedule runs on, read in IST.

string
retention_count

How many scheduled snapshots are kept.

integer
next_run_at

The next scheduled run, in IST. null when the schedule is off.

string
nullable
errors
object

Example

{
"code": 200,
"message": "Success",
"data": {
"enabled": true,
"frequency": "daily",
"start_time": "02:00",
"day_of_week": null,
"cron_expression": "0 2 * * *",
"retention_count": 7,
"next_run_at": "2026-10-27T02:00:00+05:30"
},
"errors": {}
}

A field is outside its rule: “frequency must be one of: daily, weekly, hourly, custom_cron.”, “start_time must be HH:MM in IST (24-hour format, e.g. ‘02:07’).”, “day_of_week is required when frequency is ‘weekly’.”, “cron_expression must be a 5-field cron expression (minute hour day month weekday), e.g. ‘0 */6 * * *’ for every 6 hours.” or “retention_count must be between 1 and 60.”. A missing or invalid project ID gives errors “Project ID is missing or invalid”.

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

Example

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

The caller lacks the permission the call needs on the project, or the region is not allowed.

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

Example

{
"code": 403,
"message": "Forbidden",
"data": {},
"errors": "You don't have permission to access this service. Please verify your policy or project."
}

No database 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! Database Not Found"
}

The database is Terminating or Failed (as shown), or the schedule could not be applied, in which case nothing is changed (“Could not update the snapshot schedule right now; nothing was changed. Please try again.”).

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

Example

{
"code": 412,
"message": "Precondition Failed",
"data": {},
"errors": "Database NOT in RUNNING state. Please try again later."
}