Skip to main content

region_share_snapshots

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

Overview​

Nameregion_share_snapshots
TypeResource
Idovh.cloud_storage.region_share_snapshots

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Snapshot ID
namestringSnapshot name
share_idstring (uuid)Share ID (wire: shareId)
created_atstring (date-time)The date and timestamp when the resource was created (wire: createdAt)
descriptionstringSnapshot description
share_protocolstringShare protocol (NFS) (wire: shareProtocol)
share_sizeintegerShare size in GB (wire: shareSize)
sizeintegerSnapshot size in GB
statusstringSnapshot status (available, creating, deleting, error, error_deleting, manage_error, manage_starting, restoring, unmanage_error, unmanage_starting)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectregion_name, share_id, snapshot_id, service_nameGet share snapshot
listselectregion_name, share_id, service_nameGet share snapshots
createinsertregion_name, share_id, service_nameCreate share snapshot
deletedeleteregion_name, share_id, snapshot_id, service_nameDelete share 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.

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"}})
region_namestringRegion name (wire: regionName)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
share_idstring (uuid)Share ID (wire: shareId)
snapshot_idstring (uuid)Snapshot ID (wire: snapshotId)

SELECT examples​

Get share snapshot

SELECT
id,
name,
share_id,
created_at,
description,
share_protocol,
share_size,
size,
status
FROM ovh.cloud_storage.region_share_snapshots
WHERE region_name = '{{ region_name }}' -- required
AND share_id = '{{ share_id }}' -- required
AND snapshot_id = '{{ snapshot_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create share snapshot

INSERT INTO ovh.cloud_storage.region_share_snapshots (
description,
name,
region_name,
share_id,
service_name
)
SELECT
'{{ description }}',
'{{ name }}',
'{{ region_name }}',
'{{ share_id }}',
'{{ service_name }}'
RETURNING
id,
name,
share_id,
created_at,
description,
share_protocol,
share_size,
size,
status
;

DELETE examples​

Delete share snapshot

DELETE FROM ovh.cloud_storage.region_share_snapshots
WHERE region_name = '{{ region_name }}' --required
AND share_id = '{{ share_id }}' --required
AND snapshot_id = '{{ snapshot_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;