# Public Cloud › Storage › Volume Backup 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-backup/

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

## Operations

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

## List backups

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

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

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

Returns the volume backups 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.Backup[] | 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 backup |
| `currentState` | publicCloud.blockStorage.BackupCurrentState | read-only | Current observed state of the backup from the infrastructure |
| `currentState.description` | string | read-only | Backup 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 backup name |
| `currentState.size` | integer | read-only | Size of the backup in GB |
| `currentState.volumeId` | string (uuid) | read-only | Identifier of the source volume |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the backup |
| `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 backup |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Backup readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.BackupTargetSpec | read-only | Last target specification of the backup |
| `targetSpec.description` | string |  | Desired backup 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 backup name |
| `targetSpec.volumeId` | string (uuid) | yes | Identifier of the source volume to backup |
| `updatedAt` | string (date-time) | read-only | Last update date of the backup |

```json
[
  {
    "checksum": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "currentState": {
      "description": "string",
      "location": {
        "availabilityZone": "string",
        "region": "string"
      },
      "name": "string",
      "size": 0,
      "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/backup" \
  -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/backup")

# 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/backup");

print_r($result);
?>
```

## Get a backup

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

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

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

Returns the backup 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.Backup | 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 backup |
| `currentState` | publicCloud.blockStorage.BackupCurrentState | read-only | Current observed state of the backup from the infrastructure |
| `currentState.description` | string | read-only | Backup 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 backup name |
| `currentState.size` | integer | read-only | Size of the backup in GB |
| `currentState.volumeId` | string (uuid) | read-only | Identifier of the source volume |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the backup |
| `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 backup |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Backup readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.BackupTargetSpec | read-only | Last target specification of the backup |
| `targetSpec.description` | string |  | Desired backup 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 backup name |
| `targetSpec.volumeId` | string (uuid) | yes | Identifier of the source volume to backup |
| `updatedAt` | string (date-time) | read-only | Last update date of the backup |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "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/backup/{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/backup/{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/backup/{id}");

print_r($result);
?>
```

## Create a backup

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

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

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

Creates a backup of a volume in the given region.

### Parameters

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

### Request body (required)

Type: `publicCloud.blockStorage.BackupCreation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | publicCloud.blockStorage.BackupTargetSpec | yes | Desired target specification for the backup |
| `targetSpec.description` | string |  | Desired backup 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 backup name |
| `targetSpec.volumeId` | string (uuid) | yes | Identifier of the source volume to backup |

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.blockStorage.Backup | 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 backup |
| `currentState` | publicCloud.blockStorage.BackupCurrentState | read-only | Current observed state of the backup from the infrastructure |
| `currentState.description` | string | read-only | Backup 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 backup name |
| `currentState.size` | integer | read-only | Size of the backup in GB |
| `currentState.volumeId` | string (uuid) | read-only | Identifier of the source volume |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the backup |
| `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 backup |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Backup readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.BackupTargetSpec | read-only | Last target specification of the backup |
| `targetSpec.description` | string |  | Desired backup 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 backup name |
| `targetSpec.volumeId` | string (uuid) | yes | Identifier of the source volume to backup |
| `updatedAt` | string (date-time) | read-only | Last update date of the backup |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "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/backup" \
  -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.BackupCreation
result = client.post("/v2/publicCloud/project/{projectId}/storage/block/backup",
	targetSpec = None, # Desired target specification for the backup (type: publicCloud.blockStorage.BackupTargetSpec)
)

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

print_r($result);
?>
```

## Delete a backup

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

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

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

Deletes the backup.

### 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.Backup | 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 backup |
| `currentState` | publicCloud.blockStorage.BackupCurrentState | read-only | Current observed state of the backup from the infrastructure |
| `currentState.description` | string | read-only | Backup 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 backup name |
| `currentState.size` | integer | read-only | Size of the backup in GB |
| `currentState.volumeId` | string (uuid) | read-only | Identifier of the source volume |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the backup |
| `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 backup |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Backup readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.BackupTargetSpec | read-only | Last target specification of the backup |
| `targetSpec.description` | string |  | Desired backup 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 backup name |
| `targetSpec.volumeId` | string (uuid) | yes | Identifier of the source volume to backup |
| `updatedAt` | string (date-time) | read-only | Last update date of the backup |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "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/backup/{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/backup/{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/backup/{id}");

print_r($result);
?>
```

## Update a backup

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

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

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

Updates the backup 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.BackupUpdate`

| 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.BackupUpdateTargetSpec | yes | Desired target specification for the backup |
| `targetSpec.description` | string |  | Desired backup description |
| `targetSpec.name` | string |  | Desired backup name |

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | publicCloud.blockStorage.Backup | 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 backup |
| `currentState` | publicCloud.blockStorage.BackupCurrentState | read-only | Current observed state of the backup from the infrastructure |
| `currentState.description` | string | read-only | Backup 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 backup name |
| `currentState.size` | integer | read-only | Size of the backup in GB |
| `currentState.volumeId` | string (uuid) | read-only | Identifier of the source volume |
| `currentTasks` | common.CurrentTask[] | read-only | Ongoing asynchronous tasks related to the backup |
| `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 backup |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Backup readiness in the system — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | publicCloud.blockStorage.BackupTargetSpec | read-only | Last target specification of the backup |
| `targetSpec.description` | string |  | Desired backup 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 backup name |
| `targetSpec.volumeId` | string (uuid) | yes | Identifier of the source volume to backup |
| `updatedAt` | string (date-time) | read-only | Last update date of the backup |

```json
{
  "checksum": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "currentState": {
    "description": "string",
    "location": {
      "availabilityZone": "string",
      "region": "string"
    },
    "name": "string",
    "size": 0,
    "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/backup/{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.BackupUpdate
result = client.put("/v2/publicCloud/project/{projectId}/storage/block/backup/{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 backup (type: publicCloud.blockStorage.BackupUpdateTargetSpec)
)

# 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.BackupUpdate
$result = $ovh->put("/v2/publicCloud/project/{projectId}/storage/block/backup/{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 backup (type: publicCloud.blockStorage.BackupUpdateTargetSpec)
));

print_r($result);
?>
```
