# Public Cloud › Storage › Volume Snapshot API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Public Cloud product's sections: https://developers.eu.ovhcloud.com/reference/public-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/public-cloud/storage/volume-snapshot/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/public-cloud/storage/volume-snapshot.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/public-cloud/storage/volume-snapshot.json?format=openapi3

## Operations

- `GET /publicCloud/project/{projectId}/storage/block/snapshot` — List snapshots
- `GET /publicCloud/project/{projectId}/storage/block/snapshot/{id}` — Get a snapshot
- `POST /publicCloud/project/{projectId}/storage/block/snapshot` — Create a snapshot
- `DELETE /publicCloud/project/{projectId}/storage/block/snapshot/{id}` — Delete a snapshot
- `PUT /publicCloud/project/{projectId}/storage/block/snapshot/{id}` — Update a snapshot

## List snapshots

`GET /v2/publicCloud/project/{projectId}/storage/block/snapshot`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/storage/volume-snapshot/#getVolumeSnapshots

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:volume/snapshot/get`

Returns the volume snapshots of the project.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `projectId` | path | string | yes | Project ID |
| `volumeId` | query | string (uuid) |  | Filter by source volume ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.blockStorage.Snapshot[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the snapshot |
| `currentState` | publicCloud.blockStorage.SnapshotCurrentState | read-only | Current observed state of the snapshot from the infrastructure |
| `currentState.description` | string | read-only | Snapshot description |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current snapshot name |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `currentState.status` | publicCloud.blockStorage.SnapshotStatusEnum | read-only | Snapshot status on the infrastructure — one of `AVAILABLE`, `BACKING_UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `ERROR_DELETING`, `RESTORING`, `UNMANAGING`, `UPDATING` |
| `currentState.volumeId` | string (uuid) | read-only | ID of the volume this snapshot was created from |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the snapshot |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the snapshot |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Snapshot readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.SnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Desired snapshot description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired snapshot name |
| `targetSpec.volumeId` | string (uuid) | yes | ID of the volume to snapshot |
| `updatedAt` | string (date-time) | read-only | Last update date of the snapshot |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "description": "string",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "name": "string",
      "size": 0,
      "status": "AVAILABLE",
      "volumeId": "00000000-0000-0000-0000-000000000000"
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "description": "string",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "name": "string",
      "volumeId": "00000000-0000-0000-0000-000000000000"
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/snapshot" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/storage/block/snapshot")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/storage/block/snapshot");

print_r($result);
?>
```

## Get a snapshot

`GET /v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/storage/volume-snapshot/#getVolumeSnapshot

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:volume/snapshot/get`

Returns the snapshot configuration and its current state, including its size and source volume.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | Id |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.blockStorage.Snapshot | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the snapshot |
| `currentState` | publicCloud.blockStorage.SnapshotCurrentState | read-only | Current observed state of the snapshot from the infrastructure |
| `currentState.description` | string | read-only | Snapshot description |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current snapshot name |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `currentState.status` | publicCloud.blockStorage.SnapshotStatusEnum | read-only | Snapshot status on the infrastructure — one of `AVAILABLE`, `BACKING_UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `ERROR_DELETING`, `RESTORING`, `UNMANAGING`, `UPDATING` |
| `currentState.volumeId` | string (uuid) | read-only | ID of the volume this snapshot was created from |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the snapshot |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the snapshot |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Snapshot readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.SnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Desired snapshot description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired snapshot name |
| `targetSpec.volumeId` | string (uuid) | yes | ID of the volume to snapshot |
| `updatedAt` | string (date-time) | read-only | Last update date of the snapshot |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "status": "AVAILABLE",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}");

print_r($result);
?>
```

## Create a snapshot

`POST /v2/publicCloud/project/{projectId}/storage/block/snapshot`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/storage/volume-snapshot/#createVolumeSnapshot

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:volume/snapshot/create`

Creates a snapshot of a volume. A new volume can then be created from it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.blockStorage.SnapshotCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.blockStorage.SnapshotTargetSpec | yes | Desired target specification for the snapshot |
| `targetSpec.description` | string |  | Desired snapshot description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired snapshot name |
| `targetSpec.volumeId` | string (uuid) | yes | ID of the volume to snapshot |

```json
{
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.blockStorage.Snapshot | successful operation |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the snapshot |
| `currentState` | publicCloud.blockStorage.SnapshotCurrentState | read-only | Current observed state of the snapshot from the infrastructure |
| `currentState.description` | string | read-only | Snapshot description |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current snapshot name |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `currentState.status` | publicCloud.blockStorage.SnapshotStatusEnum | read-only | Snapshot status on the infrastructure — one of `AVAILABLE`, `BACKING_UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `ERROR_DELETING`, `RESTORING`, `UNMANAGING`, `UPDATING` |
| `currentState.volumeId` | string (uuid) | read-only | ID of the volume this snapshot was created from |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the snapshot |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the snapshot |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Snapshot readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.SnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Desired snapshot description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired snapshot name |
| `targetSpec.volumeId` | string (uuid) | yes | ID of the volume to snapshot |
| `updatedAt` | string (date-time) | read-only | Last update date of the snapshot |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "status": "AVAILABLE",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/snapshot" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.blockStorage.SnapshotCreation
result = client.post("/v2/publicCloud/project/{projectId}/storage/block/snapshot",
	targetSpec = None, # Desired target specification for the snapshot (type: publicCloud.blockStorage.SnapshotTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.blockStorage.SnapshotCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/storage/block/snapshot", array(
	targetSpec => null, // Desired target specification for the snapshot (type: publicCloud.blockStorage.SnapshotTargetSpec)
));

