netapp_shares
Creates, updates, deletes, gets or lists a netapp_shares resource.
Overview​
| Name | netapp_shares |
| Type | Resource |
| Id | ovh.storage.netapp_shares |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Share ID |
name | string | Share name |
snapshot_id | string | Snapshot ID used to create the share (wire: snapshotID) |
mount_point_name | string | User-defined name used to generate human readable access path for the share (wire: mountPointName) |
access_mode | string | Share access mode (ro, rw) (wire: accessMode) |
created_at | string (date-time) | Share creation date (wire: createdAt) |
description | string | Share description |
protocol | string | Share protocol (NFS) |
size | integer | Share size in GiB |
status | string | Share status (available, awaiting_replication, creating, creating_from_snapshot, deleted, deleting, error, error_deleting, extending, extending_error, inactive, manage_error, manage_starting, migrating, migrating_to, replication_change, reverting, reverting_error, shrinking, shrinking_error, shrinking_possible_data_loss_error, unmanage_error, unmanage_starting, unmanaged) |
A share
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Share ID |
name | string | Share name |
snapshot_id | string | Snapshot ID used to create the share (wire: snapshotID) |
mount_point_name | string | User-defined name used to generate human readable access path for the share (wire: mountPointName) |
access_mode | string | Share access mode (ro, rw) (wire: accessMode) |
created_at | string (date-time) | Share creation date (wire: createdAt) |
description | string | Share description |
protocol | string | Share protocol (NFS) |
size | integer | Share size in GiB |
status | string | Share status (available, awaiting_replication, creating, creating_from_snapshot, deleted, deleting, error, error_deleting, extending, extending_error, inactive, manage_error, manage_starting, migrating, migrating_to, replication_change, reverting, reverting_error, shrinking, shrinking_error, shrinking_possible_data_loss_error, unmanage_error, unmanage_starting, unmanaged) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name, share_id | Returns the share properties, its status and its access mode. To get the paths used to mount the share, list its access paths. | |
list | select | service_name | detail, mount_point_name | Returns the ID and name of each share of the service. Set detail to true to get all share properties. |
create | insert | service_name, protocol, size | Creates an NFS share, empty or from a manual snapshot, in which case the share must be at least the size of the snapshot. Creation is asynchronous: the share is returned with status creating, follow its status until available. The total size of the shares cannot exceed the service capacity. | |
update | update | service_name, share_id | Updates the share name and description. To change the size, use Extend a share or Shrink a share. | |
delete | delete | service_name, share_id | Permanently deletes the share and its ACLs. Deletion is asynchronous. Delete the snapshots and replications of the share first. | |
extend | exec | serviceName, shareId, size | Increases the share to the given size in GB, which must be greater than its current size. The share must be available, and the change is asynchronous: its status moves to extending, then back to available, or to extending_error if it fails. | |
revert | exec | serviceName, shareId, snapshotID | Restores the share content to the given snapshot, which must be the most recent snapshot of the share. Data written after this snapshot is permanently lost. The share and the snapshot must be available, and the revert is asynchronous: follow the share status until it is available, or reverting_error if it fails. (Beta version) | |
shrink | exec | serviceName, shareId, size | Reduces the share to the given size in GB, which must be smaller than its current size. The share must be available, and the change is asynchronous: follow the share status until it is available again. If the new size is smaller than the space already used, the share keeps its current size. |
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) |
detail | boolean | Get detailed information about each share |
mount_point_name | string | If specified, returns only shares with given mount point name (wire: mountPointName) |
SELECT examples​
- get
- list
Returns the share properties, its status and its access mode. To get the paths used to mount the share, list its access paths.
SELECT
id,
name,
snapshot_id,
mount_point_name,
access_mode,
created_at,
description,
protocol,
size,
status
FROM ovh.storage.netapp_shares
WHERE service_name = '{{ service_name }}' -- required
AND share_id = '{{ share_id }}' -- required
;
Returns the ID and name of each share of the service. Set detail to true to get all share properties.
SELECT
id,
name,
snapshot_id,
mount_point_name,
access_mode,
created_at,
description,
protocol,
size,
status
FROM ovh.storage.netapp_shares
WHERE service_name = '{{ service_name }}' -- required
AND detail = '{{ detail }}'
AND mount_point_name = '{{ mount_point_name }}'
;
INSERT examples​
- create
- Manifest
Creates an NFS share, empty or from a manual snapshot, in which case the share must be at least the size of the snapshot. Creation is asynchronous: the share is returned with status creating, follow its status until available. The total size of the shares cannot exceed the service capacity.
INSERT INTO ovh.storage.netapp_shares (
description,
mount_point_name,
name,
protocol,
size,
snapshot_id,
service_name
)
SELECT
'{{ description }}',
'{{ mount_point_name }}',
'{{ name }}',
'{{ protocol }}' /* required */,
{{ size }} /* required */,
'{{ snapshot_id }}',
'{{ service_name }}'
RETURNING
id,
name,
snapshot_id,
mount_point_name,
access_mode,
created_at,
description,
protocol,
size,
status
;
# Description fields are for documentation purposes
- name: netapp_shares
props:
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the netapp_shares resource.
- name: description
value: "{{ description }}"
description: |
Share description
- name: mount_point_name
value: "{{ mount_point_name }}"
description: |
User-defined name used to generate human readable access path for the share
- name: name
value: "{{ name }}"
description: |
Share name
- name: protocol
value: "{{ protocol }}"
description: |
Share protocol
valid_values: ['NFS']
- name: size
value: {{ size }}
description: |
Share size in GiB
- name: snapshot_id
value: "{{ snapshot_id }}"
description: |
Snapshot ID used to create the share
UPDATE examples​
- update
Updates the share name and description. To change the size, use Extend a share or Shrink a share.
UPDATE ovh.storage.netapp_shares
SET
description = '{{ description }}',
name = '{{ name }}'
WHERE
service_name = '{{ service_name }}' --required
AND share_id = '{{ share_id }}' --required
RETURNING
id,
name,
snapshot_id,
mount_point_name,
access_mode,
created_at,
description,
protocol,
size,
status;
DELETE examples​
- delete
Permanently deletes the share and its ACLs. Deletion is asynchronous. Delete the snapshots and replications of the share first.
DELETE FROM ovh.storage.netapp_shares
WHERE service_name = '{{ service_name }}' --required
AND share_id = '{{ share_id }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- extend
- revert
- shrink
Increases the share to the given size in GB, which must be greater than its current size. The share must be available, and the change is asynchronous: its status moves to extending, then back to available, or to extending_error if it fails.
EXEC ovh.storage.netapp_shares.extend
@serviceName='{{ serviceName }}' --required,
@shareId='{{ shareId }}' --required
@@json=
'{
"size": {{ size }}
}'
;
Restores the share content to the given snapshot, which must be the most recent snapshot of the share. Data written after this snapshot is permanently lost. The share and the snapshot must be available, and the revert is asynchronous: follow the share status until it is available, or reverting_error if it fails. (Beta version)
EXEC ovh.storage.netapp_shares.revert
@serviceName='{{ serviceName }}' --required,
@shareId='{{ shareId }}' --required
@@json=
'{
"snapshotID": "{{ snapshotID }}"
}'
;
Reduces the share to the given size in GB, which must be smaller than its current size. The share must be available, and the change is asynchronous: follow the share status until it is available again. If the new size is smaller than the space already used, the share keeps its current size.
EXEC ovh.storage.netapp_shares.shrink
@serviceName='{{ serviceName }}' --required,
@shareId='{{ shareId }}' --required
@@json=
'{
"size": {{ size }}
}'
;