From bca6088bf5957049ad06ac2b112ec508ae8e8836 Mon Sep 17 00:00:00 2001 From: Stephen Varela Date: Tue, 26 Nov 2024 19:03:51 -0500 Subject: [PATCH] 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