Skip to content

Block Storage

All operations require authentication.

6 operationsv2/publicCloud/project
Agent setup

List volumesProduction

GET
/v2/publicCloud/project/{projectId}/storage/block/volume

Returns the volumes of the project.

Path parameters

projectId
required
string

Project ID

Headers

X-Pagination-Cursor
string

Pagination cursor

X-Pagination-Size
integer

Pagination size

Response

200Block[]successful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the volume

currentState
read-only
BlockCurrentState

Current observed state of the volume from the infrastructure

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the volume

id
read-only
stringuuid

Unique identifier of the volume

resourceStatus
read-only
ResourceStatusEnum

Volume readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
BlockTargetSpec

Last target specification of the volume

updatedAt
read-only
stringdate-time

Last update date of the volume

Example uses projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/volume \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ { "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "attachedInstances": [ { "id": "00000000-0000-0000-0000-000000000000" } ], "bootable": true, "description": "string", "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "locked": true, "name": "string", "size": 0, "status": "ATTACHING", "volumeType": "CLASSIC" }, "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": { "createFrom": { "backupId": "00000000-0000-0000-0000-000000000000", "imageId": "00000000-0000-0000-0000-000000000000", "snapshotId": "00000000-0000-0000-0000-000000000000" }, "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "size": 0, "volumeType": "CLASSIC" }, "updatedAt": "2024-01-01T12:00:00Z" }]

Get a volumeProduction

GET
/v2/publicCloud/project/{projectId}/storage/block/volume/{id}

Returns the volume configuration and its current state, including the instances it is attached to.

Path parameters

id
required
stringuuid

Id

projectId
required
string

Project ID

Response

200Blocksuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the volume

currentState
read-only
BlockCurrentState

Current observed state of the volume from the infrastructure

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the volume

id
read-only
stringuuid

Unique identifier of the volume

resourceStatus
read-only
ResourceStatusEnum

Volume readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
BlockTargetSpec

Last target specification of the volume

updatedAt
read-only
stringdate-time

Last update date of the volume

404objectError 404 response

Example uses id = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/volume/{id} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "attachedInstances": [ { "id": "00000000-0000-0000-0000-000000000000" } ], "bootable": true, "description": "string", "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "locked": true, "name": "string", "size": 0, "status": "ATTACHING", "volumeType": "CLASSIC" }, "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": { "createFrom": { "backupId": "00000000-0000-0000-0000-000000000000", "imageId": "00000000-0000-0000-0000-000000000000", "snapshotId": "00000000-0000-0000-0000-000000000000" }, "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "size": 0, "volumeType": "CLASSIC" }, "updatedAt": "2024-01-01T12:00:00Z"}

Create a volumeProduction

POST
/v2/publicCloud/project/{projectId}/storage/block/volume

Creates a volume, blank or from a backup, a snapshot or an image. volumeType is required for a blank volume or one created from an image. The source and the encryption can only be set at creation.

Path parameters

projectId
required
string

Project ID

Request body (required)

targetSpec
required
BlockTargetSpec

Desired target specification for the volume

Response

200Blocksuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the volume

currentState
read-only
BlockCurrentState

Current observed state of the volume from the infrastructure

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the volume

id
read-only
stringuuid

Unique identifier of the volume

resourceStatus
read-only
ResourceStatusEnum

Volume readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
BlockTargetSpec

Last target specification of the volume

updatedAt
read-only
stringdate-time

Last update date of the volume

400objectError 400 response
409objectError 409 response

Example uses projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/volume \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "attachedInstances": [ { "id": "00000000-0000-0000-0000-000000000000" } ], "bootable": true, "description": "string", "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "locked": true, "name": "string", "size": 0, "status": "ATTACHING", "volumeType": "CLASSIC" }, "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": { "createFrom": { "backupId": "00000000-0000-0000-0000-000000000000", "imageId": "00000000-0000-0000-0000-000000000000", "snapshotId": "00000000-0000-0000-0000-000000000000" }, "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "size": 0, "volumeType": "CLASSIC" }, "updatedAt": "2024-01-01T12:00:00Z"}

Run an action on a volumeProduction

POST
/v2/publicCloud/project/{projectId}/storage/block/volume/{id}/action

Runs an action on the volume. The only action available is RESTORE_FROM_BACKUP, which restores the volume from the backup given in parameters.backupId.

Path parameters

id
required
stringuuid

Id

projectId
required
string

Project ID

Request body (required)

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).

parameters
BlockActionParameters

Parameters for the action

type
required
VolumeActionTypeEnum

The action to perform

ValuesRESTORE_FROM_BACKUP

Response

200Blocksuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the volume

currentState
read-only
BlockCurrentState

Current observed state of the volume from the infrastructure

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the volume

id
read-only
stringuuid

Unique identifier of the volume

resourceStatus
read-only
ResourceStatusEnum

Volume readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
BlockTargetSpec

Last target specification of the volume

updatedAt
read-only
stringdate-time

Last update date of the volume

400objectError 400 response
404objectError 404 response
409objectError 409 response

