netapp_snapshot_policies
Creates, updates, deletes, gets or lists a netapp_snapshot_policies resource.
Overview​
| Name | netapp_snapshot_policies |
| Type | Resource |
| Id | ovh.storage.netapp_snapshot_policies |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Snapshot policy ID |
name | string | Snapshot policy name |
created_at | string (date-time) | Snapshot policy creation date (wire: createdAt) |
description | string | Snapshot policy description |
is_default | boolean | Is this the default snapshot policy? (wire: isDefault) |
rules | array | Snapshot policy rules, 1 to 4 |
status | string | Snapshot policy status (available, creating, deleting, error, updating) |
A snapshot policy
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Snapshot policy ID |
name | string | Snapshot policy name |
created_at | string (date-time) | Snapshot policy creation date (wire: createdAt) |
description | string | Snapshot policy description |
is_default | boolean | Is this the default snapshot policy? (wire: isDefault) |
rules | array | Snapshot policy rules, 1 to 4 |
status | string | Snapshot policy status (available, creating, deleting, error, updating) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name, snapshot_policy_id | Returns the snapshot policy with its rules and status. A policy can be updated, deleted or assigned to a share only when its status is available. | |
list | select | service_name | Returns the snapshot policies, including the default one. Each item contains only the policy ID and name: get a snapshot policy to read its rules and status. | |
create | insert | service_name, rules | Creates a policy made of rules, each with a schedule, a snapshot name prefix and a number of copies to keep. Creation is asynchronous: follow the snapshot policy status until it is available. The policy takes effect only once it is assigned to a share. | |
update | update | service_name, snapshot_policy_id | Updates the policy name and description. Rules cannot be changed: create a new policy instead. The policy must be available, and the default policy cannot be updated. | |
delete | delete | service_name, snapshot_policy_id | Deletes the snapshot policy and its schedules. A policy applied to a share cannot be deleted: apply another non-default policy to the share first. The default policy cannot be deleted, and deletion is asynchronous: follow the snapshot policy status until the policy is no longer found. |
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 (uuid) | Service name (wire: serviceName) |
snapshot_policy_id | string (uuid) | Snapshot policy ID (wire: snapshotPolicyId) |
SELECT examples​
- get
- list
Returns the snapshot policy with its rules and status. A policy can be updated, deleted or assigned to a share only when its status is available.
SELECT
id,
name,
created_at,
description,
is_default,
rules,
status
FROM ovh.storage.netapp_snapshot_policies
WHERE service_name = '{{ service_name }}' -- required
AND snapshot_policy_id = '{{ snapshot_policy_id }}' -- required
;
Returns the snapshot policies, including the default one. Each item contains only the policy ID and name: get a snapshot policy to read its rules and status.
SELECT
id,
name,
created_at,
description,
is_default,
rules,
status
FROM ovh.storage.netapp_snapshot_policies
WHERE service_name = '{{ service_name }}' -- required
;
INSERT examples​
- create
- Manifest
Creates a policy made of rules, each with a schedule, a snapshot name prefix and a number of copies to keep. Creation is asynchronous: follow the snapshot policy status until it is available. The policy takes effect only once it is assigned to a share.
INSERT INTO ovh.storage.netapp_snapshot_policies (
description,
name,
rules,
service_name
)
SELECT
'{{ description }}',
'{{ name }}',
'{{ rules }}' /* required */,
'{{ service_name }}'
RETURNING
id,
name,
created_at,
description,
is_default,
rules,
status
;
# Description fields are for documentation purposes
- name: netapp_snapshot_policies
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the netapp_snapshot_policies resource.
- name: description
value: "{{ description }}"
description: |
Snapshot policy description
- name: name
value: "{{ name }}"
description: |
Snapshot policy name
- name: rules
description: |
Snapshot policy rules, 1 to 4
value:
- copies: {{ copies }}
prefix: "{{ prefix }}"
schedule:
days:
- {{ days }}
hours:
- {{ hours }}
minutes:
- {{ minutes }}
months:
- {{ months }}
weekdays:
- {{ weekdays }}
UPDATE examples​
- update
Updates the policy name and description. Rules cannot be changed: create a new policy instead. The policy must be available, and the default policy cannot be updated.
UPDATE ovh.storage.netapp_snapshot_policies
SET
description = '{{ description }}',
name = '{{ name }}'
WHERE
service_name = '{{ service_name }}' --required
AND snapshot_policy_id = '{{ snapshot_policy_id }}' --required;
DELETE examples​
- delete
Deletes the snapshot policy and its schedules. A policy applied to a share cannot be deleted: apply another non-default policy to the share first. The default policy cannot be deleted, and deletion is asynchronous: follow the snapshot policy status until the policy is no longer found.
DELETE FROM ovh.storage.netapp_snapshot_policies
WHERE service_name = '{{ service_name }}' --required
AND snapshot_policy_id = '{{ snapshot_policy_id }}' --required
;