• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Snapshots
  6. Creating a Snapshot

Creating a Snapshot

Function Description

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

URI

  • URI format

    POST /v2/{tenant_id}/os-snapshots

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

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

Restrictions

The name of the snapshot created by a user cannot be prefixed with autobk_snapshot.

This interface will become invalid from micro version 2.36. Since this version, the system will return error 404 when you invoke this interface. Using the corresponding storage service interface is recommended.

Request

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

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.

Request Example

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"
}
}

Response Example

{
    "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.