Skip to main content

shares

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

Overview

Nameshares
TypeResource
Iddigitalocean.storage.shares

Fields

The following fields are returned by SELECT queries:

The response will be a JSON object with a key called share. The value will be an object containing the standard attributes associated with an NFS share.

NameDatatypeDescription
idstringThe unique identifier of the NFS share. (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d)
namestringThe human-readable name of the share. (example: sammy-share-drive)
access_pointsarrayAccess points configured on this share. The default access point is returned first.
created_atstring (date-time)Timestamp for when the NFS share was created. (example: 2023-01-01T00:00:00Z)
hoststringThe host IP of the NFS server that will be accessible from the associated VPC (example: 10.128.32.2)
mount_pathstringPath at which the share will be available, to be mounted at a target of the user's choice within the client (example: /123456/your-nfs-share-uuid)
performance_tierstringThe performance tier of the share. (example: PERFORMANCE_TIER_HIGH)
regionstringThe DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. (example: atl1)
size_gibintegerThe desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.
statusstringThe current status of the share. INACTIVE means the share exists but is not attached to any VPC. (CREATING, ACTIVE, INACTIVE, FAILED, DELETED) (example: ACTIVE)
vpc_idsarrayList of VPC IDs that should be able to access the share.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
nfs_getselectnfs_idregionTo get an NFS share, send a GET request to /v2/nfs/{nfs_id}?region=${region}.

A successful request will return the NFS share.
nfs_listselectregionTo list NFS shares, send a GET request to /v2/nfs?region=${region}.

A successful request will return all NFS shares belonging to the authenticated user.
nfs_createinsertname, size_gib, region, vpc_idsTo create a new NFS share, send a POST request to /v2/nfs.
nfs_deletedeletenfs_idregionTo delete an NFS share, send a DELETE request to /v2/nfs/{nfs_id}?region=${region}.

A successful request will return a 204 No Content status code.
resizeexecnfs_idAlias for the resize action.
snapshotexecnfs_idAlias for the snapshot action.
attachexecnfs_idAlias for the attach action.
detachexecnfs_idAlias for the detach action.
reassignexecnfs_idAlias for the reassign action.
switch_performance_tierexecnfs_idAlias for the switch_performance_tier action.

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
nfs_idstringThe unique ID of the NFS share (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d)
regionstringThe DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. (example: atl1)

SELECT examples

To get an NFS share, send a GET request to /v2/nfs/{nfs_id}?region=${region}.

A successful request will return the NFS share.

SELECT
id,
name,
access_points,
created_at,
host,
mount_path,
performance_tier,
region,
size_gib,
status,
vpc_ids
FROM digitalocean.storage.shares
WHERE nfs_id = '{{ nfs_id }}' -- required
AND region = '{{ region }}'
;

INSERT examples

To create a new NFS share, send a POST request to /v2/nfs.

INSERT INTO digitalocean.storage.shares (
name,
size_gib,
region,
vpc_ids,
performance_tier
)
SELECT
'{{ name }}' /* required */,
{{ size_gib }} /* required */,
'{{ region }}' /* required */,
'{{ vpc_ids }}' /* required */,
'{{ performance_tier }}'
RETURNING
share
;

DELETE examples

To delete an NFS share, send a DELETE request to /v2/nfs/{nfs_id}?region=${region}.

A successful request will return a 204 No Content status code.

DELETE FROM digitalocean.storage.shares
WHERE nfs_id = '{{ nfs_id }}' --required
AND region = '{{ region }}'
;

Lifecycle Methods

Alias for the resize action.

EXEC digitalocean.storage.shares.resize
@nfs_id='{{ nfs_id }}' --required
@@json=
'{
"region": "{{ region }}",
"params": "{{ params }}"
}'
;