Skip to content

Commit

Permalink
Add missing refs for autoscaler monitoring (#963)
Browse files Browse the repository at this point in the history
* Add missing refs for autoscaler monitoring

* Fix lint

---------

Co-authored-by: Andrew Starr-Bochicchio <andrewsomething@users.noreply.github.com>
  • Loading branch information
asaha2 and andrewsomething authored Jan 9, 2025
1 parent c31efb9 commit 7e90337
Show file tree
Hide file tree
Showing 18 changed files with 331 additions and 0 deletions.
24 changes: 24 additions & 0 deletions specification/DigitalOcean-public.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,30 @@ paths:
get:
$ref: 'resources/monitoring/monitoring_get_lb_droplets_downtime.yml'

/v2/monitoring/metrics/droplet_autoscale/current_instances:
get:
$ref: 'resources/monitoring/monitoring_get_droplet_autoscale_current_instances.yml'

/v2/monitoring/metrics/droplet_autoscale/target_instances:
get:
$ref: 'resources/monitoring/monitoring_get_droplet_autoscale_target_instances.yml'

/v2/monitoring/metrics/droplet_autoscale/current_cpu_utilization:
get:
$ref: 'resources/monitoring/monitoring_get_droplet_autoscale_current_cpu_utilization.yml'

/v2/monitoring/metrics/droplet_autoscale/target_cpu_utilization:
get:
$ref: 'resources/monitoring/monitoring_get_droplet_autoscale_target_cpu_utilization.yml'

/v2/monitoring/metrics/droplet_autoscale/current_memory_utilization:
get:
$ref: 'resources/monitoring/monitoring_get_droplet_autoscale_current_memory_utilization.yml'

/v2/monitoring/metrics/droplet_autoscale/target_memory_utilization:
get:
$ref: 'resources/monitoring/monitoring_get_droplet_autoscale_target_memory_utilization.yml'

/v2/monitoring/sinks/destinations:
post:
$ref: 'resources/monitoring/monitoring_create_destination.yml'
Expand Down
Original file line number Diff line number Diff line change
@@ -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/monitoring/metrics/droplet_autoscale/current_cpu_utilization?autoscale_pool_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -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/monitoring/metrics/droplet_autoscale/current_instances?autoscale_pool_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -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/monitoring/metrics/droplet_autoscale/current_memory_utilization?autoscale_pool_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -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/monitoring/metrics/droplet_autoscale/target_cpu_utilization?autoscale_pool_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -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/monitoring/metrics/droplet_autoscale/target_instances?autoscale_pool_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
Original file line number Diff line number Diff line change
@@ -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/monitoring/metrics/droplet_autoscale/target_memory_utilization?autoscale_pool_id=4de7ac8b-495b-4884-9a69-1050c6793cd6&start=1636051668&end=1636051668"
8 changes: 8 additions & 0 deletions specification/resources/monitoring/models/alert_policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ properties:
- v1/dbaas/alerts/memory_utilization_alerts
- v1/dbaas/alerts/disk_utilization_alerts
- v1/dbaas/alerts/cpu_alerts
- v1/droplet/autoscale_alerts/current_instances
- v1/droplet/autoscale_alerts/target_instances
- v1/droplet/autoscale_alerts/current_cpu_utilization
- v1/droplet/autoscale_alerts/target_cpu_utilization
- v1/droplet/autoscale_alerts/current_memory_utilization
- v1/droplet/autoscale_alerts/target_memory_utilization
- v1/droplet/autoscale_alerts/scale_up
- v1/droplet/autoscale_alerts/scale_down
example: v1/insights/droplet/cpu
uuid:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ properties:
- v1/dbaas/alerts/memory_utilization_alerts
- v1/dbaas/alerts/disk_utilization_alerts
- v1/dbaas/alerts/cpu_alerts
- v1/droplet/autoscale_alerts/current_instances
- v1/droplet/autoscale_alerts/target_instances
- v1/droplet/autoscale_alerts/current_cpu_utilization
- v1/droplet/autoscale_alerts/target_cpu_utilization
- v1/droplet/autoscale_alerts/current_memory_utilization
- v1/droplet/autoscale_alerts/target_memory_utilization
- v1/droplet/autoscale_alerts/scale_up
- v1/droplet/autoscale_alerts/scale_down
example: v1/insights/droplet/cpu
value:
type: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ requestBody:
`v1/dbaas/alerts/memory_utilization_alerts` | alert on the percent memory utilization average across the database cluster | database cluster UUID
`v1/dbaas/alerts/disk_utilization_alerts` | alert on the percent disk utilization average across the database cluster | database cluster UUID
`v1/dbaas/alerts/cpu_alerts` | alert on the percent CPU usage average across the database cluster | database cluster UUID
`v1/droplet/autoscale_alerts/current_instances` | alert on current pool size | autoscale pool ID
`v1/droplet/autoscale_alerts/target_instances` | alert on target pool size | autoscale pool ID
`v1/droplet/autoscale_alerts/current_cpu_utilization` | alert on current average CPU utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/target_cpu_utilization` | alert on target average CPU utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/current_memory_utilization` | alert on current average memory utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/target_memory_utilization` | alert on target average memory utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/scale_up` | alert on scale up event | autoscale pool ID
`v1/droplet/autoscale_alerts/scale_down` | alert on scale down event | autoscale pool ID
required: true
content:
application/json:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
operationId: monitoring_get_droplet_autoscale_current_cpu_utilization.yml

summary: Get Droplet Autoscale Pool Current Average CPU utilization

description: >-
To retrieve the current average CPU utilization for a given Droplet Autoscale Pool,
send a GET request to `/v2/monitoring/metrics/droplet_autoscale/current_cpu_utilization`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.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'

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

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

security:
- bearer_auth:
- 'monitoring:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
operationId: monitoring_get_droplet_autoscale_current_instances

summary: Get Droplet Autoscale Pool Current Size

description: >-
To retrieve the current size for a given Droplet Autoscale Pool,
send a GET request to `/v2/monitoring/metrics/droplet_autoscale/current_instances`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.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'

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

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

security:
- bearer_auth:
- 'monitoring:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
operationId: monitoring_get_droplet_autoscale_current_memory_utilization

summary: Get Droplet Autoscale Pool Current Average Memory utilization

description: >-
To retrieve the current average memory utilization for a given Droplet Autoscale Pool,
send a GET request to `/v2/monitoring/metrics/droplet_autoscale/current_memory_utilization`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.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'

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

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

security:
- bearer_auth:
- 'monitoring:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
operationId: monitoring_get_droplet_autoscale_target_cpu_utilization

summary: Get Droplet Autoscale Pool Target Average CPU utilization

description: >-
To retrieve the target average CPU utilization for a given Droplet Autoscale Pool,
send a GET request to `/v2/monitoring/metrics/droplet_autoscale/target_cpu_utilization`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.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'

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

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

security:
- bearer_auth:
- 'monitoring:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
operationId: monitoring_get_droplet_autoscale_target_instances

summary: Get Droplet Autoscale Pool Target Size

description: >-
To retrieve the target size for a given Droplet Autoscale Pool,
send a GET request to `/v2/monitoring/metrics/droplet_autoscale/target_instances`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.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'

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

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

security:
- bearer_auth:
- 'monitoring:read'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
operationId: monitoring_get_droplet_autoscale_target_memory_utilization

summary: Get Droplet Autoscale Pool Target Average Memory utilization

description: >-
To retrieve the target average memory utilization for a given Droplet Autoscale Pool,
send a GET request to `/v2/monitoring/metrics/droplet_autoscale/target_memory_utilization`.
tags:
- Monitoring

responses:
'200':
$ref: 'responses/metric_response.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'

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

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

security:
- bearer_auth:
- 'monitoring:read'
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ requestBody:
`v1/dbaas/alerts/memory_utilization_alerts` | alert on the percent memory utilization average across the database cluster | database cluster UUID
`v1/dbaas/alerts/disk_utilization_alerts` | alert on the percent disk utilization average across the database cluster | database cluster UUID
`v1/dbaas/alerts/cpu_alerts` | alert on the percent CPU usage average across the database cluster | database cluster UUID
`v1/droplet/autoscale_alerts/current_instances` | alert on current pool size | autoscale pool ID
`v1/droplet/autoscale_alerts/target_instances` | alert on target pool size | autoscale pool ID
`v1/droplet/autoscale_alerts/current_cpu_utilization` | alert on current average CPU utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/target_cpu_utilization` | alert on target average CPU utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/current_memory_utilization` | alert on current average memory utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/target_memory_utilization` | alert on target average memory utilization | autoscale pool ID
`v1/droplet/autoscale_alerts/scale_up` | alert on scale up event | autoscale pool ID
`v1/droplet/autoscale_alerts/scale_down` | alert on scale down event | autoscale pool ID
required: true
content:
application/json:
Expand Down
11 changes: 11 additions & 0 deletions specification/resources/monitoring/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ network_interface:
enum:
- private
- public

network_direction:
in: query
name: direction
Expand All @@ -64,6 +65,16 @@ network_direction:
enum:
- inbound
- outbound

autoscale_pool_id:
in: query
name: autoscale_pool_id
description: A unique identifier for an autoscale pool.
required: true
schema:
type: string
example: 0d3db13e-a604-4944-9827-7ec2642d32ac

metric_timestamp_start:
in: query
name: start
Expand Down

0 comments on commit 7e90337

Please sign in to comment.