snapshots
Creates, updates, deletes, gets or lists a snapshots resource.
Overview​
| Name | snapshots |
| Type | Resource |
| Id | ovh.cloud.snapshots |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string | Image id |
name | string | Image name |
creation_date | string (date-time) | Image creation date (wire: creationDate) |
flavor_type | string | Image usable only for this type of flavor if not null (wire: flavorType) |
min_disk | integer | Minimum disks required to use image (in GB) (wire: minDisk) |
min_ram | integer | Minimum RAM required to use image (in MB) (wire: minRam) |
plan_code | string | Order plan code (wire: planCode) |
region | string | Image region |
size | number | Image size (in GiB) |
status | string | Image status |
tags | array | Tags about the image |
type | string | Image type |
user | string | User to connect with |
visibility | string | Image visibility |
Image
| Name | Datatype | Description |
|---|---|---|
id | string | Image id |
name | string | Image name |
creation_date | string (date-time) | Image creation date (wire: creationDate) |
flavor_type | string | Image usable only for this type of flavor if not null (wire: flavorType) |
min_disk | integer | Minimum disks required to use image (in GB) (wire: minDisk) |
min_ram | integer | Minimum RAM required to use image (in MB) (wire: minRam) |
plan_code | string | Order plan code (wire: planCode) |
region | string | Image region |
size | number | Image size (in GiB) |
status | string | Image status |
tags | array | Tags about the image |
type | string | Image type |
user | string | User to connect with |
visibility | string | Image visibility |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | image_id, service_name | Get snapshot details | |
list | select | service_name | flavor_type, instance_id, region | Get snapshots |
delete | delete | image_id, service_name | Delete a 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"}}) |
image_id | string | Image ID (wire: imageId) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
flavor_type | string | Get compatible snapshots with flavor type (wire: flavorType) |
instance_id | string (uuid) | Get snapshots created from this instance (wire: instanceId) |
region | string | Region |
SELECT examples​
- get
- list
Get snapshot details
SELECT
id,
name,
creation_date,
flavor_type,
min_disk,
min_ram,
plan_code,
region,
size,
status,
tags,
type,
user,
visibility
FROM ovh.cloud.snapshots
WHERE image_id = '{{ image_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Get snapshots
SELECT
id,
name,
creation_date,
flavor_type,
min_disk,
min_ram,
plan_code,
region,
size,
status,
tags,
type,
user,
visibility
FROM ovh.cloud.snapshots
WHERE service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND flavor_type = '{{ flavor_type }}'
AND instance_id = '{{ instance_id }}'
AND region = '{{ region }}'
;
DELETE examples​
- delete
Delete a snapshot
DELETE FROM ovh.cloud.snapshots
WHERE image_id = '{{ image_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;