Skip to main content

netapp_shares

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

Overview​

Namenetapp_shares
TypeResource
Idovh.storage.netapp_shares

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Share ID
namestringShare name
snapshot_idstringSnapshot ID used to create the share (wire: snapshotID)
mount_point_namestringUser-defined name used to generate human readable access path for the share (wire: mountPointName)
access_modestringShare access mode (ro, rw) (wire: accessMode)
created_atstring (date-time)Share creation date (wire: createdAt)
descriptionstringShare description
protocolstringShare protocol (NFS)
sizeintegerShare size in GiB
statusstringShare 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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_name, share_idReturns the share properties, its status and its access mode. To get the paths used to mount the share, list its access paths.
listselectservice_namedetail, mount_point_nameReturns the ID and name of each share of the service. Set detail to true to get all share properties.
createinsertservice_name, protocol, sizeCreates 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.
updateupdateservice_name, share_idUpdates the share name and description. To change the size, use Extend a share or Shrink a share.
deletedeleteservice_name, share_idPermanently deletes the share and its ACLs. Deletion is asynchronous. Delete the snapshots and replications of the share first.
extendexecserviceName, shareId, sizeIncreases 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.
revertexecserviceName, shareId, snapshotIDRestores 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)
shrinkexecserviceName, shareId, sizeReduces 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.

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)
detailbooleanGet detailed information about each share
mount_point_namestringIf specified, returns only shares with given mount point name (wire: mountPointName)

SELECT examples​

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
;

INSERT examples​

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
;

UPDATE examples​

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​

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.

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 }}
}'
;