disks
Creates, updates, deletes, gets or lists a disks resource.
Overview​
| Name | disks |
| Type | Resource |
| Id | ovh.vps.disks |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | |
service_name | string | Service name (wire: serviceName) |
bandwidth_limit | integer | (wire: bandwidthLimit) |
low_free_space_threshold | integer | The low disk free space threshold in MiB (wire: lowFreeSpaceThreshold) |
monitoring | boolean | The monitoring state of this disk |
size | integer | |
state | string | Possible states the disk can be in (connected, disconnected, pending) |
type | string | Possible type a disk can be in (additional, primary) |
Information about a disk of a VPS Virtual Machine
| Name | Datatype | Description |
|---|---|---|
id | integer | |
service_name | string | Service name (wire: serviceName) |
bandwidth_limit | integer | (wire: bandwidthLimit) |
low_free_space_threshold | integer | The low disk free space threshold in MiB (wire: lowFreeSpaceThreshold) |
monitoring | boolean | The monitoring state of this disk |
size | integer | |
state | string | Possible states the disk can be in (connected, disconnected, pending) |
type | string | Possible type a disk can be in (additional, primary) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, service_name | Returns the type, size, state, monitoring, bandwidth limit and low free space threshold of a disk of the VPS. | |
list | select | service_name | x_pagination_mode | Returns the IDs of the disks attached to the VPS. |
update | update | id, service_name | Updates 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
id | integer | Id |
service_name | string | Service name (wire: serviceName) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
Returns the IDs of the disks attached to the VPS.
SELECT
id,
service_name,
bandwidth_limit,
low_free_space_threshold,
monitoring,
size,
state,
type
FROM ovh.vps.disks
WHERE service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
UPDATE examples​
- update
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;