From f9cc57f0b875683acb48c52c74d8c53f8c61066e Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Fri, 22 Nov 2024 17:15:59 -0500 Subject: [PATCH 1/8] Scaffold droplet autoscaler spec --- specification/DigitalOcean-public.v2.yaml | 34 ++++++++ .../autoscale_pools/autoscale_pool_create.yml | 46 ++++++++++ .../autoscale_pools/autoscale_pool_delete.yml | 42 ++++++++++ .../autoscale_pool_delete_dangerous.yml | 44 ++++++++++ .../autoscale_pools/autoscale_pool_get.yml | 39 +++++++++ .../autoscale_pools/autoscale_pool_list.yml | 41 +++++++++ .../autoscale_pool_list_history.yml | 40 +++++++++ .../autoscale_pool_list_members.yml | 40 +++++++++ .../autoscale_pools/autoscale_pool_update.yml | 46 ++++++++++ .../resources/autoscale_pools/examples.yml | 43 ++++++++++ .../examples/curl/autoscale_pool_create.yml | 30 +++++++ .../examples/curl/autoscale_pool_delete.yml | 6 ++ .../curl/autoscale_pool_delete_dangerous.yml | 7 ++ .../examples/curl/autoscale_pool_get.yml | 6 ++ .../curl/autoscale_pool_history_events.yml | 6 ++ .../examples/curl/autoscale_pool_members.yml | 6 ++ .../examples/curl/autoscale_pool_update.yml | 32 +++++++ .../examples/curl/autoscale_pools_list.yml | 6 ++ .../autoscale_pools/models/autoscale_pool.yml | 67 +++++++++++++++ .../models/autoscale_pool_create.yml | 22 +++++ .../autoscale_pool_droplet_template.yml | 80 ++++++++++++++++++ .../models/autoscale_pool_dynamic_config.yml | 36 ++++++++ .../models/autoscale_pool_static_config.yml | 11 +++ .../models/current_utilization.yml | 15 ++++ .../autoscale_pools/models/history.yml | 50 +++++++++++ .../autoscale_pools/models/member.yml | 41 +++++++++ .../models/member_current_utilization.yml | 11 +++ .../resources/autoscale_pools/parameters.yml | 17 ++++ .../responses/all_autoscale_pools.yml | 26 ++++++ .../autoscale_pools/responses/all_members.yml | 27 ++++++ .../responses/autoscale_pool_create.yml | 16 ++++ .../autoscale_pools/responses/examples.yml | 83 +++++++++++++++++++ .../responses/existing_autoscale_pool.yml | 21 +++++ .../responses/history_events.yml | 25 ++++++ 34 files changed, 1062 insertions(+) create mode 100644 specification/resources/autoscale_pools/autoscale_pool_create.yml create mode 100644 specification/resources/autoscale_pools/autoscale_pool_delete.yml create mode 100644 specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml create mode 100644 specification/resources/autoscale_pools/autoscale_pool_get.yml create mode 100644 specification/resources/autoscale_pools/autoscale_pool_list.yml create mode 100644 specification/resources/autoscale_pools/autoscale_pool_list_history.yml create mode 100644 specification/resources/autoscale_pools/autoscale_pool_list_members.yml create mode 100644 specification/resources/autoscale_pools/autoscale_pool_update.yml create mode 100644 specification/resources/autoscale_pools/examples.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete_dangerous.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pool_get.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pool_history_events.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pool_members.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml create mode 100644 specification/resources/autoscale_pools/examples/curl/autoscale_pools_list.yml create mode 100644 specification/resources/autoscale_pools/models/autoscale_pool.yml create mode 100644 specification/resources/autoscale_pools/models/autoscale_pool_create.yml create mode 100644 specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml create mode 100644 specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml create mode 100644 specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml create mode 100644 specification/resources/autoscale_pools/models/current_utilization.yml create mode 100644 specification/resources/autoscale_pools/models/history.yml create mode 100644 specification/resources/autoscale_pools/models/member.yml create mode 100644 specification/resources/autoscale_pools/models/member_current_utilization.yml create mode 100644 specification/resources/autoscale_pools/parameters.yml create mode 100644 specification/resources/autoscale_pools/responses/all_autoscale_pools.yml create mode 100644 specification/resources/autoscale_pools/responses/all_members.yml create mode 100644 specification/resources/autoscale_pools/responses/autoscale_pool_create.yml create mode 100644 specification/resources/autoscale_pools/responses/examples.yml create mode 100644 specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml create mode 100644 specification/resources/autoscale_pools/responses/history_events.yml diff --git a/specification/DigitalOcean-public.v2.yaml b/specification/DigitalOcean-public.v2.yaml index ea66dc4f..4df4e51a 100644 --- a/specification/DigitalOcean-public.v2.yaml +++ b/specification/DigitalOcean-public.v2.yaml @@ -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 @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_create.yml b/specification/resources/autoscale_pools/autoscale_pool_create.yml new file mode 100644 index 00000000..73fb460f --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_create.yml @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete.yml b/specification/resources/autoscale_pools/autoscale_pool_delete.yml new file mode 100644 index 00000000..3e956f72 --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_delete.yml @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml new file mode 100644 index 00000000..e358d4a5 --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_get.yml b/specification/resources/autoscale_pools/autoscale_pool_get.yml new file mode 100644 index 00000000..b18168a4 --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_get.yml @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_list.yml b/specification/resources/autoscale_pools/autoscale_pool_list.yml new file mode 100644 index 00000000..c1572227 --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_list.yml @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_history.yml b/specification/resources/autoscale_pools/autoscale_pool_list_history.yml new file mode 100644 index 00000000..1717e86c --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_list_history.yml @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml new file mode 100644 index 00000000..e66529bb --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml @@ -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' diff --git a/specification/resources/autoscale_pools/autoscale_pool_update.yml b/specification/resources/autoscale_pools/autoscale_pool_update.yml new file mode 100644 index 00000000..623bab73 --- /dev/null +++ b/specification/resources/autoscale_pools/autoscale_pool_update.yml @@ -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' diff --git a/specification/resources/autoscale_pools/examples.yml b/specification/resources/autoscale_pools/examples.yml new file mode 100644 index 00000000..165e933b --- /dev/null +++ b/specification/resources/autoscale_pools/examples.yml @@ -0,0 +1,43 @@ +autoscale_create_request: + value: + name: "my-autoscale-pool" + config: + min_instances: 1 + max_instances: 5 + target_cpu_utilization: 0.5 + cooldown_minutes: 10 + droplet_template: + name: example.com + region: nyc3 + size: c-2 + image: ubuntu-20-04-x64 + ssh_keys: + - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 + backups: true + ipv6: true + monitoring: true + tags: + - env:prod + - web + user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" + vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 +autoscale_update_request: + value: + name: "my-autoscale-pool" + config: + target_number_instances: 2 + droplet_template: + name: example.com + region: nyc3 + size: c-2 + image: ubuntu-20-04-x64 + ssh_keys: + - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 + backups: true + ipv6: true + monitoring: true + tags: + - env:prod + - web + user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" + vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml new file mode 100644 index 00000000..cb96fac1 --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml @@ -0,0 +1,30 @@ +lang: cURL +source: |- + curl -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + -d '{ + "name": "test-autoscalergroup", + "config": { + "min_instances": 1, + "max_instances": 5, + "target_cpu_utilization": 0.5, + "cooldown_minutes": 5 + }, + "droplet_template": { + "size": "c-2", + "region": "tor1", + "image": 'ubuntu-20-04-x64', + "tags": [ + "test-ag-01" + ], + "ssh_keys": [ + "392594", + "385255" + ], + "vpc_uuid": "c472520a-831e-4770-8135-542c57a69daa", + "ipv6": true, + "user_data": "\n#cloud-config\nruncmd:\n- apt-get update\n" + } + }' \ + "https://api.digitalocean.com/v2/droplets/autoscale" diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete.yml new file mode 100644 index 00000000..9db34579 --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete.yml @@ -0,0 +1,6 @@ +lang: cURL +source: |- + curl -X DELETE \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/droplets/autoscale/880fee37-d07a-4f94-94a0-f07d9fc7bbb4" diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete_dangerous.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete_dangerous.yml new file mode 100644 index 00000000..db76f5b7 --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_delete_dangerous.yml @@ -0,0 +1,7 @@ +lang: cURL +source: |- + curl -X DELETE \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + -H "X-Dangerous: true" \ + "https://api.digitalocean.com/v2/droplets/autoscale/880fee37-d07a-4f94-94a0-f07d9fc7bbb4/dangerous" diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_get.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_get.yml new file mode 100644 index 00000000..219256d7 --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_get.yml @@ -0,0 +1,6 @@ +lang: cURL +source: |- + curl -X GET \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/droplets/autoscale/880fee37-d07a-4f94-94a0-f07d9fc7bbb4" diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_history_events.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_history_events.yml new file mode 100644 index 00000000..f4ddb63a --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_history_events.yml @@ -0,0 +1,6 @@ +lang: cURL +source: |- + curl -X GET \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/droplets/autoscale/07445b1b-1dc1-414d-b0a7-239ac66a9148/history" diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_members.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_members.yml new file mode 100644 index 00000000..72ab0a9a --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_members.yml @@ -0,0 +1,6 @@ +lang: cURL +source: |- + curl -X GET \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/droplets/autoscale/d0067f19-c9bd-4d8c-b28b-e464fd1fb250/members" diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml new file mode 100644 index 00000000..d667e3e7 --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml @@ -0,0 +1,32 @@ +lang: cURL +source: |- + curl -X PUT \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + -d '{ + "name": "test-autoscalergroup-01", + "config": { + "min_instances": 1, + "max_instances": 5, + "target_cpu_utilization": 0.5, + "cooldown_minutes": 10 + }, + "droplet_template": { + "size": "c-2", + "region": "tor1", + "image": 'ubuntu-20-04-x64', + "tags": [ + "test-ag-01" + ], + "ssh_keys": [ + "372862", + "367582", + "355790" + ], + "vpc_uuid": "4637280e-3842-4661-a628-a6f0392959d3", + "with_droplet_agent": true, + "ipv6": true, + "user_data": "\n#cloud-config\nruncmd:\n- apt-get update\n" + } + }' \ + "https://api.digitalocean.com/v2/droplets/autoscale/d0067f19-c9bd-4d8c-b28b-e464fd1fb250" diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pools_list.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pools_list.yml new file mode 100644 index 00000000..137d297c --- /dev/null +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pools_list.yml @@ -0,0 +1,6 @@ +lang: cURL +source: |- + curl -X GET \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/droplets/autoscale?page=1&per_page=1" diff --git a/specification/resources/autoscale_pools/models/autoscale_pool.yml b/specification/resources/autoscale_pools/models/autoscale_pool.yml new file mode 100644 index 00000000..00013991 --- /dev/null +++ b/specification/resources/autoscale_pools/models/autoscale_pool.yml @@ -0,0 +1,67 @@ +type: object + +properties: + id: + type: string + example: 0d3db13e-a604-4944-9827-7ec2642d32ac + description: A unique identifier for each Autoscale pool instance. This is + automatically generated upon Autoscale Pool creation. + + name: + type: string + example: my-autoscale-pool + description: The human-readable name set for the Autoscale Pool. + + config: + oneOf: + - $ref: ../models/autoscale_pool_static_config.yml + - $ref: ../models/autoscale_pool_dynamic_config.yml + type: object + description: This is the scaling configuration for an autoscale pool + Currently 2 methods are supported for how an autoscaling pool scales up and down. + Additional methods may be added in future releases. + + droplet_template: + $ref: ../models/autoscale_pool_droplet_template.yml + + current_utilization: + $ref: ../models/current_utilization.yml + + created_at: + format: date-time + title: The creation time of the autoscale pool + type: string + example: 2020-07-28T18:00:00Z + description: A time value given in ISO8601 combined date and time format + that represents when the Autoscale Pool was created. + + updated_at: + format: date-time + title: When the autoscale pool was last updated + type: string + example: 2020-07-28T18:00:00Z + description: A time value given in ISO8601 combined date and time format + that represents when the Autoscale Pool was last updated. + + status: + type: string + enum: + - active + - deleting + - error + description: The current status of the autoscale pool. + + active_resources_count: + type: integer + example: 1 + description: The number of active resources in the autoscale pool. + +required: + - id + - name + - config + - droplet_template + - created_at + - updated_at + - status + - active_resources_count diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_create.yml b/specification/resources/autoscale_pools/models/autoscale_pool_create.yml new file mode 100644 index 00000000..06163b0e --- /dev/null +++ b/specification/resources/autoscale_pools/models/autoscale_pool_create.yml @@ -0,0 +1,22 @@ +type: object + +properties: + name: + example: "my-autoscaler-group" + type: string + description: "The human-readable name of the autoscaler group." + config: + oneOf: + - $ref: ../models/autoscale_pool_static_config.yml + - $ref: ../models/autoscale_pool_dynamic_config.yml + type: object + description: This is the scaling configuration for an autoscale pool + Currently 2 methods are supported for how an autoscaling pool scales up and down. + Additional methods may be added in future releases. + droplet_template: + $ref: ../models/autoscale_pool_droplet_template.yml + +required: + - name + - config + - droplet_template diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml new file mode 100644 index 00000000..b265d3c5 --- /dev/null +++ b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml @@ -0,0 +1,80 @@ +properties: + name: + type: string + example: my-droplet-name + description: "The name(s) to be applied to all droplets in the autoscale pool." + + region: + type: string + enum: + - nyc1 + - nyc2 + - nyc3 + - ams2 + - ams3 + - sfo1 + - sfo2 + - sfo3 + - sgp1 + - lon1 + - fra1 + - tor1 + - blr1 + - syd1 + description: The datacenter in which all of the droplets will be created. + + size: + type: string + example: c-2 + description: The droplet size to be used for all droplets in the autoscale pool. + You may specify the slug or the image id. **Note that only dedicated cpus will be supported with autoscale pools.** + + ssh_keys: + type: array + items: + type: string + example: "88:66:90:d2:68:d5:b5:85:e3:26:26:11:31:57:e6:f8" + description: Used to specify which keys should be installed on the droplets. You can either specify the key id or the fingerprint. + + tags: + type: array + items: + type: string + example: my-tag + description: Used to apply tags to each of the droplets in the autoscale pool. + + vpc_uuid: + type: string + description: Used to specify the VPC where the droplets will be created. Note that the VPC needs to exist in the region you intend to create the droplets in. + + with_droplet_agent: + type: boolean + description: Installs the droplet agent. In order for DO to monitor the droplet utilization used for the resource utilization scaling this needs to be set to true. + + project_id: + type: string + description: Allows you to specify which project the droplets will belong to. + + ipv6: + type: boolean + description: Will assign a unique IPV6 to each of the droplets. + + user_data: + type: string + example: | + #cloud-config + runcmd: + - touch /test.txt + description: A string containing 'user data' which may be used to configure + the Droplet on first boot, often a 'cloud-config' file or Bash script. + It must be plain text and may not exceed 64 KiB in size. + +required: + - name + - region + - size + - ssh_keys + - tags + - vpc_uuid + - with_droplet_agent + - user_data diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml new file mode 100644 index 00000000..8515954b --- /dev/null +++ b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml @@ -0,0 +1,36 @@ +properties: + min_instances: + type: integer + example: 5 + description: The lower bound of the number of resources in a dynamically scaling pool. + minimum: 0 + maximum: 500 + max_instances: + type: integer + example: 10 + description: The upper bound of the number of resources in a dynamically scaling pool. + minimum: 0 + maximum: 1000 + target_cpu_utilization: + type: float + example: 0.6 + description: Target cpu utilization as a decimal. + minimum: 0 + maximum: 1 + target_memory_utilization: + type: float + example: 0.6 + description: Target memory utilization as a decimal. + minimum: 0 + maximum: 1 + cooldown_minutes: + type: integer + example: 5 + description: To prevent thrashing there is a cool down period which may be provided + this will default to 10 minutes if not provided. + minimum: 5 + maximum: 20 + +required: + - min_instances + - max_instances diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml b/specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml new file mode 100644 index 00000000..a4d8872c --- /dev/null +++ b/specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml @@ -0,0 +1,11 @@ +properties: + target_number_instances: + title: static config + type: integer + example: 3 + description: Fixed number of instances in an autoscale pool. + minimum: 1 + maximum: 1000 + +required: + - target_number_instances diff --git a/specification/resources/autoscale_pools/models/current_utilization.yml b/specification/resources/autoscale_pools/models/current_utilization.yml new file mode 100644 index 00000000..2da34689 --- /dev/null +++ b/specification/resources/autoscale_pools/models/current_utilization.yml @@ -0,0 +1,15 @@ +type: object + +properties: + memory: + type: float + example: 0.3588531587713522 + description: The average memory utilization of the autoscale pool. + minimum: 0 + maximum: 1 + cpu: + type: float + example: 0.0007338008770232183 + description: The average cpu utilization the autoscale pool. + minimum: 0 + maximum: 1 diff --git a/specification/resources/autoscale_pools/models/history.yml b/specification/resources/autoscale_pools/models/history.yml new file mode 100644 index 00000000..d5c91916 --- /dev/null +++ b/specification/resources/autoscale_pools/models/history.yml @@ -0,0 +1,50 @@ +type: object + +properties: + history_event_id: + type: string + example: 01936530-4471-7b86-9634-32d8fcfecbc6 + description: the unique identifier of the history event + current_instance_count: + type: integer + example: 2 + description: the current number of instances in the autoscale pool + desired_instance_count: + type: integer + example: 2 + description: the desired instances for the autoscale pool + reason: + type: string + enum: + - CONFIGURATION_CHANGE + - SCALE_UP + - SCALE_DOWN + description: the reason for the scaling event + status: + type: string + enum: + - in_progress + - success + - error + description: status of the scaling event + created_at: + format: date-time + description: A time value given in ISO8601 combined date and time format + that represents when the History Event was created. + type: string + example: 2020-07-28T18:00:00Z + updated_at: + format: date-time + description: A time value given in ISO8601 combined date and time format + that represents when the History Event was last updated. + type: string + example: 2020-07-28T18:00:00Z + +required: + - history_event_id + - current_instance_count + - desired_instance_count + - reason + - status + - created_at + - updated_at diff --git a/specification/resources/autoscale_pools/models/member.yml b/specification/resources/autoscale_pools/models/member.yml new file mode 100644 index 00000000..03c83036 --- /dev/null +++ b/specification/resources/autoscale_pools/models/member.yml @@ -0,0 +1,41 @@ +type: object + +properties: + droplet_id: + type: integer + example: 459903570 + description: The unique identifier of the droplet. + created_at: + format: date-time + description: A time value given in ISO8601 combined date and time format + that represents when the Resource was created. + type: string + example: 2020-07-28T18:00:00Z + updated_at: + format: date-time + description: A time value given in ISO8601 combined date and time format + that represents when the Resource was last updated. + type: string + example: 2020-07-28T18:00:00Z + health_status: + type: string + example: 'active' + description: The health status of the resource. + status: + type: string + enum: + - provisioning + - active + - deleting + - "off" + description: The status of the resource (droplet). + current_utilization: + $ref: ../models/member_current_utilization.yml + +required: + - droplet_id + - created_at + - updated_at + - health_status + - status + - current_utilization diff --git a/specification/resources/autoscale_pools/models/member_current_utilization.yml b/specification/resources/autoscale_pools/models/member_current_utilization.yml new file mode 100644 index 00000000..275527ef --- /dev/null +++ b/specification/resources/autoscale_pools/models/member_current_utilization.yml @@ -0,0 +1,11 @@ +type: object + +properties: + memory: + type: float + example: 0.3588531587713522 + description: The memory utilization average of the individual resource. + cpu: + type: float + example: 0.0007338008770232183 + description: The cpu utilization average of the individual resource. diff --git a/specification/resources/autoscale_pools/parameters.yml b/specification/resources/autoscale_pools/parameters.yml new file mode 100644 index 00000000..8849396d --- /dev/null +++ b/specification/resources/autoscale_pools/parameters.yml @@ -0,0 +1,17 @@ +autoscale_pool_id: + in: path + name: autoscale_pool_id + description: A unique identifier for a Autoscale Pool instance. + required: true + schema: + type: string + example: 0d3db13e-a604-4944-9827-7ec2642d32ac +x_dangerous: + in: header + name: X-Dangerous + description: Acknowledge this action will destroy the autoscale pool and its + associated resources and _can not_ be reversed. + schema: + type: boolean + example: true + required: true diff --git a/specification/resources/autoscale_pools/responses/all_autoscale_pools.yml b/specification/resources/autoscale_pools/responses/all_autoscale_pools.yml new file mode 100644 index 00000000..704f1c83 --- /dev/null +++ b/specification/resources/autoscale_pools/responses/all_autoscale_pools.yml @@ -0,0 +1,26 @@ +description: A JSON object with a key of `autoscale_pools`. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + + +content: + application/json: + schema: + allOf: + - type: object + properties: + autoscale_pools: + type: array + items: + $ref: '../models/autoscale_pool.yml' + - $ref: '../../../shared/pages.yml#/pagination' + - $ref: '../../../shared/meta.yml' + examples: + All Autoscale Pools: + $ref: 'examples.yml#/autoscale_pools_all' diff --git a/specification/resources/autoscale_pools/responses/all_members.yml b/specification/resources/autoscale_pools/responses/all_members.yml new file mode 100644 index 00000000..6d5dac88 --- /dev/null +++ b/specification/resources/autoscale_pools/responses/all_members.yml @@ -0,0 +1,27 @@ +description: A JSON object with a key of `droplets`. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + + +content: + application/json: + schema: + allOf: + - type: object + properties: + droplets: + type: array + items: + $ref: '../models/member.yml' + - $ref: '../../../shared/pages.yml#/pagination' + - $ref: '../../../shared/meta.yml' + examples: + All members: + $ref: 'examples.yml#/members_all' + diff --git a/specification/resources/autoscale_pools/responses/autoscale_pool_create.yml b/specification/resources/autoscale_pools/responses/autoscale_pool_create.yml new file mode 100644 index 00000000..f40b6a77 --- /dev/null +++ b/specification/resources/autoscale_pools/responses/autoscale_pool_create.yml @@ -0,0 +1,16 @@ +description: Accepted + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + +content: + application/json: + schema: + properties: + autoscale_pool: + $ref: '../models/autoscale_pool.yml' diff --git a/specification/resources/autoscale_pools/responses/examples.yml b/specification/resources/autoscale_pools/responses/examples.yml new file mode 100644 index 00000000..ce02cd89 --- /dev/null +++ b/specification/resources/autoscale_pools/responses/examples.yml @@ -0,0 +1,83 @@ +autoscale_pools_all: + value: + autoscale_pools: + - id: 0d3db13e-a604-4944-9827-7ec2642d32ac + name: "test-autoscaler-group-01" + config: + min_instances: 1 + max_instances: 5 + target_cpu_utilization: 0.5 + cooldown_minutes: 10 + droplet_template: + size: c-2 + region: tor1 + image: ubuntu-20-04-x64 + tags: + - my-tag + ssh_keys: + - 289794 + - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 + vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 + with_droplet_agent: true + project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 + ipv6: true + user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" + created_at: 2020-11-19T20:27:18Z + updated_at: 2020-12-01T00:42:16Z + current_utilization: + memory: 0.3588531587713522 + cpu: 0.0007338008770232183 + status: active + active_resources_count: 1 +autoscale_pool_single: + value: + autoscale_pool: + id: 0d3db13e-a604-4944-9827-7ec2642d32ac + name: "test-autoscaler-group-01" + config: + min_instances: 1 + max_instances: 5 + target_cpu_utilization: 0.5 + cooldown_minutes: 10 + droplet_template: + size: c-2 + region: tor1 + image: 'ubuntu-20-04-x64' + tags: + - my-tag + ssh_keys: + - 289794 + - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 + vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 + with_droplet_agent: true + project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 + ipv6: true + user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" + created_at: 2020-11-19T20:27:18Z + updated_at: 2020-12-01T00:42:16Z + current_utilization: + memory: 0.3588531587713522 + cpu: 0.0007338008770232183 + status: active + active_resources_count: 1 +members_all: + value: + droplets: + - id: 123456 + created_at: 2020-11-19T20:27:18Z + updated_at: 2020-12-01T00:42:16Z + health_status: "healthy" + status: "active" + current_utilization: + memory: 0.3588531587713522 + cpu: 0.0007338008770232183 +history_all: + value: + history: + - history_event_id: 01936530-4471-7b86-9634-32d8fcfecbc6 + current_instance_count: 2 + desired_instance_count: 2 + reason: "CONFIGURATION_CHANGE" + status: "success" + created_at: 2020-11-19T20:27:18Z + updated_at: 2020-12-01T00:42:16Z diff --git a/specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml b/specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml new file mode 100644 index 00000000..b22e096c --- /dev/null +++ b/specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml @@ -0,0 +1,21 @@ +description: | + The response will be a JSON object with a key called `autoscale_pool`. This will be + set to a JSON object that contains the standard Autoscale Pool attributes. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + +content: + application/json: + schema: + properties: + autoscale_pool: + $ref: '../models/autoscale_pool.yml' + examples: + Single Autoscale Pool: + $ref: 'examples.yml#/autoscale_pool_single' diff --git a/specification/resources/autoscale_pools/responses/history_events.yml b/specification/resources/autoscale_pools/responses/history_events.yml new file mode 100644 index 00000000..d26b711a --- /dev/null +++ b/specification/resources/autoscale_pools/responses/history_events.yml @@ -0,0 +1,25 @@ +description: A JSON object with a key of `autoscale_pools`. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + +content: + application/json: + schema: + allOf: + - type: object + properties: + history: + type: array + items: + $ref: '../models/history.yml' + - $ref: '../../../shared/pages.yml#/pagination' + - $ref: '../../../shared/meta.yml' + examples: + All History Events: + $ref: 'examples.yml#/history_all' From 8db593c1ee1bc5982c3e8fbb401800ade2ef4db5 Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Tue, 26 Nov 2024 12:02:09 -0500 Subject: [PATCH 2/8] Address peer review comments --- .../resources/autoscale_pools/autoscale_pool_update.yml | 2 +- .../autoscale_pools/examples/curl/autoscale_pool_create.yml | 2 +- .../autoscale_pools/examples/curl/autoscale_pool_update.yml | 2 +- .../autoscale_pools/models/autoscale_pool_create.yml | 2 +- .../models/autoscale_pool_droplet_template.yml | 4 ---- .../resources/autoscale_pools/responses/examples.yml | 2 +- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/specification/resources/autoscale_pools/autoscale_pool_update.yml b/specification/resources/autoscale_pools/autoscale_pool_update.yml index 623bab73..620b5682 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_update.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_update.yml @@ -23,7 +23,7 @@ requestBody: $ref: 'examples.yml#/autoscale_update_request' responses: - '202': + '200': $ref: 'responses/autoscale_pool_create.yml' '401': diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml index cb96fac1..8a6e9403 100644 --- a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_create.yml @@ -14,7 +14,7 @@ source: |- "droplet_template": { "size": "c-2", "region": "tor1", - "image": 'ubuntu-20-04-x64', + "image": "ubuntu-20-04-x64", "tags": [ "test-ag-01" ], diff --git a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml index d667e3e7..a36f222e 100644 --- a/specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml +++ b/specification/resources/autoscale_pools/examples/curl/autoscale_pool_update.yml @@ -14,7 +14,7 @@ source: |- "droplet_template": { "size": "c-2", "region": "tor1", - "image": 'ubuntu-20-04-x64', + "image": "ubuntu-20-04-x64", "tags": [ "test-ag-01" ], diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_create.yml b/specification/resources/autoscale_pools/models/autoscale_pool_create.yml index 06163b0e..4488bc3b 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_create.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_create.yml @@ -4,7 +4,7 @@ properties: name: example: "my-autoscaler-group" type: string - description: "The human-readable name of the autoscaler group." + description: "The human-readable name of the autoscaler group. This field cannot be updated" config: oneOf: - $ref: ../models/autoscale_pool_static_config.yml diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml index b265d3c5..fa9eeeaa 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml @@ -74,7 +74,3 @@ required: - region - size - ssh_keys - - tags - - vpc_uuid - - with_droplet_agent - - user_data diff --git a/specification/resources/autoscale_pools/responses/examples.yml b/specification/resources/autoscale_pools/responses/examples.yml index ce02cd89..966e809f 100644 --- a/specification/resources/autoscale_pools/responses/examples.yml +++ b/specification/resources/autoscale_pools/responses/examples.yml @@ -63,7 +63,7 @@ autoscale_pool_single: members_all: value: droplets: - - id: 123456 + - droplet_id: 123456 created_at: 2020-11-19T20:27:18Z updated_at: 2020-12-01T00:42:16Z health_status: "healthy" From 7d139c66e702f31c9dfef0d44065b762251104b0 Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Tue, 26 Nov 2024 16:41:48 -0500 Subject: [PATCH 3/8] Address copy changes --- specification/DigitalOcean-public.v2.yaml | 8 +++--- .../autoscale_pools/autoscale_pool_create.yml | 7 ++--- .../autoscale_pools/autoscale_pool_delete.yml | 4 +-- .../autoscale_pool_delete_dangerous.yml | 8 ++---- .../autoscale_pools/autoscale_pool_list.yml | 8 +++--- .../autoscale_pool_list_members.yml | 2 +- .../autoscale_pool_droplet_template.yml | 27 +++++++++---------- .../models/autoscale_pool_dynamic_config.yml | 9 +++---- .../models/current_utilization.yml | 2 +- .../autoscale_pools/models/history.yml | 16 +++++------ .../autoscale_pools/models/member.yml | 10 +++---- .../models/member_current_utilization.yml | 4 +-- .../resources/autoscale_pools/parameters.yml | 2 +- .../responses/existing_autoscale_pool.yml | 2 +- .../responses/history_events.yml | 2 +- 15 files changed, 46 insertions(+), 65 deletions(-) diff --git a/specification/DigitalOcean-public.v2.yaml b/specification/DigitalOcean-public.v2.yaml index 4df4e51a..1b1c9cad 100644 --- a/specification/DigitalOcean-public.v2.yaml +++ b/specification/DigitalOcean-public.v2.yaml @@ -60,11 +60,9 @@ tags: - 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** + Autoscale for droplets manages horizontal scaling for your applications based on resource usage or a static configuration. + When you use autoscaling, you create one or more autoscaling pools. An autoscaling pool has 2 components: scaling configuration, which determines how the pool scales up and down, + and a Droplet template, which defines the configuration of the Droplets in the pool. - name: Billing description: |- diff --git a/specification/resources/autoscale_pools/autoscale_pool_create.yml b/specification/resources/autoscale_pools/autoscale_pool_create.yml index 73fb460f..437e0c4a 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_create.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_create.yml @@ -3,12 +3,9 @@ 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. + 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. + The response body will contain a JSON object with a key called `autoscale_pool` containing the standard attributes for the new autoscale pool. tags: - Autoscale Pools diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete.yml b/specification/resources/autoscale_pools/autoscale_pool_delete.yml index 3e956f72..2c98c5f1 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_delete.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_delete.yml @@ -3,9 +3,7 @@ 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. + 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. diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml index e358d4a5..699139ee 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml @@ -3,12 +3,8 @@ 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. + To destroy an autoscale pool and its associated resources (Droplets), + send a DELETE request to the `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/dangerous` endpoint. tags: - Autoscale Pools diff --git a/specification/resources/autoscale_pools/autoscale_pool_list.yml b/specification/resources/autoscale_pools/autoscale_pool_list.yml index c1572227..c36ebaed 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list.yml @@ -3,11 +3,9 @@ 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. + To list all autoscale pools in your team, send a GET request to `/v2/droplets/autoscale`. + The response body will be a JSON object with a key of `autoscale_pools` containing an array of autoscale pool objects. + These each contain the standard autoscale pool attributes. tags: - Autoscale Pools diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml index e66529bb..cfb37c9d 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml @@ -6,7 +6,7 @@ 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. + set to an array containing information about each of the Droplets in the autoscale pool. tags: - Autoscale Pools diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml index fa9eeeaa..932f76c9 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml @@ -2,7 +2,7 @@ properties: name: type: string example: my-droplet-name - description: "The name(s) to be applied to all droplets in the autoscale pool." + description: "The name(s) to be applied to all Droplets in the autoscale pool." region: type: string @@ -21,43 +21,43 @@ properties: - tor1 - blr1 - syd1 - description: The datacenter in which all of the droplets will be created. + description: The datacenter in which all of the Droplets will be created. size: type: string example: c-2 - description: The droplet size to be used for all droplets in the autoscale pool. - You may specify the slug or the image id. **Note that only dedicated cpus will be supported with autoscale pools.** - + description: The Droplet size to be used for all Droplets in the autoscale pool. + You may specify the slug or the image ID. + ssh_keys: type: array items: type: string example: "88:66:90:d2:68:d5:b5:85:e3:26:26:11:31:57:e6:f8" - description: Used to specify which keys should be installed on the droplets. You can either specify the key id or the fingerprint. + description: The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint. tags: type: array items: type: string example: my-tag - description: Used to apply tags to each of the droplets in the autoscale pool. + description: The tags to apply to each of the Droplets in the autoscale pool. vpc_uuid: type: string - description: Used to specify the VPC where the droplets will be created. Note that the VPC needs to exist in the region you intend to create the droplets in. + description: The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets. with_droplet_agent: type: boolean - description: Installs the droplet agent. In order for DO to monitor the droplet utilization used for the resource utilization scaling this needs to be set to true. + description: Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling. project_id: type: string - description: Allows you to specify which project the droplets will belong to. + description: The project that the Droplets in the autoscaling pool will belong to. ipv6: type: boolean - description: Will assign a unique IPV6 to each of the droplets. + description: Assigns a unique IPv6 address to each of the Droplets in the autoscaling pool. user_data: type: string @@ -65,9 +65,8 @@ properties: #cloud-config runcmd: - touch /test.txt - description: A string containing 'user data' which may be used to configure - the Droplet on first boot, often a 'cloud-config' file or Bash script. - It must be plain text and may not exceed 64 KiB in size. + description: A string containing user data that cloud-init consumes to configure a Droplet on first boot. + User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size. required: - name diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml index 8515954b..cce68e46 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml @@ -2,19 +2,19 @@ properties: min_instances: type: integer example: 5 - description: The lower bound of the number of resources in a dynamically scaling pool. + description: The minimum number of Droplets in an autoscaling pool. minimum: 0 maximum: 500 max_instances: type: integer example: 10 - description: The upper bound of the number of resources in a dynamically scaling pool. + description: The maximum number of Droplets in an autoscaling pool. minimum: 0 maximum: 1000 target_cpu_utilization: type: float example: 0.6 - description: Target cpu utilization as a decimal. + description: Target CPU utilization as a decimal. minimum: 0 maximum: 1 target_memory_utilization: @@ -26,8 +26,7 @@ properties: cooldown_minutes: type: integer example: 5 - description: To prevent thrashing there is a cool down period which may be provided - this will default to 10 minutes if not provided. + description: The number of minutes to wait between scaling events in an autoscaling pool. Defaults to 10 minutes. minimum: 5 maximum: 20 diff --git a/specification/resources/autoscale_pools/models/current_utilization.yml b/specification/resources/autoscale_pools/models/current_utilization.yml index 2da34689..09e9ff8d 100644 --- a/specification/resources/autoscale_pools/models/current_utilization.yml +++ b/specification/resources/autoscale_pools/models/current_utilization.yml @@ -10,6 +10,6 @@ properties: cpu: type: float example: 0.0007338008770232183 - description: The average cpu utilization the autoscale pool. + description: The average CPU utilization of the autoscale pool. minimum: 0 maximum: 1 diff --git a/specification/resources/autoscale_pools/models/history.yml b/specification/resources/autoscale_pools/models/history.yml index d5c91916..e104c2bb 100644 --- a/specification/resources/autoscale_pools/models/history.yml +++ b/specification/resources/autoscale_pools/models/history.yml @@ -4,39 +4,37 @@ properties: history_event_id: type: string example: 01936530-4471-7b86-9634-32d8fcfecbc6 - description: the unique identifier of the history event + description: The unique identifier of the history event. current_instance_count: type: integer example: 2 - description: the current number of instances in the autoscale pool + description: The current number of Droplets in the autoscale pool. desired_instance_count: type: integer example: 2 - description: the desired instances for the autoscale pool + description: The target number of Droplets for the autoscale pool after the scaling event. reason: type: string enum: - CONFIGURATION_CHANGE - SCALE_UP - SCALE_DOWN - description: the reason for the scaling event + description: The reason for the scaling event. status: type: string enum: - in_progress - success - error - description: status of the scaling event + description: The status of the scaling event. created_at: format: date-time - description: A time value given in ISO8601 combined date and time format - that represents when the History Event was created. + description: The creation time of the history event in ISO8601 combined date and time format. type: string example: 2020-07-28T18:00:00Z updated_at: format: date-time - description: A time value given in ISO8601 combined date and time format - that represents when the History Event was last updated. + description: The last updated time of the history event in ISO8601 combined date and time format. type: string example: 2020-07-28T18:00:00Z diff --git a/specification/resources/autoscale_pools/models/member.yml b/specification/resources/autoscale_pools/models/member.yml index 03c83036..1a83c0bd 100644 --- a/specification/resources/autoscale_pools/models/member.yml +++ b/specification/resources/autoscale_pools/models/member.yml @@ -7,20 +7,18 @@ properties: description: The unique identifier of the droplet. created_at: format: date-time - description: A time value given in ISO8601 combined date and time format - that represents when the Resource was created. + description: The creation time of the Droplet in ISO8601 combined date and time format. type: string example: 2020-07-28T18:00:00Z updated_at: format: date-time - description: A time value given in ISO8601 combined date and time format - that represents when the Resource was last updated. + description: The last updated time of the Droplet in ISO8601 combined date and time format. type: string example: 2020-07-28T18:00:00Z health_status: type: string example: 'active' - description: The health status of the resource. + description: The health status of the Droplet. status: type: string enum: @@ -28,7 +26,7 @@ properties: - active - deleting - "off" - description: The status of the resource (droplet). + description: The power status of the Droplet. current_utilization: $ref: ../models/member_current_utilization.yml diff --git a/specification/resources/autoscale_pools/models/member_current_utilization.yml b/specification/resources/autoscale_pools/models/member_current_utilization.yml index 275527ef..f9bc57c8 100644 --- a/specification/resources/autoscale_pools/models/member_current_utilization.yml +++ b/specification/resources/autoscale_pools/models/member_current_utilization.yml @@ -4,8 +4,8 @@ properties: memory: type: float example: 0.3588531587713522 - description: The memory utilization average of the individual resource. + description: The memory utilization average of the individual Droplet. cpu: type: float example: 0.0007338008770232183 - description: The cpu utilization average of the individual resource. + description: The CPU utilization average of the individual Droplet. diff --git a/specification/resources/autoscale_pools/parameters.yml b/specification/resources/autoscale_pools/parameters.yml index 8849396d..41fcaf65 100644 --- a/specification/resources/autoscale_pools/parameters.yml +++ b/specification/resources/autoscale_pools/parameters.yml @@ -1,7 +1,7 @@ autoscale_pool_id: in: path name: autoscale_pool_id - description: A unique identifier for a Autoscale Pool instance. + description: A unique identifier for an autoscale pool. required: true schema: type: string diff --git a/specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml b/specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml index b22e096c..6643b13c 100644 --- a/specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml +++ b/specification/resources/autoscale_pools/responses/existing_autoscale_pool.yml @@ -1,6 +1,6 @@ description: | The response will be a JSON object with a key called `autoscale_pool`. This will be - set to a JSON object that contains the standard Autoscale Pool attributes. + set to a JSON object that contains the standard autoscale pool attributes. headers: ratelimit-limit: diff --git a/specification/resources/autoscale_pools/responses/history_events.yml b/specification/resources/autoscale_pools/responses/history_events.yml index d26b711a..49f97444 100644 --- a/specification/resources/autoscale_pools/responses/history_events.yml +++ b/specification/resources/autoscale_pools/responses/history_events.yml @@ -1,4 +1,4 @@ -description: A JSON object with a key of `autoscale_pools`. +description: A JSON object with a key of `history`. headers: ratelimit-limit: From bca6088bf5957049ad06ac2b112ec508ae8e8836 Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Tue, 26 Nov 2024 19:03:51 -0500 Subject: [PATCH 4/8] clean linter errors --- .../autoscale_pools/autoscale_pool_create.yml | 8 ++- .../autoscale_pools/autoscale_pool_delete.yml | 2 +- .../autoscale_pool_delete_dangerous.yml | 2 +- .../autoscale_pools/autoscale_pool_get.yml | 2 +- .../autoscale_pools/autoscale_pool_list.yml | 2 +- .../autoscale_pool_list_history.yml | 6 +- .../autoscale_pool_list_members.yml | 6 +- .../autoscale_pools/autoscale_pool_update.yml | 5 +- .../resources/autoscale_pools/examples.yml | 22 +++++- .../autoscale_pools/models/autoscale_pool.yml | 1 + .../autoscale_pool_droplet_template.yml | 13 +++- .../models/autoscale_pool_dynamic_config.yml | 8 ++- .../models/autoscale_pool_static_config.yml | 2 + .../models/current_utilization.yml | 6 +- .../autoscale_pools/models/history.yml | 2 + .../autoscale_pools/models/member.yml | 1 + .../models/member_current_utilization.yml | 6 +- .../responses/autoscale_pool_create.yml | 6 ++ .../autoscale_pools/responses/examples.yml | 69 ++++++++++++++++++- 19 files changed, 148 insertions(+), 21 deletions(-) diff --git a/specification/resources/autoscale_pools/autoscale_pool_create.yml b/specification/resources/autoscale_pools/autoscale_pool_create.yml index 437e0c4a..f9e88eb9 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_create.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_create.yml @@ -1,4 +1,4 @@ -operationId: autoscale_pool_create +operationId: autoscalepools_create summary: Create a New Autoscale Pool @@ -16,8 +16,10 @@ requestBody: schema: $ref: 'models/autoscale_pool_create.yml' examples: - Autoscale Create Request: - $ref: 'examples.yml#/autoscale_create_request' + Autoscale Create Request Dynamic Config: + $ref: 'examples.yml#/autoscale_create_request_dynamic' + Autoscale Create Request Static Config: + $ref: 'examples.yml#/autoscale_create_request_static' responses: '202': diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete.yml b/specification/resources/autoscale_pools/autoscale_pool_delete.yml index 2c98c5f1..acc838a4 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_delete.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_delete.yml @@ -1,4 +1,4 @@ -operationID: autoscale_delete +operationId: autoscalepools_delete summary: Delete autoscale pool diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml index 699139ee..d90e03ea 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml @@ -1,4 +1,4 @@ -operationID: autoscale_delete_dangerouts +operationId: autoscalepools_delete_dangerous summary: Delete autoscale pool and resources diff --git a/specification/resources/autoscale_pools/autoscale_pool_get.yml b/specification/resources/autoscale_pools/autoscale_pool_get.yml index b18168a4..50f989ce 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_get.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_get.yml @@ -1,4 +1,4 @@ -operationId: autoscale_pool_get +operationId: autoscalepools_get summary: Retrieve an Existing Autoscale Pool diff --git a/specification/resources/autoscale_pools/autoscale_pool_list.yml b/specification/resources/autoscale_pools/autoscale_pool_list.yml index c36ebaed..3c5e95cd 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list.yml @@ -1,4 +1,4 @@ -operationId: autoscale_pools_list +operationId: autoscalepools_list summary: List All Autoscale Pools diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_history.yml b/specification/resources/autoscale_pools/autoscale_pool_list_history.yml index 1717e86c..d4151d0b 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list_history.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list_history.yml @@ -1,4 +1,4 @@ -operationId: autoscale_pools_history_list +operationId: autoscalepools_list_history summary: List history events @@ -14,6 +14,7 @@ tags: parameters: - $ref: '../../shared/parameters.yml#/per_page' - $ref: '../../shared/parameters.yml#/page' + - $ref: 'parameters.yml#/autoscale_pool_id' responses: '200': @@ -22,6 +23,9 @@ responses: '401': $ref: '../../shared/responses/unauthorized.yml' + '404': + $ref: '../../shared/responses/not_found.yml' + '429': $ref: '../../shared/responses/too_many_requests.yml' diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml index cfb37c9d..63bd4b77 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml @@ -1,4 +1,4 @@ -operationId: autoscale_pool_members_list +operationId: autoscalepools_list_members summary: List members @@ -14,6 +14,7 @@ tags: parameters: - $ref: '../../shared/parameters.yml#/per_page' - $ref: '../../shared/parameters.yml#/page' + - $ref: 'parameters.yml#/autoscale_pool_id' responses: '200': @@ -22,6 +23,9 @@ responses: '401': $ref: '../../shared/responses/unauthorized.yml' + '404': + $ref: '../../shared/responses/not_found.yml' + '429': $ref: '../../shared/responses/too_many_requests.yml' diff --git a/specification/resources/autoscale_pools/autoscale_pool_update.yml b/specification/resources/autoscale_pools/autoscale_pool_update.yml index 620b5682..44a3d2da 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_update.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_update.yml @@ -1,4 +1,4 @@ -operationId: autoscale_pool_update +operationId: autoscalepools_update summary: Update Autoscale Pool @@ -29,6 +29,9 @@ responses: '401': $ref: '../../shared/responses/unauthorized.yml' + '404': + $ref: '../../shared/responses/not_found.yml' + '429': $ref: '../../shared/responses/too_many_requests.yml' diff --git a/specification/resources/autoscale_pools/examples.yml b/specification/resources/autoscale_pools/examples.yml index 165e933b..5cd7ebe4 100644 --- a/specification/resources/autoscale_pools/examples.yml +++ b/specification/resources/autoscale_pools/examples.yml @@ -1,4 +1,4 @@ -autoscale_create_request: +autoscale_create_request_dynamic: value: name: "my-autoscale-pool" config: @@ -21,6 +21,26 @@ autoscale_create_request: - web user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 +autoscale_create_request_static: + value: + name: "my-autoscale-pool" + config: + target_number_instances: 2 + droplet_template: + name: example.com + region: nyc3 + size: c-2 + image: ubuntu-20-04-x64 + ssh_keys: + - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 + backups: true + ipv6: true + monitoring: true + tags: + - env:prod + - web + user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" + vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 autoscale_update_request: value: name: "my-autoscale-pool" diff --git a/specification/resources/autoscale_pools/models/autoscale_pool.yml b/specification/resources/autoscale_pools/models/autoscale_pool.yml index 00013991..8c7a0075 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool.yml @@ -50,6 +50,7 @@ properties: - deleting - error description: The current status of the autoscale pool. + example: active active_resources_count: type: integer diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml index 932f76c9..3e7c9d8a 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml @@ -1,3 +1,5 @@ +type: object + properties: name: type: string @@ -6,6 +8,7 @@ properties: region: type: string + example: tor1 enum: - nyc1 - nyc2 @@ -33,31 +36,37 @@ properties: type: array items: type: string - example: "88:66:90:d2:68:d5:b5:85:e3:26:26:11:31:57:e6:f8" + example: + - "88:66:90:d2:68:d5:b5:85:e3:26:26:11:31:57:e6:f8" description: The SSH keys to be installed on the Droplets in the autoscale pool. You can either specify the key ID or the fingerprint. tags: type: array items: type: string - example: my-tag + example: + - my-tag description: The tags to apply to each of the Droplets in the autoscale pool. vpc_uuid: type: string description: The VPC where the Droplets in the autoscale pool will be created. The VPC must be in the region where you want to create the Droplets. + example: 760e09ef-dc84-11e8-981e-3cfdfeaae000 with_droplet_agent: type: boolean description: Installs the Droplet agent. This must be set to true to monitor Droplets for resource utilization scaling. + example: true project_id: type: string description: The project that the Droplets in the autoscaling pool will belong to. + example: 746c6152-2fa2-11ed-92d3-27aaa54e4988 ipv6: type: boolean description: Assigns a unique IPv6 address to each of the Droplets in the autoscaling pool. + example: true user_data: type: string diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml index cce68e46..7d3176a5 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml @@ -1,3 +1,5 @@ +type: object + properties: min_instances: type: integer @@ -12,13 +14,15 @@ properties: minimum: 0 maximum: 1000 target_cpu_utilization: - type: float + type: number + format: float example: 0.6 description: Target CPU utilization as a decimal. minimum: 0 maximum: 1 target_memory_utilization: - type: float + type: number + format: float example: 0.6 description: Target memory utilization as a decimal. minimum: 0 diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml b/specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml index a4d8872c..415fb5fa 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_static_config.yml @@ -1,3 +1,5 @@ +type: object + properties: target_number_instances: title: static config diff --git a/specification/resources/autoscale_pools/models/current_utilization.yml b/specification/resources/autoscale_pools/models/current_utilization.yml index 09e9ff8d..47e0536b 100644 --- a/specification/resources/autoscale_pools/models/current_utilization.yml +++ b/specification/resources/autoscale_pools/models/current_utilization.yml @@ -2,13 +2,15 @@ type: object properties: memory: - type: float + type: number + format: float example: 0.3588531587713522 description: The average memory utilization of the autoscale pool. minimum: 0 maximum: 1 cpu: - type: float + type: number + format: float example: 0.0007338008770232183 description: The average CPU utilization of the autoscale pool. minimum: 0 diff --git a/specification/resources/autoscale_pools/models/history.yml b/specification/resources/autoscale_pools/models/history.yml index e104c2bb..1ffd3147 100644 --- a/specification/resources/autoscale_pools/models/history.yml +++ b/specification/resources/autoscale_pools/models/history.yml @@ -20,6 +20,7 @@ properties: - SCALE_UP - SCALE_DOWN description: The reason for the scaling event. + example: 'CONFIGURATION_CHANGE' status: type: string enum: @@ -27,6 +28,7 @@ properties: - success - error description: The status of the scaling event. + example: 'success' created_at: format: date-time description: The creation time of the history event in ISO8601 combined date and time format. diff --git a/specification/resources/autoscale_pools/models/member.yml b/specification/resources/autoscale_pools/models/member.yml index 1a83c0bd..f885c05f 100644 --- a/specification/resources/autoscale_pools/models/member.yml +++ b/specification/resources/autoscale_pools/models/member.yml @@ -27,6 +27,7 @@ properties: - deleting - "off" description: The power status of the Droplet. + example: "active" current_utilization: $ref: ../models/member_current_utilization.yml diff --git a/specification/resources/autoscale_pools/models/member_current_utilization.yml b/specification/resources/autoscale_pools/models/member_current_utilization.yml index f9bc57c8..1dabe39e 100644 --- a/specification/resources/autoscale_pools/models/member_current_utilization.yml +++ b/specification/resources/autoscale_pools/models/member_current_utilization.yml @@ -2,10 +2,12 @@ type: object properties: memory: - type: float + type: number + format: float example: 0.3588531587713522 description: The memory utilization average of the individual Droplet. cpu: - type: float + type: number + format: float example: 0.0007338008770232183 description: The CPU utilization average of the individual Droplet. diff --git a/specification/resources/autoscale_pools/responses/autoscale_pool_create.yml b/specification/resources/autoscale_pools/responses/autoscale_pool_create.yml index f40b6a77..f3b0b4ba 100644 --- a/specification/resources/autoscale_pools/responses/autoscale_pool_create.yml +++ b/specification/resources/autoscale_pools/responses/autoscale_pool_create.yml @@ -14,3 +14,9 @@ content: properties: autoscale_pool: $ref: '../models/autoscale_pool.yml' + + examples: + Autoscale Create Response Dynamic Config: + $ref: 'examples.yml#/autoscale_create_response_dynamic' + Autoscale Create Response Static Config: + $ref: 'examples.yml#/autoscale_create_response_static' \ No newline at end of file diff --git a/specification/resources/autoscale_pools/responses/examples.yml b/specification/resources/autoscale_pools/responses/examples.yml index 966e809f..ff827447 100644 --- a/specification/resources/autoscale_pools/responses/examples.yml +++ b/specification/resources/autoscale_pools/responses/examples.yml @@ -9,13 +9,13 @@ autoscale_pools_all: target_cpu_utilization: 0.5 cooldown_minutes: 10 droplet_template: + name: "droplet-name" size: c-2 region: tor1 image: ubuntu-20-04-x64 tags: - my-tag ssh_keys: - - 289794 - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 with_droplet_agent: true @@ -29,6 +29,10 @@ autoscale_pools_all: cpu: 0.0007338008770232183 status: active active_resources_count: 1 + links: + pages: + meta: + total: 1 autoscale_pool_single: value: autoscale_pool: @@ -40,13 +44,13 @@ autoscale_pool_single: target_cpu_utilization: 0.5 cooldown_minutes: 10 droplet_template: + name: "droplet-name" size: c-2 region: tor1 image: 'ubuntu-20-04-x64' tags: - my-tag ssh_keys: - - 289794 - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 with_droplet_agent: true @@ -71,6 +75,10 @@ members_all: current_utilization: memory: 0.3588531587713522 cpu: 0.0007338008770232183 + links: + pages: + meta: + total: 1 history_all: value: history: @@ -81,3 +89,60 @@ history_all: status: "success" created_at: 2020-11-19T20:27:18Z updated_at: 2020-12-01T00:42:16Z + links: + pages: + meta: + total: 1 +autoscale_create_response_dynamic: + value: + autoscale_pool: + id: 0d3db13e-a604-4944-9827-7ec2642d32ac + name: "test-autoscaler-group-01" + config: + min_instances: 1 + max_instances: 5 + target_cpu_utilization: 0.5 + cooldown_minutes: 10 + droplet_template: + name: "droplet-name" + size: c-2 + region: tor1 + image: 'ubuntu-20-04-x64' + tags: + - my-tag + ssh_keys: + - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 + vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 + with_droplet_agent: true + project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 + ipv6: true + user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" + created_at: 2020-11-19T20:27:18Z + updated_at: 2020-12-01T00:42:16Z + status: active + active_resources_count: 1 +autoscale_create_response_static: + value: + autoscale_pool: + id: 0d3db13e-a604-4944-9827-7ec2642d32ac + name: "test-autoscaler-group-01" + config: + target_number_instances: 1 + droplet_template: + name: "droplet-name" + size: c-2 + region: tor1 + image: 'ubuntu-20-04-x64' + tags: + - my-tag + ssh_keys: + - 3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45 + vpc_uuid: 760e09ef-dc84-11e8-981e-3cfdfeaae000 + with_droplet_agent: true + project_id: 746c6152-2fa2-11ed-92d3-27aaa54e4988 + ipv6: true + user_data: "#cloud-config\nruncmd:\n - touch /test.txt\n" + created_at: 2020-11-19T20:27:18Z + updated_at: 2020-12-01T00:42:16Z + status: active + active_resources_count: 1 From 59aa82b91005e1e1bb4ba7c63083963146335727 Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Mon, 2 Dec 2024 16:22:07 -0500 Subject: [PATCH 5/8] Address copy comments p2 --- specification/DigitalOcean-public.v2.yaml | 2 +- .../autoscale_pool_list_members.yml | 2 +- .../autoscale_pools/autoscale_pool_update.yml | 2 +- .../autoscale_pools/models/autoscale_pool.yml | 18 +++++++++--------- .../models/autoscale_pool_create.yml | 10 +++++----- .../models/autoscale_pool_dynamic_config.yml | 6 +++--- .../autoscale_pools/models/member.yml | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/specification/DigitalOcean-public.v2.yaml b/specification/DigitalOcean-public.v2.yaml index 1b1c9cad..c65f70ee 100644 --- a/specification/DigitalOcean-public.v2.yaml +++ b/specification/DigitalOcean-public.v2.yaml @@ -60,7 +60,7 @@ tags: - name: Autoscale Pools description: |- - Autoscale for droplets manages horizontal scaling for your applications based on resource usage or a static configuration. + Autoscaling for Droplets manages horizontal scaling for your applications based on resource usage or a static configuration. When you use autoscaling, you create one or more autoscaling pools. An autoscaling pool has 2 components: scaling configuration, which determines how the pool scales up and down, and a Droplet template, which defines the configuration of the Droplets in the pool. diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml index 63bd4b77..892bf19f 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml @@ -3,7 +3,7 @@ operationId: autoscalepools_list_members 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`. + To list the Droplets 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. diff --git a/specification/resources/autoscale_pools/autoscale_pool_update.yml b/specification/resources/autoscale_pools/autoscale_pool_update.yml index 44a3d2da..49cbf304 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_update.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_update.yml @@ -4,7 +4,7 @@ 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 + `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`. The request must contain a full representation of the autoscale pool including existing attributes. tags: diff --git a/specification/resources/autoscale_pools/models/autoscale_pool.yml b/specification/resources/autoscale_pools/models/autoscale_pool.yml index 8c7a0075..2c567d74 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool.yml @@ -4,22 +4,22 @@ properties: id: type: string example: 0d3db13e-a604-4944-9827-7ec2642d32ac - description: A unique identifier for each Autoscale pool instance. This is - automatically generated upon Autoscale Pool creation. + description: A unique identifier for each autoscale pool instance. This is + automatically generated upon autoscale pool creation. name: type: string example: my-autoscale-pool - description: The human-readable name set for the Autoscale Pool. + description: The human-readable name set for the autoscale pool. config: oneOf: - $ref: ../models/autoscale_pool_static_config.yml - $ref: ../models/autoscale_pool_dynamic_config.yml type: object - description: This is the scaling configuration for an autoscale pool - Currently 2 methods are supported for how an autoscaling pool scales up and down. - Additional methods may be added in future releases. + description: The scaling configuration for an autoscale pool, which + is how the pool scales up and down (either by resource utilization + or static configuration). droplet_template: $ref: ../models/autoscale_pool_droplet_template.yml @@ -33,7 +33,7 @@ properties: type: string example: 2020-07-28T18:00:00Z description: A time value given in ISO8601 combined date and time format - that represents when the Autoscale Pool was created. + that represents when the autoscale pool was created. updated_at: format: date-time @@ -41,7 +41,7 @@ properties: type: string example: 2020-07-28T18:00:00Z description: A time value given in ISO8601 combined date and time format - that represents when the Autoscale Pool was last updated. + that represents when the autoscale pool was last updated. status: type: string @@ -55,7 +55,7 @@ properties: active_resources_count: type: integer example: 1 - description: The number of active resources in the autoscale pool. + description: The number of active Droplets in the autoscale pool. required: - id diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_create.yml b/specification/resources/autoscale_pools/models/autoscale_pool_create.yml index 4488bc3b..fd1e8e5e 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_create.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_create.yml @@ -2,17 +2,17 @@ type: object properties: name: - example: "my-autoscaler-group" + example: "my-autoscale-pool" type: string - description: "The human-readable name of the autoscaler group. This field cannot be updated" + description: "The human-readable name of the autoscale pool. This field cannot be updated" config: oneOf: - $ref: ../models/autoscale_pool_static_config.yml - $ref: ../models/autoscale_pool_dynamic_config.yml type: object - description: This is the scaling configuration for an autoscale pool - Currently 2 methods are supported for how an autoscaling pool scales up and down. - Additional methods may be added in future releases. + description: The scaling configuration for an autoscale pool, which + is how the pool scales up and down (either by resource utilization + or static configuration). droplet_template: $ref: ../models/autoscale_pool_droplet_template.yml diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml index 7d3176a5..01ac741c 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml @@ -4,13 +4,13 @@ properties: min_instances: type: integer example: 5 - description: The minimum number of Droplets in an autoscaling pool. + description: The minimum number of Droplets in an autoscale pool. minimum: 0 maximum: 500 max_instances: type: integer example: 10 - description: The maximum number of Droplets in an autoscaling pool. + description: The maximum number of Droplets in an autoscale pool. minimum: 0 maximum: 1000 target_cpu_utilization: @@ -30,7 +30,7 @@ properties: cooldown_minutes: type: integer example: 5 - description: The number of minutes to wait between scaling events in an autoscaling pool. Defaults to 10 minutes. + description: The number of minutes to wait between scaling events in an autoscale pool. Defaults to 10 minutes. minimum: 5 maximum: 20 diff --git a/specification/resources/autoscale_pools/models/member.yml b/specification/resources/autoscale_pools/models/member.yml index f885c05f..43a024e1 100644 --- a/specification/resources/autoscale_pools/models/member.yml +++ b/specification/resources/autoscale_pools/models/member.yml @@ -4,7 +4,7 @@ properties: droplet_id: type: integer example: 459903570 - description: The unique identifier of the droplet. + description: The unique identifier of the Droplet. created_at: format: date-time description: The creation time of the Droplet in ISO8601 combined date and time format. From 64f71dfd064dc70946128aba542b667a3754182a Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Thu, 5 Dec 2024 10:27:05 -0500 Subject: [PATCH 6/8] rename to droplet autoscale pools --- specification/DigitalOcean-public.v2.yaml | 12 ++++++------ .../autoscale_pools/autoscale_pool_create.yml | 2 +- .../autoscale_pools/autoscale_pool_delete.yml | 2 +- .../autoscale_pool_delete_dangerous.yml | 2 +- .../resources/autoscale_pools/autoscale_pool_get.yml | 2 +- .../autoscale_pools/autoscale_pool_list.yml | 2 +- .../autoscale_pools/autoscale_pool_list_history.yml | 2 +- .../autoscale_pools/autoscale_pool_list_members.yml | 2 +- .../autoscale_pools/autoscale_pool_update.yml | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/specification/DigitalOcean-public.v2.yaml b/specification/DigitalOcean-public.v2.yaml index c65f70ee..3f739378 100644 --- a/specification/DigitalOcean-public.v2.yaml +++ b/specification/DigitalOcean-public.v2.yaml @@ -58,12 +58,6 @@ 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: |- - Autoscaling for Droplets manages horizontal scaling for your applications based on resource usage or a static configuration. - When you use autoscaling, you create one or more autoscaling pools. An autoscaling pool has 2 components: scaling configuration, which determines how the pool scales up and down, - and a Droplet template, which defines the configuration of the Droplets in the pool. - - name: Billing description: |- The billing endpoints allow you to retrieve your account balance, invoices @@ -234,6 +228,12 @@ tags: types. Find more information about each of these objects in their respective sections. + - name: Droplet Autoscale Pools + description: |- + Autoscaling for Droplets manages horizontal scaling for your applications based on resource usage or a static configuration. + When you use autoscaling, you create one or more autoscaling pools. An autoscaling pool has 2 components: scaling configuration, which determines how the pool scales up and down, + and a Droplet template, which defines the configuration of the Droplets in the pool. + - name: Firewalls description: |- [DigitalOcean Cloud Firewalls](https://docs.digitalocean.com/products/networking/firewalls/) diff --git a/specification/resources/autoscale_pools/autoscale_pool_create.yml b/specification/resources/autoscale_pools/autoscale_pool_create.yml index f9e88eb9..2d039d1d 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_create.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_create.yml @@ -8,7 +8,7 @@ description: | The response body will contain a JSON object with a key called `autoscale_pool` containing the standard attributes for the new autoscale pool. tags: - - Autoscale Pools + - Droplet Autoscale Pools requestBody: content: diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete.yml b/specification/resources/autoscale_pools/autoscale_pool_delete.yml index acc838a4..74cd40ec 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_delete.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_delete.yml @@ -8,7 +8,7 @@ description: | A successful response will include a 202 response code and no content. tags: - - Autoscale Pools + - Droplet Autoscale Pools parameters: - $ref: 'parameters.yml#/autoscale_pool_id' diff --git a/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml index d90e03ea..6309ab7f 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_delete_dangerous.yml @@ -7,7 +7,7 @@ description: | send a DELETE request to the `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID/dangerous` endpoint. tags: - - Autoscale Pools + - Droplet Autoscale Pools parameters: - $ref: 'parameters.yml#/autoscale_pool_id' diff --git a/specification/resources/autoscale_pools/autoscale_pool_get.yml b/specification/resources/autoscale_pools/autoscale_pool_get.yml index 50f989ce..cc812726 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_get.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_get.yml @@ -7,7 +7,7 @@ description: | `/v2/droplets/autoscale/$AUTOSCALE_POOL_ID`. tags: - - Autoscale Pools + - Droplet Autoscale Pools parameters: - $ref: 'parameters.yml#/autoscale_pool_id' diff --git a/specification/resources/autoscale_pools/autoscale_pool_list.yml b/specification/resources/autoscale_pools/autoscale_pool_list.yml index 3c5e95cd..ec5a6267 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list.yml @@ -8,7 +8,7 @@ description: | These each contain the standard autoscale pool attributes. tags: - - Autoscale Pools + - Droplet Autoscale Pools parameters: - $ref: '../../shared/parameters.yml#/per_page' diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_history.yml b/specification/resources/autoscale_pools/autoscale_pool_list_history.yml index d4151d0b..426706c3 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list_history.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list_history.yml @@ -9,7 +9,7 @@ description: | set to an array containing objects each representing a history event. tags: - - Autoscale Pools + - Droplet Autoscale Pools parameters: - $ref: '../../shared/parameters.yml#/per_page' diff --git a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml index 892bf19f..7b8ee23f 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list_members.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list_members.yml @@ -9,7 +9,7 @@ description: | set to an array containing information about each of the Droplets in the autoscale pool. tags: - - Autoscale Pools + - Droplet Autoscale Pools parameters: - $ref: '../../shared/parameters.yml#/per_page' diff --git a/specification/resources/autoscale_pools/autoscale_pool_update.yml b/specification/resources/autoscale_pools/autoscale_pool_update.yml index 49cbf304..46278e1d 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_update.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_update.yml @@ -8,7 +8,7 @@ description: | of the autoscale pool including existing attributes. tags: - - Autoscale Pools + - Droplet Autoscale Pools parameters: - $ref: 'parameters.yml#/autoscale_pool_id' From b7eb2f5d056e8c52eb98ed3a3e2369846c802159 Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Fri, 6 Dec 2024 18:14:36 -0500 Subject: [PATCH 7/8] Address open PR comments --- .../models/autoscale_pool_droplet_template.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml index 3e7c9d8a..dbdb7768 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml @@ -30,6 +30,11 @@ properties: type: string example: c-2 description: The Droplet size to be used for all Droplets in the autoscale pool. + + image: + type: string + example: ubuntu-20-04-x64 + description: The Droplet image to be used for all Droplets in the autoscale pool. You may specify the slug or the image ID. ssh_keys: @@ -78,7 +83,7 @@ properties: User data is often a cloud-config file or Bash script. It must be plain text and may not exceed 64 KiB in size. required: - - name - region + - image - size - ssh_keys From afa3e309e30e4d08a0b4a2cc39fbb5cd8c2993ad Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Mon, 16 Dec 2024 09:56:49 -0500 Subject: [PATCH 8/8] Address last couple of comments and add some recent dev changes --- specification/DigitalOcean-public.v2.yaml | 4 +--- .../resources/autoscale_pools/autoscale_pool_list.yml | 1 + .../models/autoscale_pool_droplet_template.yml | 4 ++-- .../models/autoscale_pool_dynamic_config.yml | 8 ++++---- specification/resources/autoscale_pools/parameters.yml | 7 +++++++ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/specification/DigitalOcean-public.v2.yaml b/specification/DigitalOcean-public.v2.yaml index 3f739378..d29ec984 100644 --- a/specification/DigitalOcean-public.v2.yaml +++ b/specification/DigitalOcean-public.v2.yaml @@ -230,9 +230,7 @@ tags: - name: Droplet Autoscale Pools description: |- - Autoscaling for Droplets manages horizontal scaling for your applications based on resource usage or a static configuration. - When you use autoscaling, you create one or more autoscaling pools. An autoscaling pool has 2 components: scaling configuration, which determines how the pool scales up and down, - and a Droplet template, which defines the configuration of the Droplets in the pool. + Droplet autoscale pools manage automatic horizontal scaling for your applications based on resource usage (CPU, memory, or both) or a static configuration. - name: Firewalls description: |- diff --git a/specification/resources/autoscale_pools/autoscale_pool_list.yml b/specification/resources/autoscale_pools/autoscale_pool_list.yml index ec5a6267..3a40dc5e 100644 --- a/specification/resources/autoscale_pools/autoscale_pool_list.yml +++ b/specification/resources/autoscale_pools/autoscale_pool_list.yml @@ -13,6 +13,7 @@ tags: parameters: - $ref: '../../shared/parameters.yml#/per_page' - $ref: '../../shared/parameters.yml#/page' + - $ref: './parameters.yml#/autoscale_pool_name' responses: '200': diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml index dbdb7768..990d132b 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_droplet_template.yml @@ -65,12 +65,12 @@ properties: project_id: type: string - description: The project that the Droplets in the autoscaling pool will belong to. + description: The project that the Droplets in the autoscale pool will belong to. example: 746c6152-2fa2-11ed-92d3-27aaa54e4988 ipv6: type: boolean - description: Assigns a unique IPv6 address to each of the Droplets in the autoscaling pool. + description: Assigns a unique IPv6 address to each of the Droplets in the autoscale pool. example: true user_data: diff --git a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml index 01ac741c..2cf9b4fc 100644 --- a/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml +++ b/specification/resources/autoscale_pools/models/autoscale_pool_dynamic_config.yml @@ -5,27 +5,27 @@ properties: type: integer example: 5 description: The minimum number of Droplets in an autoscale pool. - minimum: 0 + minimum: 1 maximum: 500 max_instances: type: integer example: 10 description: The maximum number of Droplets in an autoscale pool. - minimum: 0 + minimum: 1 maximum: 1000 target_cpu_utilization: type: number format: float example: 0.6 description: Target CPU utilization as a decimal. - minimum: 0 + minimum: 0.05 maximum: 1 target_memory_utilization: type: number format: float example: 0.6 description: Target memory utilization as a decimal. - minimum: 0 + minimum: 0.05 maximum: 1 cooldown_minutes: type: integer diff --git a/specification/resources/autoscale_pools/parameters.yml b/specification/resources/autoscale_pools/parameters.yml index 41fcaf65..503781ca 100644 --- a/specification/resources/autoscale_pools/parameters.yml +++ b/specification/resources/autoscale_pools/parameters.yml @@ -15,3 +15,10 @@ x_dangerous: type: boolean example: true required: true +autoscale_pool_name: + name: name + in: query + description: The name of the autoscale pool + schema: + type: string + example: my-autoscale-pool