Skip to content

Commit 3e77c99

Browse files
authored
byoip_prefixes: add BYOIP Prefixes API endpoints and models for managing BYOIP Prefixes (#1047)
* byoip_prefixes: add BYOIP Prefixes API endpoints and models for managing BYOIP Prefixes * update BYOIP Prefixes tag to indicate public preview status * fix: lint * fix: lint * fix: update API examples and add pagination parameters for BYOIP Prefixes addresses review comments
1 parent 5e8a280 commit 3e77c99

31 files changed

+657
-0
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,18 @@ tags:
478478
An action object is returned. These objects hold the current status of the
479479
requested action.
480480
481+
- name: "[Public Preview] BYOIP Prefixes"
482+
description: |-
483+
Bring your own IP (BYOIP) lets you provision your own IPv4 network prefixes
484+
to your account, then assign those IPs to your DigitalOcean resources.
485+
BYOIP supports the following features:
486+
* IPv4 addresses
487+
* Network sizes of anywhere from `/24` (256 addresses) to `/18` (16,384 addresses)
488+
* Same API and management interface as our existing reserved IPs feature
489+
* Assignable to Droplets only
490+
491+
BYOIP is currently in Public Preview.
492+
481493
- name: Sizes
482494
description: |-
483495
The sizes objects represent different packages of hardware resources that
@@ -1815,6 +1827,22 @@ paths:
18151827
post:
18161828
$ref: "resources/reserved_ipv6/reservedIPv6Actions_post.yml"
18171829

1830+
/v2/byoip_prefixes:
1831+
post:
1832+
$ref: "resources/byoip_prefixes/byoip_prefixes_create.yml"
1833+
get:
1834+
$ref: "resources/byoip_prefixes/byoip_prefixes_list.yml"
1835+
1836+
/v2/byoip_prefixes/{byoip_prefix_uuid}:
1837+
get:
1838+
$ref: "resources/byoip_prefixes/byoip_prefixes_get.yml"
1839+
delete:
1840+
$ref: "resources/byoip_prefixes/byoip_prefixes_delete.yml"
1841+
1842+
/v2/byoip_prefixes/{byoip_prefix_uuid}/ips:
1843+
get:
1844+
$ref: "resources/byoip_prefixes/byoip_prefix_list_resources.yml"
1845+
18181846
/v2/sizes:
18191847
get:
18201848
$ref: "resources/sizes/sizes_list.yml"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
operationId: byoipPrefixes_list_resources
2+
3+
summary: "List BYOIP Prefix Resources"
4+
5+
description: |
6+
To list resources associated with BYOIP prefixes, send a GET request to `/v2/byoip_prefixes/{byoip_prefix_uuid}/ips`.
7+
8+
A successful response will return a list of resources associated with the specified BYOIP prefix.
9+
10+
tags:
11+
- "[Public Preview] BYOIP Prefixes"
12+
13+
parameters:
14+
- $ref: "parameters.yml#/byoip_prefix"
15+
- $ref: '../../shared/parameters.yml#/per_page'
16+
- $ref: '../../shared/parameters.yml#/page'
17+
18+
responses:
19+
"200":
20+
$ref: "responses/byoip_prefix_list_resources.yml#/byoip_prefix_list_resources"
21+
"401":
22+
$ref: "../../shared/responses/unauthorized.yml"
23+
"404":
24+
$ref: "../../shared/responses/not_found.yml"
25+
"429":
26+
$ref: "../../shared/responses/too_many_requests.yml"
27+
"500":
28+
$ref: "../../shared/responses/server_error.yml"
29+
default:
30+
$ref: "../../shared/responses/unexpected_error.yml"
31+
x-codeSamples:
32+
- $ref: "examples/curl/byoip_prefix_list_resources.yml"
33+
- $ref: "examples/go/byoip_prefix_list_resources.yml"
34+
- $ref: "examples/python/byoip_prefix_list_resources.yml"
35+
security:
36+
- bearer_auth:
37+
- "byoip_prefix:read"
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
operationId: byoipPrefixes_create
2+
3+
summary: "Create a BYOIP Prefix"
4+
5+
description: |
6+
To create a BYOIP prefix, send a POST request to `/v2/byoip_prefixes`.
7+
8+
A successful request will initiate the process of bringing your BYOIP Prefix into your account.
9+
The response will include the details of the created prefix, including its UUID and status.
10+
11+
tags:
12+
- "[Public Preview] BYOIP Prefixes"
13+
14+
requestBody:
15+
required: true
16+
content:
17+
application/json:
18+
schema:
19+
$ref: "models/byoip_prefix_create.yml#/byoip_prefix_create"
20+
21+
responses:
22+
"202":
23+
$ref: "responses/byoip_prefix_create.yml#/byoip_prefix_create"
24+
"401":
25+
$ref: "../../shared/responses/unauthorized.yml"
26+
"422":
27+
$ref: "../../shared/responses/unprocessable_entity.yml"
28+
"429":
29+
$ref: "../../shared/responses/too_many_requests.yml"
30+
"500":
31+
$ref: "../../shared/responses/server_error.yml"
32+
default:
33+
$ref: "../../shared/responses/unexpected_error.yml"
34+
35+
x-codeSamples:
36+
- $ref: "examples/curl/create_byoip_prefix.yml"
37+
- $ref: "examples/go/create_byoip_prefix.yml"
38+
- $ref: "examples/python/create_byoip_prefix.yml"
39+
40+
security:
41+
- bearer_auth:
42+
- "byoip_prefix:create"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
operationId: byoipPrefixes_delete
2+
3+
summary: "Delete a BYOIP Prefix"
4+
5+
description: |
6+
To delete a BYOIP prefix and remove it from your account, send a DELETE request
7+
to `/v2/byoip_prefixes/{uuid}`.
8+
9+
A successful request will receive a 202 status code with no body in response.
10+
This indicates that the request was accepted and the prefix is being deleted.
11+
12+
tags:
13+
- "[Public Preview] BYOIP Prefixes"
14+
15+
parameters:
16+
- $ref: "parameters.yml#/byoip_prefix"
17+
18+
responses:
19+
"202":
20+
$ref: "../../shared/responses/no_content.yml"
21+
"401":
22+
$ref: "../../shared/responses/unauthorized.yml"
23+
"404":
24+
$ref: "../../shared/responses/not_found.yml"
25+
"422":
26+
$ref: "../../shared/responses/unprocessable_entity.yml"
27+
"429":
28+
$ref: "../../shared/responses/too_many_requests.yml"
29+
"500":
30+
$ref: "../../shared/responses/server_error.yml"
31+
default:
32+
$ref: "../../shared/responses/unexpected_error.yml"
33+
34+
x-codeSamples:
35+
- $ref: "examples/curl/delete_byoip_prefix.yml"
36+
- $ref: "examples/go/delete_byoip_prefix.yml"
37+
- $ref: "examples/python/delete_byoip_prefix.yml"
38+
39+
security:
40+
- bearer_auth:
41+
- "byoip_prefix:delete"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
operationId: byoipPrefixes_get
2+
3+
summary: "Get a BYOIP Prefix"
4+
5+
description: |
6+
To get a BYOIP prefix, send a GET request to `/v2/byoip_prefixes/{byoip_prefix_uuid}`.
7+
8+
A successful response will return the details of the specified BYOIP prefix.
9+
tags:
10+
- "[Public Preview] BYOIP Prefixes"
11+
12+
parameters:
13+
- $ref: "parameters.yml#/byoip_prefix"
14+
15+
responses:
16+
"200":
17+
$ref: "responses/byoip_prefix_get.yml#/byoip_prefix_get"
18+
"401":
19+
$ref: "../../shared/responses/unauthorized.yml"
20+
"404":
21+
$ref: "../../shared/responses/not_found.yml"
22+
"422":
23+
$ref: "../../shared/responses/unprocessable_entity.yml"
24+
"429":
25+
$ref: "../../shared/responses/too_many_requests.yml"
26+
"500":
27+
$ref: "../../shared/responses/server_error.yml"
28+
default:
29+
$ref: "../../shared/responses/unexpected_error.yml"
30+
31+
x-codeSamples:
32+
- $ref: "examples/curl/get_byoip_prefix.yml"
33+
- $ref: "examples/go/get_byoip_prefix.yml"
34+
- $ref: "examples/python/get_byoip_prefix.yml"
35+
36+
security:
37+
- bearer_auth:
38+
- "byoip_prefix:update"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
operationId: byoipPrefixes_list
2+
summary: "List BYOIP Prefixes"
3+
description: |
4+
To list all BYOIP prefixes, send a GET request to `/v2/byoip_prefixes`.
5+
A successful response will return a list of all BYOIP prefixes associated with the account.
6+
7+
tags:
8+
- "[Public Preview] BYOIP Prefixes"
9+
10+
parameters:
11+
- $ref: '../../shared/parameters.yml#/per_page'
12+
- $ref: '../../shared/parameters.yml#/page'
13+
14+
responses:
15+
"200":
16+
$ref: "responses/byoip_prefix_list.yml#/byoip_prefix_list"
17+
"401":
18+
$ref: "../../shared/responses/unauthorized.yml"
19+
"429":
20+
$ref: "../../shared/responses/too_many_requests.yml"
21+
"500":
22+
$ref: "../../shared/responses/server_error.yml"
23+
default:
24+
$ref: "../../shared/responses/unexpected_error.yml"
25+
26+
x-codeSamples:
27+
- $ref: "examples/curl/list_byoip_prefixes.yml"
28+
- $ref: "examples/go/list_byoip_prefixes.yml"
29+
- $ref: "examples/python/list_byoip_prefixes.yml"
30+
31+
security:
32+
- bearer_auth:
33+
- "byoip_prefix:read"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lang: cURL
2+
source: |-
3+
curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
4+
"https://api.digitalocean.com/v2/byoip_prefixes/fa3b-1234-5678-90ab-cdef01234567/ips"
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 '{"prefix": "203.0.113.0/24", "region": "nyc3", "signature": "$SIGNATURE"}' \
7+
"https://api.digitalocean.com/v2/byoip_prefixes"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
lang: cURL
2+
source: |-
3+
curl -X DELETE \
4+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
5+
"https://api.digitalocean.com/v2/byoip_prefixes/fa3b-1234-5678-90ab-cdef01234567"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lang: cURL
2+
source: |-
3+
curl -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
4+
"https://api.digitalocean.com/v2/byoip_prefixes/fa3b-1234-5678-90ab-cdef01234567"

0 commit comments

Comments
 (0)