• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. OpenStack Nova APIs
  5. Snapshot Management
  6. Creating a Snapshot (Discarded)

Creating a Snapshot (Discarded)

Function

This API is used to create a snapshot for a volume.

Constraints

  • The name of a snapshot created by a user cannot be prefixed with autobk_snapshot.
  • This API will be discarded. You are advised to use the EVS API "Creating an EVS Snapshot (Native OpenStack API V2)".

URI

POST /v2/{project_id}/os-snapshots

POST /v2.1/{project_id}/os-snapshots

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

display_description

No

String

Specifies the snapshot description.

volume_id

Yes

String

Specifies the volume ID.

display_name

No

String

Specifies the name of the EVS snapshot.

The value contains a maximum of 255 bytes.

NOTE:

When creating a backup for an EVS disk through VBS, a snapshot will be created and named with prefix autobk_snapshot_. The EVS console has imposed operation restrictions on snapshots with prefix autobk_snapshot_. Therefore, you are advised to not use autobk_snapshot_ as the name prefix for the snapshots you created. Otherwise, the snapshots cannot be used normally.

force

No

Boolean


Specifies whether a snapshot is to be forcibly created.

If the value is true, a snapshot for the volume in use can be created.

Response

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the disk snapshot ID in UUID format.

status

Yes

String

Specifies the volume snapshot status.

displayName

No

String

Specifies the volume snapshot name.

displayDescription

No

String

Specifies the volume snapshot description.

createdAt

Yes

String

Specifies the time when the volume snapshot was created.

volumeId

Yes

String

Specifies the disk ID in UUID format for the snapshot.

size

Yes

Int

Specifies the volume snapshot size.

Example Request

POST /v2/d6c277ba8820452e83df36f33c9fa561/os-snapshots
POST /v2.1/d6c277ba8820452e83df36f33c9fa561/os-snapshots
{
"snapshot":
{
    "display_name":"test",
    "display_description":null,
    "volume_id":"ba5730ea-8621-4ae8-b702-ff0ffc12c209"
}
}

Example Response

{
    "snapshot": 
        {
            "createdAt": "2016-05-20T16:54:14.981520", 
            "displayDescription": null, 
            "id": "b836dc3d-4e10-4ea4-a34c-8f6b0460a583",  
            "displayName": "test", 
            "size": 1, 
            "status": "creating", 
            "volumeId": "ba5730ea-8621-4ae8-b702-ff0ffc12c209"
        }
}

Returned Values

See General Request Returned Values.