volume_snapshots
Creates, updates, deletes, gets or lists a volume_snapshots resource.
Overview​
| Name | volume_snapshots |
| Type | Resource |
| Id | ovh.cloud_storage.volume_snapshots |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string | Snapshot id |
name | string | Snapshot name |
volume_id | string | Volume source id (wire: volumeId) |
creation_date | string (date-time) | Snapshot creation date (wire: creationDate) |
description | string | Snapshot description |
plan_code | string | Order plan code (wire: planCode) |
region | string | Snapshot region |
size | integer | Snapshot size |
status | string | Snapshot status (available, creating, deleting, error, error_deleting) |
Snapshot
| Name | Datatype | Description |
|---|---|---|
id | string | Snapshot id |
name | string | Snapshot name |
volume_id | string | Volume source id (wire: volumeId) |
creation_date | string (date-time) | Snapshot creation date (wire: creationDate) |
description | string | Snapshot description |
plan_code | string | Order plan code (wire: planCode) |
region | string | Snapshot region |
size | integer | Snapshot size |
status | string | Snapshot status (available, creating, deleting, error, error_deleting) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | snapshot_id, service_name | Get volume snapshot details | |
list | select | service_name | region | Get volume snapshots |
delete | delete | snapshot_id, service_name | Delete a volume snapshot |
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"}}) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
snapshot_id | string | Snapshot ID (wire: snapshotId) |
region | string | Snapshots region |
SELECT examples​
- get
- list
Get volume snapshot details
SELECT
id,
name,
volume_id,
creation_date,
description,
plan_code,
region,
size,
status
FROM ovh.cloud_storage.volume_snapshots
WHERE snapshot_id = '{{ snapshot_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Get volume snapshots
SELECT
id,
name,
volume_id,
creation_date,
description,
plan_code,
region,
size,
status
FROM ovh.cloud_storage.volume_snapshots
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND region = '{{ region }}'
;
DELETE examples​
- delete
Delete a volume snapshot
DELETE FROM ovh.cloud_storage.volume_snapshots
WHERE snapshot_id = '{{ snapshot_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;