Skip to content

Commit

Permalink
ami auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
shaulib committed Jan 7, 2024
1 parent 6874715 commit c5968db
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 28 deletions.
15 changes: 14 additions & 1 deletion api/services/ocean/aws/paths/amiAutoUpdate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,17 @@ post:
operationId: "oceanAwsAmiAutoUpdate"
tags:
- "Ocean AWS"

parameters:
- $ref: "../../../../commons/parameters/accountId.yaml"
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: "../schemas/amiAutoUpdate.yaml"
responses:
200:
$ref: "../responses/amiAutoUpdate.yaml"
400:
description: "Bad Request"
24 changes: 24 additions & 0 deletions api/services/ocean/aws/responses/amiAutoUpdate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
description: Ocean Cluster Aggregated Summary Costs Response
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/aws/k8s/cluster/o-abcd1234/aggregatedCosts/summary"
method:
example: "POST"
response:
type: object
properties:
items:
type: array
items:
$ref: "../schemas/amiAutoUpdateSummery.yaml"
kind:
example: "ocean:k8s:cluster:amiAutoUpdate:summary"
27 changes: 0 additions & 27 deletions api/services/ocean/aws/schemas/AmiAutoUpdate.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions api/services/ocean/aws/schemas/amiAutoUpdate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
type: object
description: >
The object specifying the request to trigger an AMI auto update operation
title: AMI Auto Update
required:
- patch / minorVersion
properties:
patch:
type: boolean
description: >
Update AMI if a newer patch version is available.
example: "true"
minorVersion:
type: boolean
example: "true"
description: >
Update AMI if a newer AMI minor version is available.
applyRoll:
type: boolean
example: "true"
description: >
Apply a cluster roll after an AMI was updated.
clusterRoll:
type: object
description: cluster roll parameters.
properties:
batchSizePercentage:
type: integer
description: Value as a percent to set the size of a batch in a roll. Valid values are 0-100..
example: 20
batchMinHealthyPercentage:
type: integer
description: Indicates the threshold of minimum healthy instances in single batch. If the amount of healthy instances in single batch is under the threshold, the cluster roll will fail. If exists, the parameter value will be in range of 1-100. In case of null as value, the default value in the backend will be 50%. Value of param should represent the number in percentage (%) of the batch..
example: 100
comment:
type: string
description: >
Add a brief description for the roll. The comment is limited to 256 chars.
example: "This is why I rolled my cluster."


42 changes: 42 additions & 0 deletions api/services/ocean/aws/schemas/amiAutoUpdateData.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
type: object
description: >
Launch spec AMI auto update details
properties:
vngId:
type: string
readOnly: true
example: default
description: |
vng's id.
vngName:
type: string
readOnly: true
example: default
description: |
vng's name.
status:
type: string
readOnly: true
example: UPDATE_SUCCEEDED
description: |
vng's AMI update result.
enum: [ NO_UPDATE_REQUIRED, UPDATE_SUCCEEDED, UPDATE_REQUIRED_BUT_FAILED, FAILED ]
updateType:
type: string
readOnly: true
example: MINOR
description: |
vng's AMI update type.
enum: [ MINOR, PATCH ]
oldAmiId:
type: string
readOnly: true
example: ami-00cd348996bfd7ba8
description: |
id of the image which were replaced
newAmiId:
type: string
readOnly: true
example: ami-019e5b81636e5a350
description: |
id of the new image
42 changes: 42 additions & 0 deletions api/services/ocean/aws/schemas/amiAutoUpdateSummery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
type: object
description: >
Response indicating AMI updated for each cluster's VNGs
title: AMI Auto Update Response
properties:
oceanId:
type: string
readOnly: true
example: o-134abcd
description: |
Ocean cluster identifier.
status:
type: string
description: >
Ami update result.
enum: [ Success, Failed ]
data:
type: array
data:
$ref: "amiAutoUpdateData.yaml"
rollId:
type: string
readOnly: true
example: scr-752331b9
description: |
id of the cluster roll.
createdAt:
type: string
readOnly: true
example: 2024-01-02T09:57:09.211Z
description: |
indicates the date the AMI update method was executed.
updatedAt:
type: string
readOnly: true
example: 2024-01-02T09:57:09.211Z
description: |
indicates the date the AMI update method was executed.

0 comments on commit c5968db

Please sign in to comment.