shares
Creates, updates, deletes, gets or lists a shares resource.
Overview
| Name | shares |
| Type | Resource |
| Id | digitalocean.storage.shares |
Fields
The following fields are returned by SELECT queries:
- nfs_get
- nfs_list
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the NFS share. (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d) |
name | string | The human-readable name of the share. (example: sammy-share-drive) |
access_points | array | Access points configured on this share. The default access point is returned first. |
created_at | string (date-time) | Timestamp for when the NFS share was created. (example: 2023-01-01T00:00:00Z) |
host | string | The host IP of the NFS server that will be accessible from the associated VPC (example: 10.128.32.2) |
mount_path | string | Path 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_tier | string | The performance tier of the share. (example: PERFORMANCE_TIER_HIGH) |
region | string | The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. (example: atl1) |
size_gib | integer | The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50. |
status | string | The 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_ids | array | List of VPC IDs that should be able to access the share. |
The response will be a JSON object with a key called shares. The value will be an array of objects, each containing the standard attributes associated with an NFS share.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the NFS share. (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d) |
name | string | The human-readable name of the share. (example: sammy-share-drive) |
access_points | array | Access points configured on this share. The default access point is returned first. |
created_at | string (date-time) | Timestamp for when the NFS share was created. (example: 2023-01-01T00:00:00Z) |
host | string | The host IP of the NFS server that will be accessible from the associated VPC (example: 10.128.32.2) |
mount_path | string | Path 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_tier | string | The performance tier of the share. (example: PERFORMANCE_TIER_HIGH) |
region | string | The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. (example: atl1) |
size_gib | integer | The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50. |
status | string | The 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_ids | array | List of VPC IDs that should be able to access the share. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
nfs_get | select | nfs_id | region | To get an NFS share, send a GET request to /v2/nfs/{nfs_id}?region=${region}.A successful request will return the NFS share. |
nfs_list | select | region | To 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_create | insert | name, size_gib, region, vpc_ids | To create a new NFS share, send a POST request to /v2/nfs. | |
nfs_delete | delete | nfs_id | region | 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. |
resize | exec | nfs_id | Alias for the resize action. | |
snapshot | exec | nfs_id | Alias for the snapshot action. | |
attach | exec | nfs_id | Alias for the attach action. | |
detach | exec | nfs_id | Alias for the detach action. | |
reassign | exec | nfs_id | Alias for the reassign action. | |
switch_performance_tier | exec | nfs_id | Alias 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.
| Name | Datatype | Description |
|---|---|---|
nfs_id | string | The unique ID of the NFS share (example: 0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d) |
region | string | The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides. (example: atl1) |
SELECT examples
- nfs_get
- nfs_list
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 }}'
;
To 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.
SELECT
id,
name,
access_points,
created_at,
host,
mount_path,
performance_tier,
region,
size_gib,
status,
vpc_ids
FROM digitalocean.storage.shares
WHERE region = '{{ region }}'
;
INSERT examples
- nfs_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: shares
props:
- name: name
value: "{{ name }}"
description: |
The human-readable name of the share.
- name: size_gib
value: {{ size_gib }}
description: |
The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.
- name: region
value: "{{ region }}"
description: |
The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.
- name: vpc_ids
value:
- "{{ vpc_ids }}"
description: |
List of VPC IDs that should be able to access the share.
- name: performance_tier
value: "{{ performance_tier }}"
description: |
The performance tier of the share.
DELETE examples
- nfs_delete
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
- resize
- snapshot
- attach
- detach
- reassign
- switch_performance_tier
Alias for the resize action.
EXEC digitalocean.storage.shares.resize
@nfs_id='{{ nfs_id }}' --required
@@json=
'{
"region": "{{ region }}",
"params": "{{ params }}"
}'
;
Alias for the snapshot action.
EXEC digitalocean.storage.shares.snapshot
@nfs_id='{{ nfs_id }}' --required
@@json=
'{
"region": "{{ region }}",
"params": "{{ params }}"
}'
;
Alias for the attach action.
EXEC digitalocean.storage.shares.attach
@nfs_id='{{ nfs_id }}' --required
@@json=
'{
"region": "{{ region }}",
"params": "{{ params }}"
}'
;
Alias for the detach action.
EXEC digitalocean.storage.shares.detach
@nfs_id='{{ nfs_id }}' --required
@@json=
'{
"region": "{{ region }}",
"params": "{{ params }}"
}'
;
Alias for the reassign action.
EXEC digitalocean.storage.shares.reassign
@nfs_id='{{ nfs_id }}' --required
@@json=
'{
"region": "{{ region }}",
"params": "{{ params }}"
}'
;
Alias for the switch_performance_tier action.
EXEC digitalocean.storage.shares.switch_performance_tier
@nfs_id='{{ nfs_id }}' --required
@@json=
'{
"region": "{{ region }}",
"params": "{{ params }}"
}'
;