Skip to content

Commit

Permalink
Scaffold droplet autoscaler spec
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenVarela committed Nov 26, 2024
1 parent ed48680 commit 5daa5ea
Show file tree
Hide file tree
Showing 34 changed files with 1,062 additions and 0 deletions.
34 changes: 34 additions & 0 deletions specification/DigitalOcean-public.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ tags:
For documentation on app specifications (`AppSpec` objects), please refer to the
[product documentation](https://docs.digitalocean.com/products/app-platform/reference/app-spec/)).
- name: Autoscale Pools
description: |-
Droplet Autoscaling is a new DigitalOcean product that manages the horizontal scaling of customers' applications based on resource usage or a static configuration.
Customers create one or many autoscaling pools. An autoscaling pool has 2 components, scaling configuration and a droplet template.
To use Autoscaling you will need to use an image that automatically runs your application when the Droplet starts or pass a cloud-config in the user_data parameter of the Droplet template.
**Droplet autoscaling will only be supported with Dedicated CPU droplets**
- name: Billing
description: |-
The billing endpoints allow you to retrieve your account balance, invoices
Expand Down Expand Up @@ -998,6 +1006,32 @@ paths:
post:
$ref: 'resources/droplets/droplets_destroy_retryWithAssociatedResources.yml'

/v2/droplets/autoscale:
get:
$ref: 'resources/autoscale_pools/autoscale_pool_list.yml'
post:
$ref: 'resources/autoscale_pools/autoscale_pool_create.yml'

/v2/droplets/autoscale/{autoscale_pool_id}:
get:
$ref: 'resources/autoscale_pools/autoscale_pool_get.yml'
put:
$ref: 'resources/autoscale_pools/autoscale_pool_update.yml'
delete:
$ref: 'resources/autoscale_pools/autoscale_pool_delete.yml'

/v2/droplets/autoscale/{autoscale_pool_id}/dangerous:
delete:
$ref: 'resources/autoscale_pools/autoscale_pool_delete_dangerous.yml'

/v2/droplets/autoscale/{autoscale_pool_id}/members:
get:
$ref: 'resources/autoscale_pools/autoscale_pool_list_members.yml'

/v2/droplets/autoscale/{autoscale_pool_id}/history:
get:
$ref: 'resources/autoscale_pools/autoscale_pool_list_history.yml'

/v2/firewalls:
get:
$ref: 'resources/firewalls/firewalls_list.yml'
Expand Down
46 changes: 46 additions & 0 deletions specification/resources/autoscale_pools/autoscale_pool_create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
operationId: autoscale_pool_create

summary: Create a New Autoscale Pool

description: |
To create a new Autoscale Pool, send a POST request to `/v2/droplets/autoscale` setting the
required attributes.
An Autoscale Pool will be created using the provided information. The response body
will contain a JSON object with a key called `autoscale_pool`. The value will be an
object containing the standard attributes for your new Autoscale Pool.
tags:
- Autoscale Pools

requestBody:
content:
application/json:
schema:
$ref: 'models/autoscale_pool_create.yml'
examples:
Autoscale Create Request:
$ref: 'examples.yml#/autoscale_create_request'

responses:
'202':
$ref: 'responses/autoscale_pool_create.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pool_create.yml'

security:
- bearer_auth:
- 'droplet:create'
42 changes: 42 additions & 0 deletions specification/resources/autoscale_pools/autoscale_pool_delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
operationID: autoscale_delete

summary: Delete autoscale pool

description: |
To destroy an Autoscale Pool, send a
DELETE request to the `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`
endpoint.
A successful response will include a 202 response code and no content.
tags:
- Autoscale Pools

parameters:
- $ref: 'parameters.yml#/autoscale_pool_id'

responses:
'202':
$ref: '../../shared/responses/no_content.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'404':
$ref: '../../shared/responses/not_found.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pool_delete.yml'

security:
- bearer_auth:
- 'droplet:delete'
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
operationID: autoscale_delete_dangerouts

summary: Delete autoscale pool and resources

description: |
To destroy an Autoscale Pool, send a
DELETE request to the `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/dangerous`
endpoint. This will delete an autoscale pool and all of the underlying resources
(droplets)
A successful response will include a 202 response code and no content.
tags:
- Autoscale Pools

parameters:
- $ref: 'parameters.yml#/autoscale_pool_id'
- $ref: 'parameters.yml#/x_dangerous'

responses:
'202':
$ref: '../../shared/responses/no_content.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'404':
$ref: '../../shared/responses/not_found.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pool_delete_dangerous.yml'

security:
- bearer_auth:
- 'droplet:delete'
39 changes: 39 additions & 0 deletions specification/resources/autoscale_pools/autoscale_pool_get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
operationId: autoscale_pool_get

summary: Retrieve an Existing Autoscale Pool

description: |
To show information about an individual autoscale pool, send a GET request to
`/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`.
tags:
- Autoscale Pools

parameters:
- $ref: 'parameters.yml#/autoscale_pool_id'

responses:
'200':
$ref: 'responses/existing_autoscale_pool.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'404':
$ref: '../../shared/responses/not_found.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pool_get.yml'

security:
- bearer_auth:
- 'droplet:read'
41 changes: 41 additions & 0 deletions specification/resources/autoscale_pools/autoscale_pool_list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
operationId: autoscale_pools_list

summary: List All Autoscale Pools

description: |
To list all Autoscale Pools in your account, send a GET request to `/v2/droplets/autoscale`.
The response body will be a JSON object with a key of `autoscale_pools`. This will be
set to an array containing objects each representing an Autoscale Pool. These will
contain the standard Autoscale Pool attributes.
tags:
- Autoscale Pools

parameters:
- $ref: '../../shared/parameters.yml#/per_page'
- $ref: '../../shared/parameters.yml#/page'

responses:
'200':
$ref: 'responses/all_autoscale_pools.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pools_list.yml'


security:
- bearer_auth:
- 'droplet:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
operationId: autoscale_pools_history_list

summary: List history events

description: |
To list all of the scaling history events of an autoscale pool, send a GET request to `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/history`.
The response body will be a JSON object with a key of `history`. This will be
set to an array containing objects each representing a history event.
tags:
- Autoscale Pools

parameters:
- $ref: '../../shared/parameters.yml#/per_page'
- $ref: '../../shared/parameters.yml#/page'

responses:
'200':
$ref: 'responses/history_events.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pool_history_events.yml'


security:
- bearer_auth:
- 'droplet:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
operationId: autoscale_pool_members_list

summary: List members

description: |
To list the members (resources) in an autoscale pool, send a GET request to `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/members`.
The response body will be a JSON object with a key of `droplets`. This will be
set to an array containing information about each of the droplets in the autoscale pool.
tags:
- Autoscale Pools

parameters:
- $ref: '../../shared/parameters.yml#/per_page'
- $ref: '../../shared/parameters.yml#/page'

responses:
'200':
$ref: 'responses/all_members.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pool_members.yml'


security:
- bearer_auth:
- 'droplet:read'
46 changes: 46 additions & 0 deletions specification/resources/autoscale_pools/autoscale_pool_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
operationId: autoscale_pool_update

summary: Update Autoscale Pool

description: |
To update the configuration of an existing autoscale pool, send a PUT request to
`/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`. The request should contain a full representation
of the autoscale pool including existing attributes.
tags:
- Autoscale Pools

parameters:
- $ref: 'parameters.yml#/autoscale_pool_id'

requestBody:
content:
application/json:
schema:
$ref: 'models/autoscale_pool_create.yml'
examples:
Autoscale Update Request:
$ref: 'examples.yml#/autoscale_update_request'

responses:
'202':
$ref: 'responses/autoscale_pool_create.yml'

'401':
$ref: '../../shared/responses/unauthorized.yml'

'429':
$ref: '../../shared/responses/too_many_requests.yml'

'500':
$ref: '../../shared/responses/server_error.yml'

default:
$ref: '../../shared/responses/unexpected_error.yml'

x-codeSamples:
- $ref: 'examples/curl/autoscale_pool_update.yml'

security:
- bearer_auth:
- 'droplet:create'
Loading

0 comments on commit 5daa5ea

Please sign in to comment.