Chuyển tới nội dung chính

Creating Snapshots

POST /v3/{project_id}/snapshots

Creates a volume snapshot, which is a point-in-time, complete copy of a volume. This request requires an authentication token, which you should include in the request headers.

info

Request

Body Parameters

NameInTypeDescription
project_idpathstringThe UUID of the project in a multi-tenancy cloud.
snapshotbodyobjectA snapshot object.
volume_idbodystringThe UUID of the volume.
namebodystringThe name of the snapshot.
description (Optional)bodystringA description for the snapshot. Default is None.
force (Optional)bodybooleanIndicates whether to backup, even if the volume is attached. Default is false.
metadata (Optional)bodyobjectOne or more metadata key and value pairs for the snapshot.

Sample Request

Using curl

curl -ks -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
-d '{
"snapshot": {
"name": "snapshot1",
"volume_id": "b0738bcc-3513-4066-852d-c70b8d966ffd",
"force": true
}
}' https://api.vietnix.cloud:8776/v3/f5d834d636c642c7bfe8af86139c6f26/snapshots

Using HTTP request

POST https://api.vietnix.cloud:8776/v3/f5d834d636c642c7bfe8af86139c6f26/snapshots

with body

{
"snapshot": {
"name": "snapshot1",
"volume_id": "b0738bcc-3513-4066-852d-c70b8d966ffd",
"force": true
}
}

Response

Parameters

NameTypeDescription
snapshotobjectA snapshot object.
user_idstringThe UUID of the user. New in version 3.41
volume_idstringIf the snapshot was created from a volume, the volume ID.
namestringThe name of the snapshot.
statusstringThe status for the snapshot.
descriptionstringA description for the snapshot.
created_atstringThe date and time when the resource was created. The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm. For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC.
metadataobjectOne or more metadata key and value pairs for the snapshot, if any.
idstringThe snapshot UUID.
sizeintegerThe size of the volume, in gibibytes (GiB).
count (Optional)integerThe total count of requested resource before pagination is applied. New in version 3.45
updated_atstringThe date and time when the resource was updated. If the resource has not been updated, this field will be null. The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm. For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC.

Status Codes

Success

CodeReason
202 - AcceptedRequest was accepted for processing, but the processing has not been completed. A 'location' header is included in the response which contains a link to check the progress of the request.

Error

CodeReason
400 - Bad RequestSome content in the request was invalid.
404 - Not FoundThe requested resource could not be found.

Sample Response

{
"snapshot": {
"id": "d54589c3-7e86-47d5-a59d-0eae51dbd992",
"created_at": "2025-10-07T07:19:27.702681",
"updated_at": null,
"name": "snapshot1",
"description": null,
"volume_id": "b0738bcc-3513-4066-852d-c70b8d966ffd",
"volume_type_id": "e9f2ecf9-697f-4af7-b084-8d4d072d7974",
"status": "creating",
"size": 10,
"metadata": {}
}
}