Skip to content

Commit 6628d2f

Browse files
mbeytanup-dekaharshmaru7
authored
SaaS API endpoints (#1109)
* add docs for new addon routes * more accurate summary for get app * Update addons_delete.yml * fix formatting * fix get metadata URL --------- Co-authored-by: anup-deka <[email protected]> Co-authored-by: Harsh Maru <[email protected]>
1 parent 1cad93c commit 6628d2f

33 files changed

+1094
-0
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ tags:
4545
4646
- `Accept: application/vnd.digitalocean.reserveip+json`
4747
48+
- name: Add-Ons
49+
description: |-
50+
Add-ons are third-party applications that can be added to your DigitalOcean account.
51+
They are available through the [DigitalOcean Marketplace](https://marketplace.digitalocean.com/).
52+
Add-ons can be used to enhance the functionality of your existing resources or to provide
53+
additional services.
54+
55+
The Add-Ons API allows you to manage these resources, including creating, listing, and retrieving
56+
details about specific add-on resources.
57+
4858
- name: Apps
4959
description: |-
5060
App Platform is a Platform-as-a-Service (PaaS) offering from DigitalOcean that allows
@@ -608,6 +618,32 @@ paths:
608618
get:
609619
$ref: "resources/actions/actions_get.yml"
610620

621+
/v2/add-ons/apps:
622+
get:
623+
$ref: "resources/addons/addons_get_app.yml"
624+
625+
/v2/add-ons/apps/{app_slug}/metadata:
626+
get:
627+
$ref: "resources/addons/addons_get_app_metadata.yml"
628+
629+
/v2/add-ons/saas:
630+
get:
631+
$ref: "resources/addons/addons_list.yml"
632+
post:
633+
$ref: "resources/addons/addons_create.yml"
634+
635+
/v2/add-ons/saas/{resource_uuid}:
636+
get:
637+
$ref: "resources/addons/addons_get.yml"
638+
delete:
639+
$ref: "resources/addons/addons_delete.yml"
640+
patch:
641+
$ref: "resources/addons/addons_update.yml"
642+
643+
/v2/add-ons/saas/{resource_uuid}/plan:
644+
patch:
645+
$ref: "resources/addons/addons_update_plan.yml"
646+
611647
/v2/apps:
612648
get:
613649
$ref: "resources/apps/apps_list.yml"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
operationId: addons_create
2+
3+
summary: Create/Provision a New Add-on Resource
4+
5+
description: |
6+
To create an add-on resource, send a POST request to `/v2/add-ons/saas` with required parameters.
7+
Some add-ons require additional metadata to be provided in the request body. To find out
8+
what metadata is required for a specific add-on, send a GET request to `/v2/add-ons/apps/{app_slug}/metadata`.
9+
10+
tags:
11+
- Add-Ons
12+
13+
requestBody:
14+
required: true
15+
16+
content:
17+
application/json:
18+
schema:
19+
allOf:
20+
- $ref: 'models/addons_resource_new.yml'
21+
22+
required:
23+
- name
24+
- app_slug
25+
- plan_slug
26+
- metadata
27+
28+
responses:
29+
'200':
30+
$ref: 'responses/addons_create.yml'
31+
32+
'401':
33+
$ref: '../../shared/responses/unauthorized.yml'
34+
35+
'429':
36+
$ref: '../../shared/responses/too_many_requests.yml'
37+
38+
'500':
39+
$ref: '../../shared/responses/server_error.yml'
40+
41+
default:
42+
$ref: '../../shared/responses/unexpected_error.yml'
43+
44+
x-codeSamples:
45+
- $ref: 'examples/curl/addons_create.yml'
46+
47+
security:
48+
- bearer_auth:
49+
- 'addon:create'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
operationId: addons_delete
2+
3+
summary: Delete/Deprovision an Add-on Resource
4+
5+
description: |
6+
To delete an add-on resource, send a DELETE request to `/v2/add-ons/saas/{resource_uuid}` with the UUID of the resource to delete.
7+
You cannot retrieve the resource after it has been deleted. The response indicates a request was sent to the 3rd party add-on provider to delete the resource.
8+
You will no longer be billed for this resource.
9+
10+
tags:
11+
- Add-Ons
12+
13+
parameters:
14+
- $ref: 'parameters.yml#/resource_uuid'
15+
16+
responses:
17+
'200':
18+
$ref: '../../shared/responses/no_content.yml'
19+
20+
'401':
21+
$ref: '../../shared/responses/unauthorized.yml'
22+
23+
'404':
24+
$ref: '../../shared/responses/not_found.yml'
25+
26+
'429':
27+
$ref: '../../shared/responses/too_many_requests.yml'
28+
29+
'500':
30+
$ref: '../../shared/responses/server_error.yml'
31+
32+
default:
33+
$ref: '../../shared/responses/unexpected_error.yml'
34+
35+
x-codeSamples:
36+
- $ref: 'examples/curl/addons_delete.yml'
37+
38+
security:
39+
- bearer_auth:
40+
- 'addon:delete'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
operationId: addons_get
2+
3+
summary: Get details on an Add-On Resource
4+
5+
description: |
6+
To fetch details of a specific Add-On Resource, send a GET request to `/v2/add-ons/saas/{resource_uuid}`.
7+
Replace `{resource_uuid}` with the UUID of the resource you want to retrieve.
8+
9+
tags:
10+
- Add-Ons
11+
12+
parameters:
13+
- name: resource_uuid
14+
in: path
15+
required: true
16+
example: "123e4567-e89b-12d3-a456-426614174000"
17+
schema:
18+
type: string
19+
description: The UUID of the add-on resource to retrieve.
20+
21+
responses:
22+
'200':
23+
$ref: 'responses/addons_get.yml'
24+
25+
'401':
26+
$ref: '../../shared/responses/unauthorized.yml'
27+
28+
'404':
29+
$ref: '../../shared/responses/not_found.yml'
30+
31+
'429':
32+
$ref: '../../shared/responses/too_many_requests.yml'
33+
34+
'500':
35+
$ref: '../../shared/responses/server_error.yml'
36+
37+
default:
38+
$ref: '../../shared/responses/unexpected_error.yml'
39+
40+
x-codeSamples:
41+
- $ref: 'examples/curl/addons_get.yml'
42+
43+
security:
44+
- bearer_auth:
45+
- 'addon:read'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
operationId: addons_get_app
2+
3+
summary: List Available Add-On Applications
4+
5+
description: |
6+
To fetch details of all available Add-On Applications, send a GET request to `/v2/add-ons/apps`.
7+
8+
tags:
9+
- Add-Ons
10+
11+
responses:
12+
'200':
13+
$ref: 'responses/addons_get_app.yml'
14+
15+
'401':
16+
$ref: '../../shared/responses/unauthorized.yml'
17+
18+
'429':
19+
$ref: '../../shared/responses/too_many_requests.yml'
20+
21+
'500':
22+
$ref: '../../shared/responses/server_error.yml'
23+
24+
default:
25+
$ref: '../../shared/responses/unexpected_error.yml'
26+
27+
x-codeSamples:
28+
- $ref: 'examples/curl/addons_get_app.yml'
29+
30+
security:
31+
- bearer_auth: []
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
operationId: addons_get_app_metadata
2+
3+
summary: Get Metadata for an Add-On Application
4+
5+
description: |
6+
To find out what metadata is required for a specific add-on, send a GET request to `/v2/add-ons/apps/{app_slug}/metadata`.
7+
Metadata varies by application.
8+
9+
tags:
10+
- Add-Ons
11+
12+
parameters:
13+
- name: app_slug
14+
in: path
15+
required: true
16+
example: example_app
17+
schema:
18+
type: string
19+
description: The slug identifier for the application whose metadata is being requested.
20+
21+
responses:
22+
'200':
23+
$ref: 'responses/addons_get_app_metadata.yml'
24+
25+
'401':
26+
$ref: '../../shared/responses/unauthorized.yml'
27+
28+
'404':
29+
$ref: '../../shared/responses/not_found.yml'
30+
31+
'429':
32+
$ref: '../../shared/responses/too_many_requests.yml'
33+
34+
'500':
35+
$ref: '../../shared/responses/server_error.yml'
36+
37+
default:
38+
$ref: '../../shared/responses/unexpected_error.yml'
39+
40+
x-codeSamples:
41+
- $ref: 'examples/curl/addons_get_app_metadata.yml'
42+
43+
security:
44+
- bearer_auth: []
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
operationId: addons_list
2+
3+
summary: List all Add-On Resources
4+
5+
description: |
6+
To fetch all Add-On Resources under your team, send a GET request to `/v2/add-ons/saas`.
7+
8+
tags:
9+
- Add-Ons
10+
11+
responses:
12+
'200':
13+
$ref: 'responses/addons_list.yml'
14+
15+
'401':
16+
$ref: '../../shared/responses/unauthorized.yml'
17+
18+
'429':
19+
$ref: '../../shared/responses/too_many_requests.yml'
20+
21+
'500':
22+
$ref: '../../shared/responses/server_error.yml'
23+
24+
default:
25+
$ref: '../../shared/responses/unexpected_error.yml'
26+
27+
x-codeSamples:
28+
- $ref: 'examples/curl/addons_list.yml'
29+
30+
security:
31+
- bearer_auth:
32+
- 'addon:read'
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
operationId: addons_patch
2+
3+
summary: Update the name for an Add-On Resource
4+
5+
description: |
6+
To change the name of an Add-On Resource, send a PATCH request to `/v2/add-ons/saas/{resource_uuid}`.
7+
Replace `{resource_uuid}` with the UUID of the resource for which you want to change the name.
8+
9+
tags:
10+
- Add-Ons
11+
12+
parameters:
13+
- name: resource_uuid
14+
in: path
15+
required: true
16+
example: "123e4567-e89b-12d3-a456-426614174000"
17+
schema:
18+
type: string
19+
description: The UUID of the add-on resource to rename.
20+
21+
requestBody:
22+
required: true
23+
24+
content:
25+
application/json:
26+
schema:
27+
type: object
28+
properties:
29+
name:
30+
type: string
31+
description: The new name for the add-on resource.
32+
example: "new-name"
33+
34+
required:
35+
- name
36+
37+
responses:
38+
'200':
39+
$ref: 'responses/addons_update.yml'
40+
41+
'401':
42+
$ref: '../../shared/responses/unauthorized.yml'
43+
44+
'404':
45+
$ref: '../../shared/responses/not_found.yml'
46+
47+
'429':
48+
$ref: '../../shared/responses/too_many_requests.yml'
49+
50+
'500':
51+
$ref: '../../shared/responses/server_error.yml'
52+
53+
default:
54+
$ref: '../../shared/responses/unexpected_error.yml'
55+
56+
x-codeSamples:
57+
- $ref: 'examples/curl/addons_update.yml'
58+
59+
security:
60+
- bearer_auth:
61+
- 'addon:update'

0 commit comments

Comments
 (0)