Skip to main content

netapp_share_snapshots

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

Overview​

Namenetapp_share_snapshots
TypeResource
Idovh.storage.netapp_share_snapshots

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Snapshot ID
namestringSnapshot name
created_atstring (date-time)Snapshot creation date (wire: createdAt)
descriptionstringSnapshot description
pathstringSnapshot path
statusstringSnapshot status (available, creating, deleting, error, error_deleting, manage_error, manage_starting, restoring, unmanage_error, unmanage_starting)
typestringSnapshot type (automatic, manual, system)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_name, share_id, snapshot_idReturns the snapshot properties, its status and its type: manual, automatic when taken by the snapshot policy, or system. Holding an automatic snapshot turns it into a manual snapshot with a new ID.
listselectservice_name, share_iddetailReturns the ID and name of each snapshot of the share, including the snapshots taken automatically and by the system. Set detail to true to get all snapshot properties, such as their type and status.
createinsertservice_name, share_idCreates a manual snapshot of the share. Creation is asynchronous: the snapshot is returned with status creating, follow its status until available. The share must be in status available.
updateupdateservice_name, share_id, snapshot_idUpdates the snapshot name and description. Only manual snapshots can be updated: hold an automatic snapshot first.
deletedeleteservice_name, share_id, snapshot_idPermanently deletes the snapshot. Deletion is asynchronous: follow the snapshot until it no longer exists. System snapshots cannot be deleted, and a manual snapshot must be in status available or error.
holdexecserviceName, shareId, snapshotIdConverts an automatic snapshot into a manual snapshot with a new ID, which the snapshot policy no longer deletes. Holding is asynchronous: follow the status of the returned snapshot until it is available. A held snapshot will not be released and is kept until you delete it. (Beta version)

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"}})
serviceNamestring (uuid)Service name
service_namestring (uuid)Service name (wire: serviceName)
shareIdstring (uuid)Share ID
share_idstring (uuid)Share ID (wire: shareId)
snapshotIdstring (uuid)Snapshot ID
snapshot_idstring (uuid)Snapshot ID (wire: snapshotId)
detailbooleanGet detailed information about each snapshot

SELECT examples​

Returns the snapshot properties, its status and its type: manual, automatic when taken by the snapshot policy, or system. Holding an automatic snapshot turns it into a manual snapshot with a new ID.

SELECT
id,
name,
created_at,
description,
path,
status,
type
FROM ovh.storage.netapp_share_snapshots
WHERE service_name = '{{ service_name }}' -- required
AND share_id = '{{ share_id }}' -- required
AND snapshot_id = '{{ snapshot_id }}' -- required
;

INSERT examples​

Creates a manual snapshot of the share. Creation is asynchronous: the snapshot is returned with status creating, follow its status until available. The share must be in status available.

INSERT INTO ovh.storage.netapp_share_snapshots (
description,
name,
service_name,
share_id
)
SELECT
'{{ description }}',
'{{ name }}',
'{{ service_name }}',
'{{ share_id }}'
RETURNING
id,
name,
created_at,
description,
path,
status,
type
;

UPDATE examples​

Updates the snapshot name and description. Only manual snapshots can be updated: hold an automatic snapshot first.

UPDATE ovh.storage.netapp_share_snapshots
SET
description = '{{ description }}',
name = '{{ name }}'
WHERE
service_name = '{{ service_name }}' --required
AND share_id = '{{ share_id }}' --required
AND snapshot_id = '{{ snapshot_id }}' --required
RETURNING
id,
name,
created_at,
description,
path,
status,
type;

DELETE examples​

Permanently deletes the snapshot. Deletion is asynchronous: follow the snapshot until it no longer exists. System snapshots cannot be deleted, and a manual snapshot must be in status available or error.

DELETE FROM ovh.storage.netapp_share_snapshots
WHERE service_name = '{{ service_name }}' --required
AND share_id = '{{ share_id }}' --required
AND snapshot_id = '{{ snapshot_id }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Converts an automatic snapshot into a manual snapshot with a new ID, which the snapshot policy no longer deletes. Holding is asynchronous: follow the status of the returned snapshot until it is available. A held snapshot will not be released and is kept until you delete it. (Beta version)

EXEC ovh.storage.netapp_share_snapshots.hold
@serviceName='{{ serviceName }}' --required,
@shareId='{{ shareId }}' --required,
@snapshotId='{{ snapshotId }}' --required
;