Creating an EVS Snapshot
Function
This API is used to create an EVS snapshot.
Calling Method
For details, see Calling APIs.
URI
POST /v2/{project_id}/snapshots
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
The project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
The user token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
snapshot |
Yes |
CinderCreateSnapshotOption object |
The information of the snapshot to be created. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
volume_id |
Yes |
String |
The ID of the snapshot's source disk. To obtain the disk ID, see Querying Details About All Disks. |
description |
No |
String |
The snapshot description. The value can be null. You can enter up to 85 characters. |
force |
No |
Boolean |
The flag for forcibly creating the snapshot. The default value is false. If this parameter value is false, snapshots cannot be forcibly created when the disk status is attaching. If this parameter value is true, snapshots can be forcibly created even when the disk status is attaching. |
metadata |
No |
Map<String,String> |
The snapshot metadata. |
name |
No |
String |
The snapshot name. You can enter up to 64 characters.
NOTE:
When a backup is created for a disk, a snapshot will also be created and named with the autobk_snapshot_ prefix. Operations cannot be performed on such snapshots. Therefore, you are advised not to use autobk_snapshot_ as the prefix of snapshot names to avoid any inconvenience. |
Response Parameters
Status code: 202
Parameter |
Type |
Description |
---|---|---|
snapshot |
SnapshotSummary object |
The snapshot information. |
Parameter |
Type |
Description |
---|---|---|
created_at |
String |
The time when the snapshot was created. Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX |
description |
String |
The snapshot description. |
id |
String |
The snapshot ID. |
metadata |
Map<String,String> |
The snapshot metadata. If metadata contains the __system__enableActive field, the snapshot is auto-generated snapshot created during a server backup. |
name |
String |
The snapshot name. |
size |
Integer |
The snapshot size, in GiB. |
status |
String |
The snapshot status. For details, see EVS Snapshot Status. |
updated_at |
String |
The time when the snapshot was updated. Time format: UTC YYYY-MM-DDTHH:MM:SS.XXXXXX |
volume_id |
String |
The ID of the snapshot's source disk. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
The error message returned if an error occurs. |
Parameter |
Type |
Description |
---|---|---|
code |
String |
The error code returned if an error occurs. For details about error codes and their meanings, see Error Codes. |
message |
String |
The error message returned if an error occurs. |
Example Requests
Creating a snapshot (If the source EVS disk is attached, the snapshot cannot be forcibly created.)
POST https://{endpoint}/v2/{project_id}/snapshots { "snapshot" : { "name" : "snap-001", "description" : "Daily backup", "volume_id" : "5aa119a8-d25b-45a7-8d1b-88e127885635", "force" : false, "metadata" : { } } }
Example Responses
Status code: 202
Accepted
{ "snapshot" : { "status" : "creating", "description" : "Daily backup", "created_at" : "2013-02-25T03:56:53.081642", "metadata" : { }, "volume_id" : "5aa119a8-d25b-45a7-8d1b-88e127885635", "size" : 1, "id" : "ffa9bc5e-1172-4021-acaf-cdcd78a9584d", "name" : "snap-001", "updated_at" : "2013-02-25T03:56:53.081642" } }
Status code: 400
Bad Request
{ "error" : { "message" : "XXXX", "code" : "XXX" } }
Status Codes
Status Code |
Description |
---|---|
202 |
Accepted |
400 |
Bad Request |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot