• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  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.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

Request parameters

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Type

Mandatory

Description

display_description

String

No

Specifies the snapshot description.

volume_id

String

Yes

Specifies the volume ID.

display_name

String

No

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

Boolean

No

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

Response parameters

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Type

Mandatory

Description

id

String

Yes

Specifies the disk snapshot ID in UUID format.

status

String

Yes

Specifies the volume snapshot status.

displayName

String

No

Specifies the volume snapshot name.

displayDescription

String

No

Specifies the volume snapshot description.

createdAt

String

Yes

Specifies the time when the volume snapshot was created.

volumeId

String

Yes

Specifies the disk ID in UUID format for the snapshot.

size

Int

Yes

Specifies the volume snapshot size.

Examples

  • 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.