Creating snapshots

POST /v3/{project_id}/snapshots

Creates a volume snapshot, which is a point-in-time, complete copy of a volume.

Source: https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=create-a-snapshot-detail#create-a-snapshot

Request

Parameters

Name In Type Description
project_id path string The UUID of the project in a multi-tenancy cloud.
snapshot body object A snapshot object.
volume_id body string The UUID of the volume.
name body string The name of the snapshot.
description (Optional) body string A description for the snapshot. Default is None.
force (Optional) body boolean Indicates whether to backup, even if the volume is attached. Default is false.
metadata (Optional) body object One or more metadata key and value pairs for the snapshot.

Example

# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '
{
  "snapshot": {
    "name": "snapshot1",
    "volume_id": "cb623b3c-f14a-48d6-a339-d9fda95be662",
    "force": true
  }
}' https://<node_IP_addr>:8776/v3/f5d834d636c642c7bfe8af86139c6f26/snapshots

Response

Parameters

Name In Type Description
snapshot body object A snapshot object.
user_id body string

The UUID of the user.

New in version 3.41

volume_id body string If the snapshot was created from a volume, the volume ID.
name body string The name of the snapshot.
status body string The status for the snapshot.
description body string A description for the snapshot.
created_at body string

The date and time when the resource was created.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

metadata body object One or more metadata key and value pairs for the snapshot, if any.
id body string The snapshot UUID.
size body integer The size of the volume, in gibibytes (GiB).
count (Optional) body integer

The total count of requested resource before pagination is applied.

New in version 3.45

updated_at body string

The date and time when the resource was updated. If the resource has not been updated, this field will be null.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00.

Status codes

Success

Code Reason
202 - Accepted

Request was accepted for processing, but the processing has not been completed. A ‘location’ header is included in the response which contains a link to check the progress of the request.

Example

{
  "snapshot": {
    "status": "creating",
    "size": 2,
    "metadata": {},
    "name": "snapshot1",
    "volume_id": "cb623b3c-f14a-48d6-a339-d9fda95be662",
    "created_at": "2020-03-11T14:42:02.823364",
    "description": null,
    "id": "a370cf02-f469-4acc-be91-2b27a856806d",
    "updated_at": null
  }
}