# Public Cloud › Storage › File Storage › 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/file-storage/snapshot/

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

## Operations

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

## List snapshots

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

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

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

Returns the file storage 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 |
| `shareId` | query | string (uuid) |  | Filter by source file storage ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.storage.file.FileStorageSnapshot[] | 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.storage.file.FileStorageSnapshotCurrentState | 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 resource 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.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | read-only | Reference to the parent file storage share of the snapshot |
| `currentState.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `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.storage.file.FileStorageSnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Description of the snapshot |
| `targetSpec.name` | string |  | Desired snapshot name |
| `targetSpec.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | yes | Reference to the parent file storage share to snapshot |
| `targetSpec.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `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",
      "share": {
        "id": "00000000-0000-0000-0000-000000000000"
      },
      "size": 0
    },
    "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",
      "name": "string",
      "share": {
        "id": "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/file/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/file/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/file/snapshot");

print_r($result);
?>
```

## Get a snapshot

`GET /v2/publicCloud/project/{projectId}/storage/file/snapshot/{snapshotId}`

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

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

Returns the snapshot and its current state, including its size and source file storage.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.storage.file.FileStorageSnapshot | 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.storage.file.FileStorageSnapshotCurrentState | 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 resource 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.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | read-only | Reference to the parent file storage share of the snapshot |
| `currentState.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `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.storage.file.FileStorageSnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Description of the snapshot |
| `targetSpec.name` | string |  | Desired snapshot name |
| `targetSpec.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | yes | Reference to the parent file storage share to snapshot |
| `targetSpec.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `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",
    "share": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "size": 0
  },
  "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",
    "name": "string",
    "share": {
      "id": "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/file/snapshot/{snapshotId}" \
  -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/file/snapshot/{snapshotId}")

# 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/file/snapshot/{snapshotId}");

print_r($result);
?>
```

## Create a snapshot

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

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

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

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

### Parameters

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

### Request body (required)

Type: `publicCloud.storage.file.FileStorageSnapshotCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.storage.file.FileStorageSnapshotTargetSpec | yes | Desired target specification for the snapshot |
| `targetSpec.description` | string |  | Description of the snapshot |
| `targetSpec.name` | string |  | Desired snapshot name |
| `targetSpec.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | yes | Reference to the parent file storage share to snapshot |
| `targetSpec.share.id` | string (uuid) | yes | Identifier of the parent file storage share |

```json
{
  "targetSpec": {
    "description": "string",
    "name": "string",
    "share": {
      "id": "00000000-0000-0000-0000-000000000000"
    }
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.storage.file.FileStorageSnapshot | successful operation |
| 400 | object | Error 400 response |
| 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.storage.file.FileStorageSnapshotCurrentState | 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 resource 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.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | read-only | Reference to the parent file storage share of the snapshot |
| `currentState.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `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.storage.file.FileStorageSnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Description of the snapshot |
| `targetSpec.name` | string |  | Desired snapshot name |
| `targetSpec.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | yes | Reference to the parent file storage share to snapshot |
| `targetSpec.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `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",
    "share": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "size": 0
  },
  "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",
    "name": "string",
    "share": {
      "id": "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/file/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.storage.file.FileStorageSnapshotCreation
result = client.post("/v2/publicCloud/project/{projectId}/storage/file/snapshot",
	targetSpec = None, # Desired target specification for the snapshot (type: publicCloud.storage.file.FileStorageSnapshotTargetSpec)
)

# 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.storage.file.FileStorageSnapshotCreation
$result = $ovh->post("/v2/publicCloud/project/{projectId}/storage/file/snapshot", array(
	targetSpec => null, // Desired target specification for the snapshot (type: publicCloud.storage.file.FileStorageSnapshotTargetSpec)
));

print_r($result);
?>
```

## Delete a snapshot

`DELETE /v2/publicCloud/project/{projectId}/storage/file/snapshot/{snapshotId}`

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

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

Deletes the snapshot.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.storage.file.FileStorageSnapshot | 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.storage.file.FileStorageSnapshotCurrentState | 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 resource 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.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | read-only | Reference to the parent file storage share of the snapshot |
| `currentState.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `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.storage.file.FileStorageSnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Description of the snapshot |
| `targetSpec.name` | string |  | Desired snapshot name |
| `targetSpec.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | yes | Reference to the parent file storage share to snapshot |
| `targetSpec.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `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",
    "share": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "size": 0
  },
  "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",
    "name": "string",
    "share": {
      "id": "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/file/snapshot/{snapshotId}" \
  -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/file/snapshot/{snapshotId}")

# 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/file/snapshot/{snapshotId}");

print_r($result);
?>
```

## Update a snapshot

`PUT /v2/publicCloud/project/{projectId}/storage/file/snapshot/{snapshotId}`

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

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

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

### Parameters

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

### Request body (required)

Type: `publicCloud.storage.file.FileStorageSnapshotUpdate`

| 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.storage.file.FileStorageSnapshotUpdateTargetSpec | yes | Desired target specification for the snapshot |
| `targetSpec.description` | string |  | Description of the snapshot |
| `targetSpec.name` | string |  | Desired snapshot name |

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.storage.file.FileStorageSnapshot | 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.storage.file.FileStorageSnapshotCurrentState | 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 resource 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.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | read-only | Reference to the parent file storage share of the snapshot |
| `currentState.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `currentState.size` | integer | read-only | Size of the snapshot in GB |
| `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.storage.file.FileStorageSnapshotTargetSpec | read-only | Last target specification of the snapshot |
| `targetSpec.description` | string |  | Description of the snapshot |
| `targetSpec.name` | string |  | Desired snapshot name |
| `targetSpec.share` | publicCloud.storage.file.FileStorageSnapshotShareRef | yes | Reference to the parent file storage share to snapshot |
| `targetSpec.share.id` | string (uuid) | yes | Identifier of the parent file storage share |
| `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",
    "share": {
      "id": "00000000-0000-0000-0000-000000000000"
    },
    "size": 0
  },
  "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",
    "name": "string",
    "share": {
      "id": "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/file/snapshot/{snapshotId}" \
  -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.storage.file.FileStorageSnapshotUpdate
result = client.put("/v2/publicCloud/project/{projectId}/storage/file/snapshot/{snapshotId}",
	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.storage.file.FileStorageSnapshotUpdateTargetSpec)
)

# 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.storage.file.FileStorageSnapshotUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/storage/file/snapshot/{snapshotId}", 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.storage.file.FileStorageSnapshotUpdateTargetSpec)
));

print_r($result);
?>
```
