netapp_share_snapshots
Creates, updates, deletes, gets or lists a netapp_share_snapshots resource.
Overview​
| Name | netapp_share_snapshots |
| Type | Resource |
| Id | ovh.storage.netapp_share_snapshots |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Snapshot ID |
name | string | Snapshot name |
created_at | string (date-time) | Snapshot creation date (wire: createdAt) |
description | string | Snapshot description |
path | string | Snapshot path |
status | string | Snapshot status (available, creating, deleting, error, error_deleting, manage_error, manage_starting, restoring, unmanage_error, unmanage_starting) |
type | string | Snapshot type (automatic, manual, system) |
A share snapshot
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Snapshot ID |
name | string | Snapshot name |
created_at | string (date-time) | Snapshot creation date (wire: createdAt) |
description | string | Snapshot description |
path | string | Snapshot path |
status | string | Snapshot status (available, creating, deleting, error, error_deleting, manage_error, manage_starting, restoring, unmanage_error, unmanage_starting) |
type | string | Snapshot type (automatic, manual, system) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name, share_id, snapshot_id | 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. | |
list | select | service_name, share_id | detail | Returns 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. |
create | insert | service_name, share_id | 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. | |
update | update | service_name, share_id, snapshot_id | Updates the snapshot name and description. Only manual snapshots can be updated: hold an automatic snapshot first. | |
delete | delete | service_name, share_id, snapshot_id | 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. | |
hold | exec | serviceName, shareId, snapshotId | 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) |
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"}}) |
serviceName | string (uuid) | Service name |
service_name | string (uuid) | Service name (wire: serviceName) |
shareId | string (uuid) | Share ID |
share_id | string (uuid) | Share ID (wire: shareId) |
snapshotId | string (uuid) | Snapshot ID |
snapshot_id | string (uuid) | Snapshot ID (wire: snapshotId) |
detail | boolean | Get detailed information about each snapshot |
SELECT examples​
- get
- list
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
;
Returns 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.
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 detail = '{{ detail }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: netapp_share_snapshots
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the netapp_share_snapshots resource.
- name: share_id
value: "{{ share_id }}"
description: Required parameter for the netapp_share_snapshots resource.
- name: description
value: "{{ description }}"
description: |
Snapshot description
- name: name
value: "{{ name }}"
description: |
Snapshot name
UPDATE examples​
- update
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​
- delete
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.
- hold
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
;