curl --request PATCH \
--url https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"day": "5",
"day_of_week": "mon,fri",
"days": 0,
"hour": "0",
"hours": 2,
"max_quantity": 2,
"minute": "30",
"minutes": 1,
"month": "1",
"resource_name_template": "Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}",
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"timezone": "UTC",
"type": "cron",
"week": "1",
"weeks": 0
}
'import requests
url = "https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}"
payload = {
"day": "5",
"day_of_week": "mon,fri",
"days": 0,
"hour": "0",
"hours": 2,
"max_quantity": 2,
"minute": "30",
"minutes": 1,
"month": "1",
"resource_name_template": "Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}",
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"timezone": "UTC",
"type": "cron",
"week": "1",
"weeks": 0
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
day: '5',
day_of_week: 'mon,fri',
days: 0,
hour: '0',
hours: 2,
max_quantity: 2,
minute: '30',
minutes: 1,
month: '1',
resource_name_template: 'Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}',
retention_time: {days: 0, hours: 2, minutes: 1, weeks: 0},
timezone: 'UTC',
type: 'cron',
week: '1',
weeks: 0
})
};
fetch('https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'day' => '5',
'day_of_week' => 'mon,fri',
'days' => 0,
'hour' => '0',
'hours' => 2,
'max_quantity' => 2,
'minute' => '30',
'minutes' => 1,
'month' => '1',
'resource_name_template' => 'Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}',
'retention_time' => [
'days' => 0,
'hours' => 2,
'minutes' => 1,
'weeks' => 0
],
'timezone' => 'UTC',
'type' => 'cron',
'week' => '1',
'weeks' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}"
payload := strings.NewReader("{\n \"day\": \"5\",\n \"day_of_week\": \"mon,fri\",\n \"days\": 0,\n \"hour\": \"0\",\n \"hours\": 2,\n \"max_quantity\": 2,\n \"minute\": \"30\",\n \"minutes\": 1,\n \"month\": \"1\",\n \"resource_name_template\": \"Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}\",\n \"retention_time\": {\n \"days\": 0,\n \"hours\": 2,\n \"minutes\": 1,\n \"weeks\": 0\n },\n \"timezone\": \"UTC\",\n \"type\": \"cron\",\n \"week\": \"1\",\n \"weeks\": 0\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"day\": \"5\",\n \"day_of_week\": \"mon,fri\",\n \"days\": 0,\n \"hour\": \"0\",\n \"hours\": 2,\n \"max_quantity\": 2,\n \"minute\": \"30\",\n \"minutes\": 1,\n \"month\": \"1\",\n \"resource_name_template\": \"Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}\",\n \"retention_time\": {\n \"days\": 0,\n \"hours\": 2,\n \"minutes\": 1,\n \"weeks\": 0\n },\n \"timezone\": \"UTC\",\n \"type\": \"cron\",\n \"week\": \"1\",\n \"weeks\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"day\": \"5\",\n \"day_of_week\": \"mon,fri\",\n \"days\": 0,\n \"hour\": \"0\",\n \"hours\": 2,\n \"max_quantity\": 2,\n \"minute\": \"30\",\n \"minutes\": 1,\n \"month\": \"1\",\n \"resource_name_template\": \"Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}\",\n \"retention_time\": {\n \"days\": 0,\n \"hours\": 2,\n \"minutes\": 1,\n \"weeks\": 0\n },\n \"timezone\": \"UTC\",\n \"type\": \"cron\",\n \"week\": \"1\",\n \"weeks\": 0\n}"
response = http.request(request)
puts response.read_body{
"id": "1488e2ce-f906-47fb-ba32-c25a3f63df4f",
"max_quantity": 2,
"owner": "lifecycle_policy",
"owner_id": 1,
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"type": "cron",
"user_id": 12,
"day": "5",
"day_of_week": "mon,fri",
"hour": "0, 20",
"minute": "30",
"month": "1,6",
"resource_name_template": "reserve snap of the volume {volume_id}",
"timezone": "UTC",
"week": "1"
}Update schedule
curl --request PATCH \
--url https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"day": "5",
"day_of_week": "mon,fri",
"days": 0,
"hour": "0",
"hours": 2,
"max_quantity": 2,
"minute": "30",
"minutes": 1,
"month": "1",
"resource_name_template": "Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}",
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"timezone": "UTC",
"type": "cron",
"week": "1",
"weeks": 0
}
'import requests
url = "https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}"
payload = {
"day": "5",
"day_of_week": "mon,fri",
"days": 0,
"hour": "0",
"hours": 2,
"max_quantity": 2,
"minute": "30",
"minutes": 1,
"month": "1",
"resource_name_template": "Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}",
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"timezone": "UTC",
"type": "cron",
"week": "1",
"weeks": 0
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
day: '5',
day_of_week: 'mon,fri',
days: 0,
hour: '0',
hours: 2,
max_quantity: 2,
minute: '30',
minutes: 1,
month: '1',
resource_name_template: 'Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}',
retention_time: {days: 0, hours: 2, minutes: 1, weeks: 0},
timezone: 'UTC',
type: 'cron',
week: '1',
weeks: 0
})
};
fetch('https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'day' => '5',
'day_of_week' => 'mon,fri',
'days' => 0,
'hour' => '0',
'hours' => 2,
'max_quantity' => 2,
'minute' => '30',
'minutes' => 1,
'month' => '1',
'resource_name_template' => 'Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}',
'retention_time' => [
'days' => 0,
'hours' => 2,
'minutes' => 1,
'weeks' => 0
],
'timezone' => 'UTC',
'type' => 'cron',
'week' => '1',
'weeks' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}"
payload := strings.NewReader("{\n \"day\": \"5\",\n \"day_of_week\": \"mon,fri\",\n \"days\": 0,\n \"hour\": \"0\",\n \"hours\": 2,\n \"max_quantity\": 2,\n \"minute\": \"30\",\n \"minutes\": 1,\n \"month\": \"1\",\n \"resource_name_template\": \"Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}\",\n \"retention_time\": {\n \"days\": 0,\n \"hours\": 2,\n \"minutes\": 1,\n \"weeks\": 0\n },\n \"timezone\": \"UTC\",\n \"type\": \"cron\",\n \"week\": \"1\",\n \"weeks\": 0\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"day\": \"5\",\n \"day_of_week\": \"mon,fri\",\n \"days\": 0,\n \"hour\": \"0\",\n \"hours\": 2,\n \"max_quantity\": 2,\n \"minute\": \"30\",\n \"minutes\": 1,\n \"month\": \"1\",\n \"resource_name_template\": \"Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}\",\n \"retention_time\": {\n \"days\": 0,\n \"hours\": 2,\n \"minutes\": 1,\n \"weeks\": 0\n },\n \"timezone\": \"UTC\",\n \"type\": \"cron\",\n \"week\": \"1\",\n \"weeks\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/schedule/{project_id}/{region_id}/{schedule_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"day\": \"5\",\n \"day_of_week\": \"mon,fri\",\n \"days\": 0,\n \"hour\": \"0\",\n \"hours\": 2,\n \"max_quantity\": 2,\n \"minute\": \"30\",\n \"minutes\": 1,\n \"month\": \"1\",\n \"resource_name_template\": \"Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}\",\n \"retention_time\": {\n \"days\": 0,\n \"hours\": 2,\n \"minutes\": 1,\n \"weeks\": 0\n },\n \"timezone\": \"UTC\",\n \"type\": \"cron\",\n \"week\": \"1\",\n \"weeks\": 0\n}"
response = http.request(request)
puts response.read_body{
"id": "1488e2ce-f906-47fb-ba32-c25a3f63df4f",
"max_quantity": 2,
"owner": "lifecycle_policy",
"owner_id": 1,
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"type": "cron",
"user_id": 12,
"day": "5",
"day_of_week": "mon,fri",
"hour": "0, 20",
"minute": "30",
"month": "1,6",
"resource_name_template": "reserve snap of the volume {volume_id}",
"timezone": "UTC",
"week": "1"
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Path Parameters
Project ID
1
Region ID
1
Schedule ID
"1488e2ce-f906-47fb-ba32-c25a3f63df4f"
Body
Day of the month (1-31, '*') or a comma-separated list of days
"5"
Weekday or a comma-separated list of weekdays (mon,tue,wed,thu,fri,sat,sun,*)
"mon,fri"
Number of days to wait
0
Hour (0-23, '*') or a comma-separated list of hours
"0"
"0, 20"
Number of hours to wait
2
Number of stored resources.
x <= 100002
Minute (0-59, '*') or a comma-separated list of minutes
"30"
Number of minutes to wait
1
Month (1-12, '*') or a comma-separated list of months
"1"
"1,6"
Template for resource names.
"Snapshot of volume {volume_id} created by policy {lifecycle_policy_id}"
Time after which the resource will be deleted
Show child attributes
Show child attributes
A pytz timezone. Defaults to UTC.
"UTC"
Type of the schedule.
cron, interval "cron"
ISO week (1-53, '*') or a comma-separated list of weeks
"1"
Number of weeks to wait
0
Response
OK
- GetCronScheduleSerializer
- GetIntervalScheduleSerializer
Schedule ID
"1488e2ce-f906-47fb-ba32-c25a3f63df4f"
Number of stored resources.
x <= 100002
Schedule owner
"lifecycle_policy"
Owner ID
1
Time after which the resource will be deleted
Show child attributes
Show child attributes
Schedule type
"cron""cron"
User ID
12
Day of the month (1-31, '*') or a comma-separated list of days
"5"
Weekday or a comma-separated list of weekdays (mon,tue,wed,thu,fri,sat,sun,*)
"mon,fri"
Hour (0-23, '*') or a comma-separated list of hours
"0, 20"
Minute (0-59, '*') or a comma-separated list of minutes
"30"
Month (1-12, '*') or a comma-separated list of months
"1,6"
Template for resource names
"reserve snap of the volume {volume_id}"
A pytz timezone. Defaults to UTC.
"UTC"
ISO week (1-53, '*') or a comma-separated list of weeks
"1"
Was this page helpful?