curl --request POST \
--url https://api.gcore.com/cloud/v1/lifecycle_policy/{project_id}/{region_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"action": "volume_snapshot",
"name": "schedule_1",
"schedules": [],
"status": "active",
"volume_ids": [
"3ed9e2ce-f906-47fb-ba32-c25a3f63df4f"
]
}'
{
"action": "volume_snapshot",
"id": 1,
"name": "schedule_1",
"project_id": 1,
"region_id": 1,
"schedules": [
{
"day": "5",
"day_of_week": "mon,fri",
"hour": "0, 20",
"id": "1488e2ce-f906-47fb-ba32-c25a3f63df4f",
"max_quantity": 2,
"minute": "30",
"month": "1,6",
"owner": "lifecycle_policy",
"owner_id": 1,
"resource_name_template": "reserve snap of the volume {volume_id}",
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"timezone": "UTC",
"type": "cron",
"user_id": 12,
"week": "1"
}
],
"status": "active",
"user_id": 11,
"volumes": [
{
"volume_id": "3ed9e2ce-f906-47fb-ba32-c25a3f63df4f",
"volume_name": "test schedule"
}
]
}
Create a new snapshot policy with the specified configuration.
curl --request POST \
--url https://api.gcore.com/cloud/v1/lifecycle_policy/{project_id}/{region_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"action": "volume_snapshot",
"name": "schedule_1",
"schedules": [],
"status": "active",
"volume_ids": [
"3ed9e2ce-f906-47fb-ba32-c25a3f63df4f"
]
}'
{
"action": "volume_snapshot",
"id": 1,
"name": "schedule_1",
"project_id": 1,
"region_id": 1,
"schedules": [
{
"day": "5",
"day_of_week": "mon,fri",
"hour": "0, 20",
"id": "1488e2ce-f906-47fb-ba32-c25a3f63df4f",
"max_quantity": 2,
"minute": "30",
"month": "1,6",
"owner": "lifecycle_policy",
"owner_id": 1,
"resource_name_template": "reserve snap of the volume {volume_id}",
"retention_time": {
"days": 0,
"hours": 2,
"minutes": 1,
"weeks": 0
},
"timezone": "UTC",
"type": "cron",
"user_id": 12,
"week": "1"
}
],
"status": "active",
"user_id": 11,
"volumes": [
{
"volume_id": "3ed9e2ce-f906-47fb-ba32-c25a3f63df4f",
"volume_name": "test schedule"
}
]
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project ID
1
Region ID
1
OK
The response is of type object
.
Was this page helpful?