Skip to content

Commit e32d254

Browse files
MNFS-163: Added NFS resize and snapshot APIs (#1106)
* MNFS-163: Added NFS resize and snapshot APIs * Fixed lint issues * Delete unwanted file * Fix region example * Add tailing new line in missing files * Move region in actions endpoint to request body * Added share_id as optional query param for ListSnapshots * Added custom actions response rather than using the droplet action one * Fixes from review * Fixed table and added missing fields in response * Fixed lint issues * Fixed resize action body, added missing fields in response * Make size_gib required in actions endpoint * Fixed params in actions endpoint * Added quotes to params
1 parent 6baac4a commit e32d254

29 files changed

+470
-10
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,11 @@ tags:
368368
NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure,
369369
high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC.
370370
371+
- name: NFS Actions
372+
description: |-
373+
NFS actions are tasks that can be executed on an NFS share. These can be
374+
things like resizing, snapshotting, etc.
375+
371376
- name: Partner Network Connect
372377
description: |-
373378
Partner Network Connect lets you establish high-bandwidth, low-latency
@@ -1640,6 +1645,21 @@ paths:
16401645
delete:
16411646
$ref: "resources/nfs/nfs_delete.yml"
16421647

1648+
/v2/nfs/{nfs_id}/actions:
1649+
post:
1650+
$ref: "resources/nfs/nfs_actions_create.yml"
1651+
1652+
/v2/nfs/snapshots:
1653+
get:
1654+
$ref: "resources/nfs/nfs_snapshot_list.yml"
1655+
1656+
/v2/nfs/snapshots/{nfs_snapshot_id}:
1657+
get:
1658+
$ref: "resources/nfs/nfs_snapshot_get.yml"
1659+
1660+
delete:
1661+
$ref: "resources/nfs/nfs_snapshot_delete.yml"
1662+
16431663
/v2/partner_network_connect/attachments:
16441664
get:
16451665
$ref: "resources/partner_network_connect/partner_attachment_list.yml"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
lang: cURL
2+
source: |-
3+
curl -X POST \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
-d '{"type": "resize", "params": {"size_gib": 1024}, "region": "atl1"}' \
7+
"https://api.digitalocean.com/v2/nfs/${nfs_id}/actions"

specification/resources/nfs/examples/curl/nfs_create.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source: |-
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
66
-d '{"name": "sammy-share-drive", "size_gib": 1024, "region": "atl1", "vpc_ids": ["796c6fe3-2a1d-4da2-9f3e-38239827dc91"]}' \
7-
"https://api.digitalocean.com/v2/nfs"
7+
"https://api.digitalocean.com/v2/nfs"

specification/resources/nfs/examples/curl/nfs_delete.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ source: |-
33
curl -X DELETE \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
"https://api.digitalocean.com/v2/nfs/{share_id}?region=atl1"
6+
"https://api.digitalocean.com/v2/nfs/{share_id}?region=atl1"

specification/resources/nfs/examples/curl/nfs_get.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ source: |-
33
curl -X GET \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
"https://api.digitalocean.com/v2/nfs/{share_id}?region=atl1"
6+
"https://api.digitalocean.com/v2/nfs/{share_id}?region=atl1"

specification/resources/nfs/examples/curl/nfs_list.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ source: |-
33
curl -X GET \
44
-H "Content-Type: application/json" \
55
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6-
"https://api.digitalocean.com/v2/nfs?region=atl1"
6+
"https://api.digitalocean.com/v2/nfs?region=atl1"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X DELETE \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/nfs/snapshots/{snapshot_id}?region=atl1"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/nfs/snapshots/{snapshot_id}?region=atl1"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/nfs/snapshots?region=atl1"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
nfs_action:
2+
required:
3+
- type
4+
- region
5+
type: object
6+
description: Specifies the action that will be taken on the NFS share.
7+
properties:
8+
type:
9+
type: string
10+
enum:
11+
- resize
12+
- snapshot
13+
example: resize
14+
description: The type of action to initiate for the NFS share (such as resize or snapshot).
15+
region:
16+
type: string
17+
description: The DigitalOcean region slug (e.g. atl1, nyc2) where the NFS snapshot resides.
18+
example: atl1
19+
20+
nfs_action_resize:
21+
allOf:
22+
- $ref: '#/nfs_action'
23+
- type: object
24+
properties:
25+
params:
26+
type: object
27+
properties:
28+
size_gib:
29+
type: integer
30+
example: 2048
31+
description: The new size for the NFS share.
32+
required:
33+
- size_gib
34+
35+
nfs_action_snapshot:
36+
allOf:
37+
- $ref: '#/nfs_action'
38+
- type: object
39+
properties:
40+
params:
41+
type: object
42+
properties:
43+
name:
44+
type: string
45+
example: daily-backup
46+
description: Snapshot name of the NFS share
47+
required:
48+
- name

0 commit comments

Comments
 (0)