From 3e736c0e0b273778a7e6251b1c0fd41b6316cf06 Mon Sep 17 00:00:00 2001 From: blewis Date: Mon, 25 Sep 2023 13:42:34 -0700 Subject: [PATCH 1/5] initial scaffold for infra-scaling section --- .../autoscale/groups/AutoscaleGroup.yml | 52 +++++++++++++++++++ .../groups/AutoscaleGroupInfrastructure.yml | 35 +++++++++++++ .../autoscale/groups/AutoscaleGroupScale.yml | 22 ++++++++ .../infrastructure/autoscale/groups/group.yml | 0 .../autoscale/groups/groups.yml | 0 5 files changed, 109 insertions(+) create mode 100644 components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml create mode 100644 components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml create mode 100644 components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml create mode 100644 public/paths/infrastructure/autoscale/groups/group.yml create mode 100644 public/paths/infrastructure/autoscale/groups/groups.yml diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml new file mode 100644 index 00000000..5c3b1a1f --- /dev/null +++ b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml @@ -0,0 +1,52 @@ +title: Group +type: object +required: + - id + - name + - identifier + - creator + - hub_id + - cluster + - infrastructure + - state + - events + - cache +properties: + id: + type: string + name: + type: string + identifier: + type: string + creator: + hub_id: + type: string + cluster: + type: string + scale: + $ref: "./Scale.yml" + infrastructure: + state: + $ref: ../../../State.yml + events: + title: AutoscaleGroupEvents + type: object + description: A collection of timestamps for each event in the network's lifetime. + required: + - created + - updated + - deleted + - last_sync + properties: + created: + description: The timestamp of when the autoscale group was created. + $ref: ../../../DateTime.yml + updated: + description: The timestamp of when the autoscale group was updated. + $ref: ../../../DateTime.yml + deleted: + description: The timestamp of when the autoscale group was deleted. + $ref: ../../../DateTime.yml + last_sync: + description: The timestamp of when the autoscale group was last synced. + $ref: ../../../DateTime.yml diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml new file mode 100644 index 00000000..bc375e59 --- /dev/null +++ b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml @@ -0,0 +1,35 @@ +title: AutoscaleGroupInfrastructure +type: object +required: + - models +properties: + models: + type: array + items: + type: object + required: + - provider + - id + - priority + - locations + properties: + provider: + type: string + id: + type: string + priority: + type: integer + location: + type: array + items: + type: object + required: + - id + - availability_zones + properties: + id: + type: string + availability_zones: + type: array + items: + type: string diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml new file mode 100644 index 00000000..9a507884 --- /dev/null +++ b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml @@ -0,0 +1,22 @@ +title: Scale +type: object +required: + - enable +properties: + enable: + type: boolean + down: + type: object + properties: + minimum: + type: integer + method: + type: string + enum: + - fifo + - lifo + up: + type: object + properties: + maximum: + type: integer diff --git a/public/paths/infrastructure/autoscale/groups/group.yml b/public/paths/infrastructure/autoscale/groups/group.yml new file mode 100644 index 00000000..e69de29b diff --git a/public/paths/infrastructure/autoscale/groups/groups.yml b/public/paths/infrastructure/autoscale/groups/groups.yml new file mode 100644 index 00000000..e69de29b From 1c8d6b0d28f96a8f2cba896e464ad2794eebabb2 Mon Sep 17 00:00:00 2001 From: blewis Date: Wed, 27 Sep 2023 10:01:51 -0700 Subject: [PATCH 2/5] autoscaling --- .../autoscale/groups/AutoscaleGroup.yml | 21 +++- .../groups/AutoscaleGroupInfrastructure.yml | 2 +- .../autoscale/groups/AutoscaleGroupScale.yml | 4 +- public/api.yml | 4 + .../infrastructure/autoscale/groups/group.yml | 100 ++++++++++++++++++ .../autoscale/groups/groups.yml | 66 ++++++++++++ 6 files changed, 192 insertions(+), 5 deletions(-) diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml index 5c3b1a1f..bd0f0c6e 100644 --- a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml +++ b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml @@ -1,4 +1,4 @@ -title: Group +title: AutoscaleGroup type: object required: - id @@ -19,15 +19,30 @@ properties: identifier: type: string creator: + $ref: ../../../creators/CreatorScope.yml hub_id: type: string cluster: type: string scale: - $ref: "./Scale.yml" + $ref: "./AutoscaleGroupScale.yml" infrastructure: + $ref: "./AutoscaleGroupInfrastructure.yml" state: - $ref: ../../../State.yml + title: AutoscaleGroupState + allOf: + - required: + - current + properties: + current: + description: The current state of the server. + type: string + enum: + - new + - live + - deleting + - deleted + - $ref: ../../../State.yml events: title: AutoscaleGroupEvents type: object diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml index bc375e59..57da3fbb 100644 --- a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml +++ b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml @@ -19,7 +19,7 @@ properties: type: string priority: type: integer - location: + locations: type: array items: type: object diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml index 9a507884..ba432ada 100644 --- a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml +++ b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml @@ -1,4 +1,4 @@ -title: Scale +title: AutoscaleGroupScale type: object required: - enable @@ -6,6 +6,7 @@ properties: enable: type: boolean down: + title: AutoscaleGroupScaleDown type: object properties: minimum: @@ -16,6 +17,7 @@ properties: - fifo - lifo up: + title: AutoscaleGroupScaleUp type: object properties: maximum: diff --git a/public/api.yml b/public/api.yml index 353849e3..22ce5d3b 100644 --- a/public/api.yml +++ b/public/api.yml @@ -321,6 +321,10 @@ paths: "$ref": "./paths/infrastructure/providers/provider.yml" "/v1/infrastructure/providers/{providerId}/tasks": "$ref": "./paths/infrastructure/providers/tasks.yml" + "/v1/infrastructure/auto-scale/groups": + "$ref": "./paths/infrastructure/autoscale/groups/groups.yml" + "/v1/infrastructure/auto-scale/groups/{groupId}": + "$ref": "./paths/infrastructure/autoscale/groups/group.yml" # Servers "/v1/infrastructure/servers": "$ref": "./paths/infrastructure/servers/servers.yml" diff --git a/public/paths/infrastructure/autoscale/groups/group.yml b/public/paths/infrastructure/autoscale/groups/group.yml index e69de29b..3fda078b 100644 --- a/public/paths/infrastructure/autoscale/groups/group.yml +++ b/public/paths/infrastructure/autoscale/groups/group.yml @@ -0,0 +1,100 @@ +get: + operationId: "getAutoscaleGroup" + tags: + - InfrastructureAutoscaleGroup + parameters: + - name: groupId + description: The ID for the given autoscale group. + in: path + required: true + schema: + type: string + summary: Fetch Autoscale + description: Requires the `autoscale-groups-view` capability. + responses: + 200: + description: A single autoscale group resource. + content: + application/json: + schema: + title: "FetchProviderReturn" + type: object + properties: + data: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + default: + $ref: ../../../../../components/responses/errors/DefaultError.yml +patch: + operationId: "updateAutoscaleGroup" + tags: + - InfrastructureAutoscaleGroup + parameters: + - name: groupId + description: The ID for the given autoscale group. + in: path + required: true + schema: + type: string + summary: Update Autoscale Group + description: Requires the `autoscale-groups-manage` capability. + requestBody: + description: Parameters for creating an autoscale group + content: + application/json: + schema: + type: object + required: + - name + - identifier + - cluster + - scale + - infrastructure + properties: + name: + type: string + identifier: + type: string + cluster: + type: string + scale: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml + infrastructure: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml + responses: + 200: + description: Returns a autoscale group resource. + content: + application/json: + schema: + title: "ProviderUpdateReturn" + type: object + properties: + data: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + default: + $ref: ../../../../../components/responses/errors/DefaultError.yml +delete: + operationId: "removeAutoscaleGroup" + tags: + - InfrastructureAutoscaleGroup + parameters: + - name: groupId + description: The ID for the given autoscale group. + in: path + required: true + schema: + type: string + summary: Remove Autoscale Group + description: Requires the `autoscale-group-manage` capability. + responses: + 202: + description: Returns a task descriptor. + content: + application/json: + schema: + type: object + properties: + data: + $ref: ../../../../../components/schemas/jobs/TaskDescriptor.yml + default: + $ref: ../../../../../components/responses/errors/DefaultError.yml diff --git a/public/paths/infrastructure/autoscale/groups/groups.yml b/public/paths/infrastructure/autoscale/groups/groups.yml index e69de29b..f5393e4c 100644 --- a/public/paths/infrastructure/autoscale/groups/groups.yml +++ b/public/paths/infrastructure/autoscale/groups/groups.yml @@ -0,0 +1,66 @@ +get: + operationId: "getAutoscaleGroups" + tags: + - InfrastructureAutoscaleGroup + parameters: + - $ref: ../../../../../components/parameters/PageParam.yml + summary: Get Autoscale Groups list + description: Requires the `autoscale-groups-manage` capability. + responses: + 200: + description: A collection of pool resources. + content: + application/json: + schema: + title: "IPPoolsReturn" + type: object + properties: + data: + type: array + items: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + default: + $ref: ../../../../../components/responses/errors/DefaultError.yml +post: + operationId: createAutoscaleGroup + tags: + - InfrastructureAutoscaleGroup + parameters: [] + summary: Create Autoscale Group + description: Requires the 'autoscale-groups-manage' + requestBody: + description: Parameters for creating an autoscale group + content: + application/json: + schema: + type: object + required: + - name + - identifier + - cluster + - scale + - infrastructure + properties: + name: + type: string + identifier: + type: string + cluster: + type: string + scale: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml + infrastructure: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml + responses: + 201: + description: Returns a autoscale group resource. + content: + application/json: + schema: + title: "ProviderCreateResponse" + type: object + properties: + data: + $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + default: + $ref: ../../../../../components/responses/errors/DefaultError.yml From bb72065e9571cdcbe0aa50578aeb786edfe7c4ab Mon Sep 17 00:00:00 2001 From: blewis Date: Wed, 27 Sep 2023 14:30:08 -0700 Subject: [PATCH 3/5] small change --- .../infrastructure/autoscale/groups/AutoscaleGroupScale.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml index ba432ada..ef9bb7cc 100644 --- a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml +++ b/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml @@ -1,10 +1,6 @@ title: AutoscaleGroupScale type: object -required: - - enable properties: - enable: - type: boolean down: title: AutoscaleGroupScaleDown type: object From b4e59debb1e322a59706d72b2df8da5918c8eaaa Mon Sep 17 00:00:00 2001 From: blewis Date: Thu, 28 Sep 2023 08:05:19 -0700 Subject: [PATCH 4/5] update auto-scale --- .../containers/config/ContainerScale.yml | 8 ++-- .../groups/AutoScaleGroup.yml} | 22 +++++----- .../groups/AutoScaleGroupInfrastructure.yml} | 2 +- .../groups/AutoScaleGroupScale.yml} | 6 +-- .../spec/StackContainerConfigScaling.yml | 8 ++-- public/api.yml | 4 +- .../groups/group.yml | 40 +++++++++---------- .../groups/groups.yml | 30 +++++++------- 8 files changed, 60 insertions(+), 60 deletions(-) rename components/schemas/infrastructure/{autoscale/groups/AutoscaleGroup.yml => auto-scale/groups/AutoScaleGroup.yml} (63%) rename components/schemas/infrastructure/{autoscale/groups/AutoscaleGroupInfrastructure.yml => auto-scale/groups/AutoScaleGroupInfrastructure.yml} (94%) rename components/schemas/infrastructure/{autoscale/groups/AutoscaleGroupScale.yml => auto-scale/groups/AutoScaleGroupScale.yml} (73%) rename public/paths/infrastructure/{autoscale => auto-scale}/groups/group.yml (70%) rename public/paths/infrastructure/{autoscale => auto-scale}/groups/groups.yml (68%) diff --git a/components/schemas/containers/config/ContainerScale.yml b/components/schemas/containers/config/ContainerScale.yml index 28696d54..adb64093 100644 --- a/components/schemas/containers/config/ContainerScale.yml +++ b/components/schemas/containers/config/ContainerScale.yml @@ -22,13 +22,13 @@ properties: properties: min: type: integer - description: Minimum additional instances the autoscaler will run at any time + description: Minimum additional instances the auto-scaler will run at any time delta: type: integer - description: Number of additional instances the autoscaler will add/subtract per scaling event + description: Number of additional instances the auto-scaler will add/subtract per scaling event max: type: integer - description: Maximum additional instances the autoscaler will run at any time + description: Maximum additional instances the auto-scaler will run at any time max_server: type: integer description: Minimum number of instances per server @@ -36,7 +36,7 @@ properties: $ref: ../../Duration.yml description: Minimum amount of time an instance will live window: - description: Duration in which the autoscaler will watch for changes + description: Duration in which the auto-scaler will watch for changes $ref: ../../Duration.yml thresholds: description: An array of rules that dictate when a scaling event will be triggered diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml similarity index 63% rename from components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml rename to components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml index bd0f0c6e..14ecdf04 100644 --- a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml +++ b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml @@ -1,4 +1,4 @@ -title: AutoscaleGroup +title: AutoScaleGroup type: object required: - id @@ -25,17 +25,17 @@ properties: cluster: type: string scale: - $ref: "./AutoscaleGroupScale.yml" + $ref: "./AutoScaleGroupScale.yml" infrastructure: - $ref: "./AutoscaleGroupInfrastructure.yml" + $ref: "./AutoScaleGroupInfrastructure.yml" state: - title: AutoscaleGroupState + title: AutoScaleGroupState allOf: - required: - current properties: current: - description: The current state of the server. + description: The current state of the auto-scale group. type: string enum: - new @@ -44,9 +44,9 @@ properties: - deleted - $ref: ../../../State.yml events: - title: AutoscaleGroupEvents + title: AutoScaleGroupEvents type: object - description: A collection of timestamps for each event in the network's lifetime. + description: A collection of timestamps for each event in the auto-scale group's lifetime. required: - created - updated @@ -54,14 +54,14 @@ properties: - last_sync properties: created: - description: The timestamp of when the autoscale group was created. + description: The timestamp of when the auto-scale group was created. $ref: ../../../DateTime.yml updated: - description: The timestamp of when the autoscale group was updated. + description: The timestamp of when the auto-scale group was updated. $ref: ../../../DateTime.yml deleted: - description: The timestamp of when the autoscale group was deleted. + description: The timestamp of when the auto-scale group was deleted. $ref: ../../../DateTime.yml last_sync: - description: The timestamp of when the autoscale group was last synced. + description: The timestamp of when the auto-scale group was last synced. $ref: ../../../DateTime.yml diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupInfrastructure.yml similarity index 94% rename from components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml rename to components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupInfrastructure.yml index 57da3fbb..df20b923 100644 --- a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml +++ b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupInfrastructure.yml @@ -1,4 +1,4 @@ -title: AutoscaleGroupInfrastructure +title: AutoScaleGroupInfrastructure type: object required: - models diff --git a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupScale.yml similarity index 73% rename from components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml rename to components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupScale.yml index ef9bb7cc..14415f62 100644 --- a/components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml +++ b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupScale.yml @@ -1,8 +1,8 @@ -title: AutoscaleGroupScale +title: AutoScaleGroupScale type: object properties: down: - title: AutoscaleGroupScaleDown + title: AutoScaleGroupScaleDown type: object properties: minimum: @@ -13,7 +13,7 @@ properties: - fifo - lifo up: - title: AutoscaleGroupScaleUp + title: AutoScaleGroupScaleUp type: object properties: maximum: diff --git a/components/schemas/stacks/spec/StackContainerConfigScaling.yml b/components/schemas/stacks/spec/StackContainerConfigScaling.yml index bdce7eb2..b21186a3 100644 --- a/components/schemas/stacks/spec/StackContainerConfigScaling.yml +++ b/components/schemas/stacks/spec/StackContainerConfigScaling.yml @@ -22,13 +22,13 @@ properties: properties: min: type: integer - description: Minimum additional instances the autoscaler will run at any time + description: Minimum additional instances the auto-scaler will run at any time delta: type: integer - description: Number of additional instances the autoscaler will add/subtract per scaling event + description: Number of additional instances the auto-scaler will add/subtract per scaling event max: type: integer - description: Maximum additional instances the autoscaler will run at any time + description: Maximum additional instances the auto-scaler will run at any time max_server: type: integer description: Minimum number of instances per server @@ -36,7 +36,7 @@ properties: $ref: ../../Duration.yml description: Minimum amount of time an instance will live window: - description: Duration in which the autoscaler will watch for changes + description: Duration in which the auto-scaler will watch for changes $ref: ../../Duration.yml thresholds: description: An array of rules that dictate when a scaling event will be triggered diff --git a/public/api.yml b/public/api.yml index 22ce5d3b..7c56017d 100644 --- a/public/api.yml +++ b/public/api.yml @@ -322,9 +322,9 @@ paths: "/v1/infrastructure/providers/{providerId}/tasks": "$ref": "./paths/infrastructure/providers/tasks.yml" "/v1/infrastructure/auto-scale/groups": - "$ref": "./paths/infrastructure/autoscale/groups/groups.yml" + "$ref": "./paths/infrastructure/auto-scale/groups/groups.yml" "/v1/infrastructure/auto-scale/groups/{groupId}": - "$ref": "./paths/infrastructure/autoscale/groups/group.yml" + "$ref": "./paths/infrastructure/auto-scale/groups/group.yml" # Servers "/v1/infrastructure/servers": "$ref": "./paths/infrastructure/servers/servers.yml" diff --git a/public/paths/infrastructure/autoscale/groups/group.yml b/public/paths/infrastructure/auto-scale/groups/group.yml similarity index 70% rename from public/paths/infrastructure/autoscale/groups/group.yml rename to public/paths/infrastructure/auto-scale/groups/group.yml index 3fda078b..45d27840 100644 --- a/public/paths/infrastructure/autoscale/groups/group.yml +++ b/public/paths/infrastructure/auto-scale/groups/group.yml @@ -1,44 +1,44 @@ get: - operationId: "getAutoscaleGroup" + operationId: "getAutoScaleGroup" tags: - - InfrastructureAutoscaleGroup + - InfrastructureAutoScaleGroup parameters: - name: groupId - description: The ID for the given autoscale group. + description: The ID for the given auto-scale group. in: path required: true schema: type: string - summary: Fetch Autoscale + summary: Fetch Auto-Scale Group description: Requires the `autoscale-groups-view` capability. responses: 200: - description: A single autoscale group resource. + description: A single auto-scale group resource. content: application/json: schema: - title: "FetchProviderReturn" + title: "GetAutoScaleGroupReturn" type: object properties: data: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml default: $ref: ../../../../../components/responses/errors/DefaultError.yml patch: - operationId: "updateAutoscaleGroup" + operationId: "updateAutoScaleGroup" tags: - - InfrastructureAutoscaleGroup + - InfrastructureAutoScaleGroup parameters: - name: groupId - description: The ID for the given autoscale group. + description: The ID for the given auto-scale group. in: path required: true schema: type: string - summary: Update Autoscale Group + summary: Update Auto-Scale Group description: Requires the `autoscale-groups-manage` capability. requestBody: - description: Parameters for creating an autoscale group + description: Parameters for creating an auto-scale group content: application/json: schema: @@ -57,26 +57,26 @@ patch: cluster: type: string scale: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupScale.yml infrastructure: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupInfrastructure.yml responses: 200: - description: Returns a autoscale group resource. + description: Returns an autoscale group resource. content: application/json: schema: - title: "ProviderUpdateReturn" + title: "UpdateAutoScaleGroupReturn" type: object properties: data: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml default: $ref: ../../../../../components/responses/errors/DefaultError.yml delete: - operationId: "removeAutoscaleGroup" + operationId: "removeAutoScaleGroup" tags: - - InfrastructureAutoscaleGroup + - InfrastructureAutoScaleGroup parameters: - name: groupId description: The ID for the given autoscale group. @@ -84,7 +84,7 @@ delete: required: true schema: type: string - summary: Remove Autoscale Group + summary: Remove Auto-Scale Group description: Requires the `autoscale-group-manage` capability. responses: 202: diff --git a/public/paths/infrastructure/autoscale/groups/groups.yml b/public/paths/infrastructure/auto-scale/groups/groups.yml similarity index 68% rename from public/paths/infrastructure/autoscale/groups/groups.yml rename to public/paths/infrastructure/auto-scale/groups/groups.yml index f5393e4c..19bbf991 100644 --- a/public/paths/infrastructure/autoscale/groups/groups.yml +++ b/public/paths/infrastructure/auto-scale/groups/groups.yml @@ -1,35 +1,35 @@ get: - operationId: "getAutoscaleGroups" + operationId: "getAutoScaleGroups" tags: - - InfrastructureAutoscaleGroup + - InfrastructureAutoScaleGroup parameters: - $ref: ../../../../../components/parameters/PageParam.yml - summary: Get Autoscale Groups list + summary: Get Auto-Scale Groups list description: Requires the `autoscale-groups-manage` capability. responses: 200: - description: A collection of pool resources. + description: A collection of autoscale group resources. content: application/json: schema: - title: "IPPoolsReturn" + title: "GetAutoScaleGroupResponse" type: object properties: data: type: array items: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml default: $ref: ../../../../../components/responses/errors/DefaultError.yml post: - operationId: createAutoscaleGroup + operationId: createAutoScaleGroup tags: - - InfrastructureAutoscaleGroup + - InfrastructureAutoScaleGroup parameters: [] - summary: Create Autoscale Group + summary: Create Auto-Scale Group description: Requires the 'autoscale-groups-manage' requestBody: - description: Parameters for creating an autoscale group + description: Parameters for creating an auto-scale group content: application/json: schema: @@ -48,19 +48,19 @@ post: cluster: type: string scale: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupScale.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupScale.yml infrastructure: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroupInfrastructure.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupInfrastructure.yml responses: 201: - description: Returns a autoscale group resource. + description: Returns an auto-scale group resource. content: application/json: schema: - title: "ProviderCreateResponse" + title: "CreateAutoScaleGroupResponse" type: object properties: data: - $ref: ../../../../../components/schemas/infrastructure/autoscale/groups/AutoscaleGroup.yml + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml default: $ref: ../../../../../components/responses/errors/DefaultError.yml From 41ab168d5c3ee28a8de523f7fde3a5c8dd862283 Mon Sep 17 00:00:00 2001 From: blewis Date: Thu, 28 Sep 2023 15:17:45 -0700 Subject: [PATCH 5/5] add autoscaleGroupINcludes --- .../schemas/includes/ServerModelsIncludes.yml | 5 +++++ .../groups/AutoScaleGroupIncludes.yml | 10 ++++++++++ .../providers/LocationProvider.yml | 4 ++++ .../infrastructure/auto-scale/groups/group.yml | 18 ++++++++++++++++++ .../auto-scale/groups/groups.yml | 18 ++++++++++++++++++ public/paths/sdn/networks.yml | 1 - 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 components/schemas/includes/ServerModelsIncludes.yml create mode 100644 components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupIncludes.yml diff --git a/components/schemas/includes/ServerModelsIncludes.yml b/components/schemas/includes/ServerModelsIncludes.yml new file mode 100644 index 00000000..cb4ae9c7 --- /dev/null +++ b/components/schemas/includes/ServerModelsIncludes.yml @@ -0,0 +1,5 @@ +title: ServerModelsIncludes +description: A resource associated with a server models. +type: object +additionalProperties: + $ref: ../infrastructure/providers/ProviderServer.yml diff --git a/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupIncludes.yml b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupIncludes.yml new file mode 100644 index 00000000..cb27857f --- /dev/null +++ b/components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupIncludes.yml @@ -0,0 +1,10 @@ +title: AutoScaleGroupIncludes +description: All includable resource linkable to the given auto-scale group. +type: object +properties: + providers: + "$ref": "../../../includes/ProvidersIncludes.yml" + models: + "$ref": "../../../includes/ServerModelsIncludes.yml" + locations: + "$ref": "../../../includes/LocationsIncludes.yml" diff --git a/components/schemas/infrastructure/providers/LocationProvider.yml b/components/schemas/infrastructure/providers/LocationProvider.yml index 973bfe70..8ab7de41 100644 --- a/components/schemas/infrastructure/providers/LocationProvider.yml +++ b/components/schemas/infrastructure/providers/LocationProvider.yml @@ -16,3 +16,7 @@ properties: code: type: string description: A location code returned from the provider. + availability_zones: + type: array + items: + type: string diff --git a/public/paths/infrastructure/auto-scale/groups/group.yml b/public/paths/infrastructure/auto-scale/groups/group.yml index 45d27840..67dc9aa4 100644 --- a/public/paths/infrastructure/auto-scale/groups/group.yml +++ b/public/paths/infrastructure/auto-scale/groups/group.yml @@ -9,6 +9,22 @@ get: required: true schema: type: string + - name: include + in: query + required: false + description: + A comma separated list of include values. Included resources will show + up under the root document's `include` field, with the key being the id of the included + resource. In the case of applying an include to a collection of resources, if two + resources share the same include, it will only appear once in the return. + schema: + type: array + items: + type: string + enum: + - providers + - models + - locations summary: Fetch Auto-Scale Group description: Requires the `autoscale-groups-view` capability. responses: @@ -22,6 +38,8 @@ get: properties: data: $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml + includes: + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupIncludes.yml default: $ref: ../../../../../components/responses/errors/DefaultError.yml patch: diff --git a/public/paths/infrastructure/auto-scale/groups/groups.yml b/public/paths/infrastructure/auto-scale/groups/groups.yml index 19bbf991..d957aaff 100644 --- a/public/paths/infrastructure/auto-scale/groups/groups.yml +++ b/public/paths/infrastructure/auto-scale/groups/groups.yml @@ -4,6 +4,22 @@ get: - InfrastructureAutoScaleGroup parameters: - $ref: ../../../../../components/parameters/PageParam.yml + - name: include + in: query + required: false + description: + A comma separated list of include values. Included resources will show + up under the root document's `include` field, with the key being the id of the included + resource. In the case of applying an include to a collection of resources, if two + resources share the same include, it will only appear once in the return. + schema: + type: array + items: + type: string + enum: + - providers + - models + - locations summary: Get Auto-Scale Groups list description: Requires the `autoscale-groups-manage` capability. responses: @@ -19,6 +35,8 @@ get: type: array items: $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroup.yml + includes: + $ref: ../../../../../components/schemas/infrastructure/auto-scale/groups/AutoScaleGroupIncludes.yml default: $ref: ../../../../../components/responses/errors/DefaultError.yml post: diff --git a/public/paths/sdn/networks.yml b/public/paths/sdn/networks.yml index 758b99da..087f5434 100644 --- a/public/paths/sdn/networks.yml +++ b/public/paths/sdn/networks.yml @@ -18,7 +18,6 @@ get: enum: - creators - environments - - name: filter in: query # Deep nested arrays are undefined https://github.com/OAI/OpenAPI-Specification/issues/1706