Example uses id = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/volume/{id}/action \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "attachedInstances": [ { "id": "00000000-0000-0000-0000-000000000000" } ], "bootable": true, "description": "string", "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "locked": true, "name": "string", "size": 0, "status": "ATTACHING", "volumeType": "CLASSIC" }, "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": { "createFrom": { "backupId": "00000000-0000-0000-0000-000000000000", "imageId": "00000000-0000-0000-0000-000000000000", "snapshotId": "00000000-0000-0000-0000-000000000000" }, "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "size": 0, "volumeType": "CLASSIC" }, "updatedAt": "2024-01-01T12:00:00Z"}

Delete a volumeProduction

DELETE
/v2/publicCloud/project/{projectId}/storage/block/volume/{id}

Deletes the volume. An attached volume cannot be deleted: detach it first.

Path parameters

id
required
stringuuid

Id

projectId
required
string

Project ID

Response

200Blocksuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the volume

currentState
read-only
BlockCurrentState

Current observed state of the volume from the infrastructure

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the volume

id
read-only
stringuuid

Unique identifier of the volume

resourceStatus
read-only
ResourceStatusEnum

Volume readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
BlockTargetSpec

Last target specification of the volume

updatedAt
read-only
stringdate-time

Last update date of the volume

404objectError 404 response
409objectError 409 response

Example uses id = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/volume/{id} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "attachedInstances": [ { "id": "00000000-0000-0000-0000-000000000000" } ], "bootable": true, "description": "string", "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "locked": true, "name": "string", "size": 0, "status": "ATTACHING", "volumeType": "CLASSIC" }, "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": { "createFrom": { "backupId": "00000000-0000-0000-0000-000000000000", "imageId": "00000000-0000-0000-0000-000000000000", "snapshotId": "00000000-0000-0000-0000-000000000000" }, "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "size": 0, "volumeType": "CLASSIC" }, "updatedAt": "2024-01-01T12:00:00Z"}

Update a volumeProduction

PUT
/v2/publicCloud/project/{projectId}/storage/block/volume/{id}

Replaces the volume's target specification as a whole. The body carries the complete desired state of every field publicCloud.blockStorage.BlockUpdateTargetSpec exposes (name, size and volumeType), so read the volume first and restate every value you want to keep: a field left out of targetSpec is cleared, not carried over from the stored specification.

The create-only fields location, encryption and createFrom cannot be changed once the volume exists. They are deliberately absent from the update model, and sending one is rejected with a 400.

name and size are both required. size can only grow: restate the volume's current size to keep it, or send a larger value to extend it, because shrinking a volume is not supported. Leaving size out, or sending 0, is rejected with a 400. Restate volumeType to keep it. Sending a different type triggers an online retype (migration).

The optional checksum guards against a lost update: when supplied it must match the volume's current checksum or the request is rejected with a 409 checksum mismatch. Omitting it skips the check and forces the write (last-write-wins).

Path parameters

id
required
stringuuid

Id

projectId
required
string

Project ID

Request body (required)

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
required
BlockUpdateTargetSpec

Desired target specification for the volume

Response

200Blocksuccessful operation
checksum
read-only
string

Computed hash representing the current target specification value

createdAt
read-only
stringdate-time

Creation date of the volume

currentState
read-only
BlockCurrentState

Current observed state of the volume from the infrastructure

currentTasks
read-only
CurrentTask[]

Ongoing asynchronous tasks related to the volume

id
read-only
stringuuid

Unique identifier of the volume

resourceStatus
read-only
ResourceStatusEnum

Volume readiness in the system

ValuesCREATINGCREATION_PLANNEDDELETINGERROROUT_OF_SYNCREADYSUSPENDEDUNKNOWNUPDATING
targetSpec
read-only
BlockTargetSpec

Last target specification of the volume

updatedAt
read-only
stringdate-time

Last update date of the volume

400objectError 400 response
404objectError 404 response
409objectError 409 response

Example uses id = 00000000-0000-0000-0000-000000000000, projectId = string

$ curl https://api.eu.ovhcloud.com/v2/publicCloud/project/{projectId}/storage/block/volume/{id} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "checksum": "string", "createdAt": "2024-01-01T12:00:00Z", "currentState": { "attachedInstances": [ { "id": "00000000-0000-0000-0000-000000000000" } ], "bootable": true, "description": "string", "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "locked": true, "name": "string", "size": 0, "status": "ATTACHING", "volumeType": "CLASSIC" }, "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": { "createFrom": { "backupId": "00000000-0000-0000-0000-000000000000", "imageId": "00000000-0000-0000-0000-000000000000", "snapshotId": "00000000-0000-0000-0000-000000000000" }, "encryption": { "enabled": true, "kms": { "domainId": "00000000-0000-0000-0000-000000000000", "serviceKeyId": "00000000-0000-0000-0000-000000000000" } }, "location": { "availabilityZone": "string", "region": "string" }, "name": "string", "size": 0, "volumeType": "CLASSIC" }, "updatedAt": "2024-01-01T12:00:00Z"}