Skip to main content

disks

Creates, updates, deletes, gets or lists a disks resource.

Overview​

Namedisks
TypeResource
Idovh.vps.disks

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idinteger
service_namestringService name (wire: serviceName)
bandwidth_limitinteger (wire: bandwidthLimit)
low_free_space_thresholdintegerThe low disk free space threshold in MiB (wire: lowFreeSpaceThreshold)
monitoringbooleanThe monitoring state of this disk
sizeinteger
statestringPossible states the disk can be in (connected, disconnected, pending)
typestringPossible type a disk can be in (additional, primary)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, service_nameReturns the type, size, state, monitoring, bandwidth limit and low free space threshold of a disk of the VPS.
listselectservice_namex_pagination_modeReturns the IDs of the disks attached to the VPS.
updateupdateid, service_nameUpdates the monitoring state and the low free space threshold of a disk of the VPS.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
idintegerId
service_namestringService name (wire: serviceName)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Returns the type, size, state, monitoring, bandwidth limit and low free space threshold of a disk of the VPS.

SELECT
id,
service_name,
bandwidth_limit,
low_free_space_threshold,
monitoring,
size,
state,
type
FROM ovh.vps.disks
WHERE id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

UPDATE examples​

Updates the monitoring state and the low free space threshold of a disk of the VPS.

UPDATE ovh.vps.disks
SET
low_free_space_threshold = {{ low_free_space_threshold }},
monitoring = {{ monitoring }}
WHERE
id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required;