print_r($result);
?>
```

## Delete a snapshot

`DELETE /v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/storage/volume-snapshot/#deleteVolumeSnapshot

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:volume/snapshot/delete`

Deletes the snapshot.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | Id |
| `projectId` | path | string | yes | Project ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.blockStorage.Snapshot | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the snapshot |
| `currentState` | publicCloud.blockStorage.SnapshotCurrentState | read-only | Current observed state of the snapshot from the infrastructure |
| `currentState.description` | string | read-only | Snapshot description |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current snapshot name |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `currentState.status` | publicCloud.blockStorage.SnapshotStatusEnum | read-only | Snapshot status on the infrastructure — one of `AVAILABLE`, `BACKING_UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `ERROR_DELETING`, `RESTORING`, `UNMANAGING`, `UPDATING` |
| `currentState.volumeId` | string (uuid) | read-only | ID of the volume this snapshot was created from |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the snapshot |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the snapshot |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Snapshot readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.SnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Desired snapshot description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired snapshot name |
| `targetSpec.volumeId` | string (uuid) | yes | ID of the volume to snapshot |
| `updatedAt` | string (date-time) | read-only | Last update date of the snapshot |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "status": "AVAILABLE",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}");

print_r($result);
?>
```

## Update a snapshot

`PUT /v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}`

Link: https://developers.eu.ovhcloud.com/reference/public-cloud/storage/volume-snapshot/#editVolumeSnapshot

**Status:** Stable production version  
**IAM actions:** `publicCloudProject:apiovh:volume/snapshot/edit`

Updates the snapshot name and description. Send the current checksum to prevent overwriting a concurrent change.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | Id |
| `projectId` | path | string | yes | Project ID |

### Request body (required)

Type: `publicCloud.blockStorage.SnapshotUpdate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). |
| `targetSpec` | publicCloud.blockStorage.SnapshotUpdateTargetSpec | yes | Desired target specification for the snapshot |
| `targetSpec.description` | string |  | Desired snapshot description |
| `targetSpec.name` | string | yes | Desired snapshot name |

```json
{
  "checksum": "string",
  "targetSpec": {
    "description": "string",
    "name": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.blockStorage.Snapshot | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Computed hash representing the current target specification value |
| `createdAt` | string (date-time) | read-only | Creation date of the snapshot |
| `currentState` | publicCloud.blockStorage.SnapshotCurrentState | read-only | Current observed state of the snapshot from the infrastructure |
| `currentState.description` | string | read-only | Snapshot description |
| `currentState.location` | publicCloud.common.Location | read-only | Current location |
| `currentState.location.availabilityZone` | string |  | Availability zone within the region |
| `currentState.location.region` | string | yes | Region code |
| `currentState.name` | string | read-only | Current snapshot name |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `currentState.status` | publicCloud.blockStorage.SnapshotStatusEnum | read-only | Snapshot status on the infrastructure — one of `AVAILABLE`, `BACKING_UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `ERROR_DELETING`, `RESTORING`, `UNMANAGING`, `UPDATING` |
| `currentState.volumeId` | string (uuid) | read-only | ID of the volume this snapshot was created from |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the snapshot |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Unique identifier of the snapshot |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Snapshot readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.SnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Desired snapshot description |
| `targetSpec.location` | publicCloud.common.Location | yes | Target location |
| `targetSpec.location.availabilityZone` | string |  | Availability zone within the region |
| `targetSpec.location.region` | string | yes | Region code |
| `targetSpec.name` | string | yes | Desired snapshot name |
| `targetSpec.volumeId` | string (uuid) | yes | ID of the volume to snapshot |
| `updatedAt` | string (date-time) | read-only | Last update date of the snapshot |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "status": "AVAILABLE",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "volumeId": "00000000-0000-0000-0000-000000000000"
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: publicCloud.blockStorage.SnapshotUpdate
result = client.put("/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}",
	checksum = None, # Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec = None, # Desired target specification for the snapshot (type: publicCloud.blockStorage.SnapshotUpdateTargetSpec)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: publicCloud.blockStorage.SnapshotUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/storage/block/snapshot/{id}", array(
	checksum => null, // Optional concurrency-control checksum. When supplied, it must match the resource's current checksum or the request is rejected with a 409 checksum-mismatch conflict. When omitted or empty, the concurrency check is skipped and the write is forced (last-write-wins). (type: string, nullable)
	targetSpec => null, // Desired target specification for the snapshot (type: publicCloud.blockStorage.SnapshotUpdateTargetSpec)
));

print_r($result);
?>
```
