• Elastic Volume Service

evs
  1. Help Center
  2. Elastic Volume Service
  3. API Reference
  4. OpenStack Cinder API v3
  5. EVS Snapshot
  6. Creating an EVS Snapshot

Creating an EVS Snapshot

Function

This API is used to create an EVS snapshot.

URI

  • URI format

    POST /v3/{project_id}/snapshots

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

Request

  • Parameter description

    Parameter

    Type

    Mandatory

    Description

    snapshot

    map

    Yes

    Specifies the snapshot to be created.

    volume_id

    string

    Yes

    Specifies the UUID of the source EVS disk.

    force

    boolean

    No

    Specifies the flag for forcibly creating a snapshot. The default value is false.

    • If this parameter is set to false and the disk is in the attaching state, the snapshot cannot be forcibly created.
    • If this parameter is set to true and the disk is in the attaching state, the snapshot can be forcibly created.

    metadata

    map

    No

    Specifies the metadata of the EVS snapshot.

    description

    string

    No

    Specifies the description of the EVS snapshot. The value can be null. The value can contain a maximum of 255 bytes.

    name

    string

    No

    Specifies the name of the EVS snapshot. The value can contain a maximum of 255 bytes.

    NOTE:

    When creating a backup for an EVS disk through Volume Backup Service (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 not to use autobk_snapshot_ as the name prefix for the snapshots you created. Otherwise, the snapshots cannot be used normally.

  • Example request
    {
        "snapshot": {
            "name": "snap-001", 
            "description": "Daily backup", 
            "volume_id": "5aa119a8-d25b-45a7-8d1b-88e127885635", 
            "force": false, 
            "metadata": { }
        }
    }

Response

  • Parameter description

    Parameter

    Type

    Description

    snapshot

    map

    Specifies the snapshot information.

    id

    string

    Specifies the ID of the EVS snapshot.

    status

    string

    Specifies the snapshot status. For details, see EVS Snapshot Status.

    name

    string

    Specifies the name of the EVS snapshot.

    description

    string

    Specifies the description of the EVS snapshot.

    created_at

    string

    Specifies the time when the EVS snapshot was created.

    metadata

    map

    Specifies the metadata of the EVS snapshot.

    volume_id

    string

    Specifies the disk to which the snapshot belongs.

    size

    int

    Specifies the size of the EVS snapshot.

    updated_at

    string

    Specifies the time when the snapshot was updated.

    user_id

    string

    Reserved

  • Example response
    {
        "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",
            "user_id":"48d70679b8644035846b2cb53633c256",
            "updated_at": "2013-02-25T03:56:53.081642"
        }
    }

    or

    {
        "error": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

    In the preceding example, error indicates a general error, for example, badRequest or itemNotFound. An example is provided as follows:

    {
        "itemNotFound": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

Returned Values

  • Normal

    202

Error Codes

For details, see Error Codes.