API: Data disks
List, add, grow and delete the extra data disks of a VM, and quote the price first.
Data disks are available on OVHcloud VMs only, and only while the feature is switched on (GET /catalog/features tells you). A disk is part of the VM's subscription: adding or growing one charges the part of the current billing period that is left, and it renews together with the VM. Disks can only grow. Add, grow and delete answer 202; poll GET /orders/{order}/volumes until the status settles. Deleting a disk destroys its data. See Data disks.
List the data disks of a VM
GET /orders/{order}/volumes
Returns the VM's data disks with size, status and price, the root disk size (part of the plan), the limits, and whether the provider quota allows another disk. A disk shows pending, attaching, extending or deleting while a change is running; poll until it settles.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
order |
integer |
Responses
200OK. Returns:data(DataVolumeList).403Not allowed, the resource is not yours422Validation error, or not allowed in the current state
Example
curl -X GET https://veneshcloud.ir/api/orders/ORDER_ID/volumes \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json"
Add a data disk
POST /orders/{order}/volumes
Adds an empty disk to a running or stopped VM. The amount for the rest of the current period is taken from your wallet first and refunded automatically if the provider cannot create the disk. Only one disk change at a time per VM. The disk is raw: format and mount it inside the VM.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
order |
integer |
Request body (application/json)
| Field | Type | Required | Values |
|---|---|---|---|
size_gb |
integer | Yes |
Responses
202Accepted, work continues in the background. Returns:data(DataVolume).403Not allowed, the resource is not yours422Validation error, or not allowed in the current state
Example
curl -X POST https://veneshcloud.ir/api/orders/ORDER_ID/volumes \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"size_gb":1}'
Quote a disk
GET /orders/{order}/volumes/pricing
Returns what a new disk of size_gb costs: the price per billing period and the amount charged now for the rest of the current period, in USD-equivalent and in Rial at today's rate, and whether your wallet covers it. Pass volume_id to quote growing that disk to size_gb (the new total size).
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
order |
integer |
Query parameters
| Field | Type | Values |
|---|---|---|
size_gb |
integer | |
volume_id |
integer |
Responses
200OK. Returns:data(DataVolumePricing).403Not allowed, the resource is not yours422Validation error, or not allowed in the current state
Example
curl -X GET https://veneshcloud.ir/api/orders/ORDER_ID/volumes/pricing \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json"
Make a disk larger
POST /orders/{order}/volumes/{volume}/extend
Grows a data disk to new_size_gb. A disk can only grow, never shrink. Only the added GB are charged, for the rest of the current period. Afterwards grow the filesystem inside the VM.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
order |
integer |
volume |
integer |
Request body (application/json)
| Field | Type | Required | Values |
|---|---|---|---|
new_size_gb |
integer | Yes |
Responses
202Accepted, work continues in the background. Returns:data(DataVolume).403Not allowed, the resource is not yours404Not found422Validation error, or not allowed in the current state
Example
curl -X POST https://veneshcloud.ir/api/orders/ORDER_ID/volumes/VOLUME_ID/extend \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"new_size_gb":1}'
Delete a data disk
DELETE /orders/{order}/volumes/{volume}
Deletes a data disk and all data on it. Not reversible. Once it is gone, the unused part of its paid period is credited to your wallet. Deleting the VM deletes its data disks too.
Authentication: Send your API key or token as a bearer token.
Path parameters
| Field | Type |
|---|---|
order |
integer |
volume |
integer |
Responses
200OK202Accepted, work continues in the background. Returns:data(DataVolume).403Not allowed, the resource is not yours404Not found422Validation error, or not allowed in the current state
Example
curl -X DELETE https://veneshcloud.ir/api/orders/ORDER_ID/volumes/VOLUME_ID \
-H "Authorization: Bearer $VENESH_API_KEY" \
-H "Accept: application/json"
Objects
Field lists for the objects returned above.
DataVolume
| Field | Type | Values |
|---|---|---|
id |
integer | |
order_id |
integer | |
size_gb |
integer | |
device |
string | |
by_id_path |
string | |
status |
string | pending, attaching, active, extending, deleting, failed, kept |
is_initial |
boolean | |
pending_action |
string | create, extend, delete, null |
pending_size_gb |
integer | |
manageable |
boolean | |
failure_reason |
string | |
price_usd |
string | |
price_rial |
integer | |
period_days |
integer | |
next_renewal_at |
string | |
created_at |
string |
DataVolumeList
| Field | Type | Values |
|---|---|---|
root_disk_gb |
integer | |
volumes |
list of DataVolume |
|
limits |
object | |
unit |
object | |
capability |
object | |
can_modify |
boolean | |
blocked_reason |
string | |
paid_until |
string |
DataVolumePricing
| Field | Type | Values |
|---|---|---|
size_gb |
integer | |
delta_gb |
integer | |
unit_usd_per_gb |
string | |
unit_rial_per_gb |
integer | |
period_days |
integer | |
monthly_usd |
string | |
monthly_rial |
integer | |
charge_usd |
string | |
charge_rial |
integer | |
prorated_fraction |
number | |
paid_until |
string | |
renewal_total_usd_after |
string | |
renewal_total_rial_after |
integer | |
wallet_balance_usd |
string | |
wallet_balance_rial |
integer | |
sufficient_balance |
boolean | |
blocked_reason |
string |