Skip to content

Commit 65900f2

Browse files
MNFS-163: Added NFS APIs (#1096)
* MNFS-163: Added NFS APIs * Fixed lint issue * Added curl examples * Fixes from review * Updated size_gib to be >= * Formatting fixes, fix region and size_gib message * Fixed formatting * Fixed formatting again * Fix share id naming in example * Updated vpc_id as required, removed unwanted \n * Added region as query param to list endpoint * Removed user_id * Added missing endpoint with query param to openapi spec * Fixed vpc_id, query param * Added region query param to get and delete endpoints --------- Co-authored-by: SSharma-10 <shivanisharma@digitalocean.com>
1 parent ee73633 commit 65900f2

19 files changed

+426
-0
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,11 @@ tags:
363363
policies based on these metrics. The Monitoring API can help you gain insight into how your apps are performing
364364
and consuming resources.
365365
366+
- name: NFS
367+
description: |-
368+
NFS lets you create fully managed, POSIX-compliant network file storage that delivers secure,
369+
high-performance shared storage right inside your VPC. This enables seamless data sharing across Droplets in a VPC.
370+
366371
- name: Partner Network Connect
367372
description: |-
368373
Partner Network Connect lets you establish high-bandwidth, low-latency
@@ -1614,6 +1619,20 @@ paths:
16141619
delete:
16151620
$ref: "resources/monitoring/monitoring_delete_sink.yml"
16161621

1622+
/v2/nfs:
1623+
post:
1624+
$ref: "resources/nfs/nfs_create.yml"
1625+
1626+
get:
1627+
$ref: "resources/nfs/nfs_list.yml"
1628+
1629+
/v2/nfs/{nfs_id}:
1630+
get:
1631+
$ref: "resources/nfs/nfs_get.yml"
1632+
1633+
delete:
1634+
$ref: "resources/nfs/nfs_delete.yml"
1635+
16171636
/v2/partner_network_connect/attachments:
16181637
get:
16191638
$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 '{"name": "sammy-share-drive", "size_gib": 1024, "region": "atl1", "vpc_ids": ["796c6fe3-2a1d-4da2-9f3e-38239827dc91"]}' \
7+
"https://api.digitalocean.com/v2/nfs"
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/{share_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/{share_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?region=atl1"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type: object
2+
3+
properties:
4+
share:
5+
$ref: 'nfs_response.yml'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type: object
2+
3+
properties:
4+
share:
5+
$ref: 'nfs_response.yml'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type: object
2+
3+
properties:
4+
shares:
5+
type: array
6+
items:
7+
$ref: 'nfs_response.yml'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
type: object
3+
properties:
4+
name:
5+
type: string
6+
description: The human-readable name of the share.
7+
example: "my-nfs-share"
8+
size_gib:
9+
type: integer
10+
description: The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.
11+
example: 50
12+
region:
13+
type: string
14+
description: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.
15+
example: atl1
16+
vpc_ids:
17+
type: array
18+
items:
19+
type: string
20+
description: List of VPC IDs that should be able to access the share.
21+
example: ["796c6fe3-2a1d-4da2-9f3e-38239827dc91"]
22+
required:
23+
- name
24+
- size_gib
25+
- region
26+
- vpc_ids
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
type: object
3+
properties:
4+
id:
5+
type: string
6+
description: The unique identifier of the NFS share.
7+
readOnly: true
8+
example: "0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"
9+
name:
10+
type: string
11+
description: The human-readable name of the share.
12+
example: "sammy-share-drive"
13+
size_gib:
14+
type: integer
15+
description: The desired/provisioned size of the share in GiB (Gibibytes). Must be >= 50.
16+
example: 1024
17+
region:
18+
type: string
19+
description: The DigitalOcean region slug (e.g., nyc2, atl1) where the NFS share resides.
20+
example: "atl1"
21+
status:
22+
type: string
23+
enum: [CREATING, ACTIVE, FAILED, DELETED]
24+
description: The current status of the share.
25+
readOnly: true
26+
example: "ACTIVE"
27+
created_at:
28+
type: string
29+
format: date-time
30+
description: Timestamp for when the NFS share was created.
31+
readOnly: true
32+
example: "2023-01-01T00:00:00Z"
33+
vpc_ids:
34+
type: array
35+
items:
36+
type: string
37+
description: List of VPC IDs that should be able to access the share.
38+
example: ["796c6fe3-2a1d-4da2-9f3e-38239827dc91"]
39+
required:
40+
- id
41+
- name
42+
- size_gib
43+
- region
44+
- status
45+
- created_at

0 commit comments

Comments
 (0)