diff --git a/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml b/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml index b2fe37d30..4d05cb61a 100644 --- a/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml +++ b/api/services/elastigroup/aws/schemas/elastigroupScaleDown.yaml @@ -6,6 +6,17 @@ properties: description: | The policy name. example: "my-down-policy" + namespace: + type: string + description: | + The namespace for the alarm's associated metric. + default: "AWS/EC2" + source: + type: string + description: | + The metric source. + enum: [ spectrum, cloudWatch ] + example: "spectrum" metricName: type: string description: | @@ -34,46 +45,10 @@ properties: description: | The value against which the specified statistic is compared. example: 90 - action: - type: object + adjustment: + type: integer description: | - The action to take when scale up is needed. - A mandatory field, that should be filled with one of the following: - "adjustment", "percentageAdjustment", "setMaxTarget", "setMinTarget", "updateCapacity". - properties: - type: - type: string - description: | - The type of the action to take when scale up is needed. - enum: [ adjustment , updateCapacity setMinTarget , percentageAdjustment ] - example: "updateCapacity" - adjustment: - type: integer - description: | - The number / percentage associated with the specified adjustment type. - Required if using `adjustment` or `percentageAdjustment` as action type. - example: 1 - minTargetCapacity: - type: integer - description: | - The minimum target capacity. - Required if using `setMinTarget` as action type. - example: 1 - target: - type: integer - description: | - The desired number of instances. Required if using `updateCapacity` as action type and neither `minimum` nor `maximum` are defined. - example: 1 - minimum: - type: integer - description: | - The lower limit number of instances that you can scale down to. Optional, required if using `updateCapacity` as action type and neither minimum nor maximum are defined. - example: 0 - maximum: - type: integer - description: | - The upper limit number of instances that you can scale up to. Optional, required if using `updateCapacity` as action type and neither minimum nor maximum are defined. - example: 5 + The number associated with the specified adjustment type. stepAdjustments: type: array description: | @@ -82,9 +57,13 @@ properties: If specified, at least one step should be defined. items: type: object + required: + - threshold properties: action: type: object + required: + - type description: | The action to take when scale down according to step's threshold is needed. A mandatory field, that should be filled with one of the following: @@ -129,11 +108,52 @@ properties: The value against which the specified statistic is compared in order to determine if a step should be applied. example: 10 - namespace: - type: string + action: + type: object + required: + - type description: | - The namespace for the alarm's associated metric. - default: "AWS/EC2" + The action to take when scale up is needed. + A mandatory field, that should be filled with one of the following: + "adjustment", "percentageAdjustment", "setMaxTarget", "setMinTarget", "updateCapacity". + properties: + type: + type: string + description: | + The type of the action to take when scale up is needed. + enum: [ adjustment, updateCapacity, setMinTarget, percentageAdjustment ] + example: "updateCapacity" + adjustment: + type: integer + description: | + The number / percentage associated with the specified adjustment type. + Required if using `adjustment` or `percentageAdjustment` as action type. + example: 1 + maxTargetCapacity: + type: integer + description: | + The maximum target capacity. + Required if using `setMaxTarget` as action type. + example: 1 + target: + type: integer + description: | + The desired number of instances. Required if using `updateCapacity` as action type and neither `minimum` nor `maximum` are defined. + example: 1 + minimum: + type: integer + description: | + The lower limit number of instances that you can scale down to. Optional, required if using `updateCapacity` as action type and neither minimum nor maximum are defined. + example: 0 + maximum: + type: integer + description: | + The upper limit number of instances that you can scale up to. Optional, required if using `updateCapacity` as action type and neither minimum nor maximum are defined. + example: 5 + maxTargetCapacity: + type: integer + description: | + The maximum target capacity. dimensions: type: array description: | @@ -141,6 +161,8 @@ properties: When name is "instanceId", no value is needed. items: type: object + required: + - name properties: name: type: string diff --git a/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml b/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml index 37760bc24..5087cebab 100644 --- a/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml +++ b/api/services/elastigroup/aws/schemas/elastigroupScaleUp.yaml @@ -9,6 +9,17 @@ properties: description: | The policy name. example: "my-up-policy" + namespace: + type: string + description: | + The namespace for the alarm's associated metric. + default: "AWS/EC2" + source: + type: string + description: | + The metric source. + enum: [ spectrum, cloudWatch ] + example: "spectrum" metricName: type: string description: | @@ -37,46 +48,10 @@ properties: description: | The value against which the specified statistic is compared. example: 90 - action: - type: object + adjustment: + type: integer description: | - The action to take when scale up is needed. - A mandatory field, that should be filled with one of the following: - "adjustment", "percentageAdjustment", "setMaxTarget", "setMinTarget", "updateCapacity". - properties: - type: - type: string - description: | - The type of the action to take when scale up is needed. - enum: [ adjustment , updateCapacity setMinTarget , percentageAdjustment ] - example: "updateCapacity" - adjustment: - type: integer - description: | - The number / percentage associated with the specified adjustment type. - Required if using `adjustment` or `percentageAdjustment` as action type - example: 1 - minTargetCapacity: - type: integer - description: | - The minimum target capacity. - Required if using `setMinTarget` as action type. - example: 1 - target: - type: integer - description: | - The desired number of instances. Required if using `updateCapacity` as action type and neither `minimum` nor `maximum` are defined. - example: 1 - minimum: - type: integer - description: | - The lower limit number of instances that you can scale down to. Optional, required if using `updateCapacity` as action type and neither `target` nor `maximum` are defined - example: 0 - maximum: - type: integer - description: | - The upper limit number of instances that you can scale up to. Optional, required if using `updateCapacity` as action type and neither `target` nor `minimum` are defined - example: 5 + The number associated with the specified adjustment type. stepAdjustments: type: array description: | @@ -85,9 +60,13 @@ properties: If specified, at least one step should be defined. items: type: object + required: + - threshold properties: action: type: object + required: + - type description: | The action to take when scale up according to step's threshold is needed. A mandatory field, that should be filled with one of the following: @@ -97,7 +76,7 @@ properties: type: string description: | The type of the action to take when scale up is needed. - enum: [ adjustment , updateCapacity setMinTarget , percentageAdjustment ] + enum: [ adjustment, updateCapacity, setMinTarget, percentageAdjustment ] example: "setMinTarget" adjustment: type: integer @@ -132,11 +111,52 @@ properties: The value against which the specified statistic is compared in order to determine if a step should be applied. example: 50 - namespace: - type: string + action: + type: object + required: + - type description: | - The namespace for the alarm's associated metric. - default: "AWS/EC2" + The action to take when scale up is needed. + A mandatory field, that should be filled with one of the following: + "adjustment", "percentageAdjustment", "setMaxTarget", "setMinTarget", "updateCapacity". + properties: + type: + type: string + description: | + The type of the action to take when scale up is needed. + enum: [ adjustment, updateCapacity, setMinTarget, percentageAdjustment ] + example: "updateCapacity" + adjustment: + type: integer + description: | + The number / percentage associated with the specified adjustment type. + Required if using `adjustment` or `percentageAdjustment` as action type + example: 1 + minTargetCapacity: + type: integer + description: | + The minimum target capacity. + Required if using `setMinTarget` as action type. + example: 1 + target: + type: integer + description: | + The desired number of instances. Required if using `updateCapacity` as action type and neither `minimum` nor `maximum` are defined. + example: 1 + minimum: + type: integer + description: | + The lower limit number of instances that you can scale down to. Optional, required if using `updateCapacity` as action type and neither `target` nor `maximum` are defined + example: 0 + maximum: + type: integer + description: | + The upper limit number of instances that you can scale up to. Optional, required if using `updateCapacity` as action type and neither `target` nor `minimum` are defined + example: 5 + minTargetCapacity: + type: integer + description: | + The minimum target capacity. dimensions: type: array description: | @@ -144,6 +164,8 @@ properties: When name is "instanceId", no value is needed. items: type: object + required: + - name properties: name: type: string @@ -177,3 +199,4 @@ properties: Specifies whether the scaling policy described in this block is enabled. default: true example: true + diff --git a/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml b/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml index 715e328f8..38cb8c205 100644 --- a/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml +++ b/api/services/elastigroup/aws/schemas/elastigroupTargetScale.yaml @@ -1,18 +1,23 @@ type: object title: target scaling config +required: + - policyName + - namespace + - metricName + - target properties: source: title: Source description: | The source of the metric. - enum: [cloudWatch, spectrum] + enum: [ cloudWatch, spectrum ] type: string example: "spectrum" policyName: type: string description: | The policy name - example: "my-up-policy" + example: "my-target-scaling-policy" metricName: type: string description: | @@ -36,13 +41,51 @@ properties: description: | The namespace for the alarm's associated metric. default: "AWS/EC2" - target: + dimensions: + type: array + description: | + The dimensions for the alarm's associated metric. + When name is "instanceId", no value is needed. + items: + type: object + required: + - name + properties: + name: + type: string + example: "InstanceId" + value: + type: string + period: type: integer description: | - The target value for the group. + The period in seconds over which the statistic is applied. + example: 300 + evaluationPeriods: + type: integer + description: | + The number of periods over which data is compared to the specified threshold. example: 1 cooldown: type: integer description: | - The amount of time, in seconds, after a scaling activity completes and before any further trigger-related scaling activities can start. - example: 300 \ No newline at end of file + The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start. + example: 300 + target: + type: integer + description: | + The target value for the group. + example: 1 + predictive: + type: object + description: | + Enable predictive autoscaling. + required: + - mode + properties: + mode: + description: | + Predictive autoscaling mode. + enum: [ FORECAST_AND_SCALE, FORECAST_ONLY ] + type: string + example: "FORECAST_AND_SCALE" diff --git a/api/services/ocean/aksV2/paths/roll-get.yaml b/api/services/ocean/aksV2/paths/roll-get.yaml new file mode 100644 index 000000000..84d67b24b --- /dev/null +++ b/api/services/ocean/aksV2/paths/roll-get.yaml @@ -0,0 +1,17 @@ +summary: Ocean for AKS +get: + summary: "Get Roll" + description: > + Get status for a roll of an Ocean cluster. + operationId: "oceanAksGetSingleRoll" + tags: + - "Ocean AKS" + parameters: + - $ref: "../../../../commons/parameters/accountId.yaml" + - $ref: "../../commons/parameters/oceanId.yaml" + - $ref: "../../commons/parameters/azureRollId.yaml" + responses: + 200: + $ref: "../responses/rollGetResponse.yaml" + 400: + description: "Bad Request" \ No newline at end of file diff --git a/api/services/ocean/aksV2/paths/roll-stop.yaml b/api/services/ocean/aksV2/paths/roll-stop.yaml new file mode 100644 index 000000000..3da4ba4f7 --- /dev/null +++ b/api/services/ocean/aksV2/paths/roll-stop.yaml @@ -0,0 +1,20 @@ +summary: Ocean for AKS +put: + summary: "Stop Roll" + description: | + Stop a roll of an Ocean cluster. + + *Performing the request will stop the next batch in a roll.* + operationId: "oceanAksRollStop" + tags: + - "Ocean AKS" + parameters: + - $ref: "../../../../commons/parameters/accountId.yaml" + - $ref: "../../commons/parameters/oceanId.yaml" + - $ref: "../../commons/parameters/azureRollId.yaml" + + responses: + 200: + $ref: "../responses/rollStopResponse.yaml" + 400: + description: "Bad Request" \ No newline at end of file diff --git a/api/services/ocean/aksV2/paths/roll.yaml b/api/services/ocean/aksV2/paths/roll.yaml new file mode 100644 index 000000000..c0675437e --- /dev/null +++ b/api/services/ocean/aksV2/paths/roll.yaml @@ -0,0 +1,78 @@ +summary: Ocean for AKS +post: + summary: "Initiate Roll" + description: > + Roll an entire Ocean cluster or roll subsets of the cluster by specifying vngIds, nodePoolNames or nodeNames. + Performing this request will start the roll immediately and run it in defined batches. + Note that the first response for a successful request will indicate the start of a roll. In order to check the status of a roll, you can use the GET Roll API. + operationId: "oceanAksRollInit" + tags: + - "Ocean AKS" + parameters: + - $ref: "../../../../commons/parameters/accountId.yaml" + - $ref: "../../commons/parameters/oceanId.yaml" + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - type: object + title: 'Roll' + allOf: + - $ref: "../schemas/roll/roll-batchSizePercentage.yaml" + - $ref: "../schemas/roll/roll-comment.yaml" + - $ref: "../schemas/roll/roll-respectPdb.yaml" + - $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml" + - $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml" + - type: object + title: 'Roll with node names' + allOf: + - $ref: "../schemas/roll/roll-batchSizePercentage.yaml" + - $ref: "../schemas/roll/roll-comment.yaml" + - $ref: "../schemas/roll/roll-respectPdb.yaml" + - $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml" + - $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml" + - $ref: "../schemas/roll/roll-nodeNames.yaml" + - type: object + title: 'Roll with node pool names' + allOf: + - $ref: "../schemas/roll/roll-batchSizePercentage.yaml" + - $ref: "../schemas/roll/roll-comment.yaml" + - $ref: "../schemas/roll/roll-respectPdb.yaml" + - $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml" + - $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml" + - $ref: "../schemas/roll/roll-nodePoolNames.yaml" + - type: object + title: 'Roll with virtual node group ids' + allOf: + - $ref: "../schemas/roll/roll-batchSizePercentage.yaml" + - $ref: "../schemas/roll/roll-comment.yaml" + - $ref: "../schemas/roll/roll-respectPdb.yaml" + - $ref: "../schemas/roll/roll-respectRestrictScaleDown.yaml" + - $ref: "../schemas/roll/roll-batchMinHealthyPercentage.yaml" + - $ref: "../schemas/roll/roll-vngIds.yaml" + responses: + 200: + $ref: "../responses/rollCreateResponse.yaml" + 400: + description: "Bad Request" + +get: + summary: "List Rolls" + description: > + Get status for all rolls of an Ocean cluster. + operationId: "oceanAksRollList" + tags: + - "Ocean AKS" + parameters: + - $ref: "../../../../commons/parameters/accountId.yaml" + - $ref: "../../commons/parameters/oceanId.yaml" + responses: + 200: + $ref: "../responses/rollListResponse.yaml" + 400: + description: "Bad Request" + + + diff --git a/api/services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml b/api/services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml new file mode 100644 index 000000000..ff92504d7 --- /dev/null +++ b/api/services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml @@ -0,0 +1,22 @@ +get: + summary: "Get Migration Discovery" + description: | + Get information about nodes which can be migrated into Ocean. + operationId: "oceanAksV2GetMigrationDiscovery" + tags: + - "Ocean AKS" + parameters: + - $ref: "../../../../commons/parameters/accountId.yaml" + - $ref: "../../commons/parameters/oceanClusterId.yaml" + - in: "query" + name: "shouldFetchPods" + example: "true" + description: > + Should fetch data about running pods for each node. + schema: + type: "boolean" + responses: + 200: + $ref: "../responses/migrationDiscovery.yaml" + 400: + description: "Bad Request" \ No newline at end of file diff --git a/api/services/ocean/aksV2/responses/migrationDiscovery.yaml b/api/services/ocean/aksV2/responses/migrationDiscovery.yaml new file mode 100644 index 000000000..a2b3ee326 --- /dev/null +++ b/api/services/ocean/aksV2/responses/migrationDiscovery.yaml @@ -0,0 +1,23 @@ +description: Migration Discovery Response +content: + application/json: + schema: + allOf: + - $ref: "../../../../commons/schemas/responseItemWrapper.yaml" + - type: object + properties: + request: + type: object + properties: + url: + example: "ocean/azure/np/cluster/o-abcd1234/migration/discovery" + method: + example: "GET" + response: + properties: + items: + type: array + items: + $ref: "../schemas/oceanMigrationDiscovery.yaml" + kind: + example: "spotinst:ocean:azure:k8s:np:nodePoolUnmanaged" \ No newline at end of file diff --git a/api/services/ocean/aksV2/responses/rollCreateResponse.yaml b/api/services/ocean/aksV2/responses/rollCreateResponse.yaml new file mode 100644 index 000000000..b41889a1d --- /dev/null +++ b/api/services/ocean/aksV2/responses/rollCreateResponse.yaml @@ -0,0 +1,47 @@ +description: Ocean AKS Create Cluster Roll Response +content: + application/json: + schema: + allOf: + - $ref: "../../../../commons/schemas/responseItemWrapper.yaml" + - type: object + properties: + request: + type: object + properties: + url: + example: "/ocean/azure/np/cluster/o-12345abc/roll" + method: + example: "POST" + response: + type: object + properties: + items: + type: array + items: + allOf: + - $ref: "../schemas/roll/roll-status.yaml" + - type: object + properties: + status: + example: IN_PROGRESS + - type: object + properties: + progress: + example: + detailedStatus: + rollNodes: + - nodeName: aks-omnpbc2ebdb1-15563275-vmss00000q + status: IN_PROGRESS + - nodeName: aks-omnpbc2ebdb1-15563275-vmss000008 + status: TO_BE_REPLACED + - nodeName: aks-omnpbc2ebdb1-15563275-vmss00000r + status: TO_BE_REPLACED + - nodeName: aks-omnpe9429a2f-26725402-vmss00000z + status: IN_PROGRESS + - nodeName: aks-omnp0c85c2c2-26833420-vmss000001 + status: IN_PROGRESS + - nodeName: aks-omnp0c85c2c2-26833420-vmss000003 + status: TO_BE_REPLACED + kind: + example: "spotinst:ocean:azure:np:roll" \ No newline at end of file diff --git a/api/services/ocean/aksV2/responses/rollGetResponse.yaml b/api/services/ocean/aksV2/responses/rollGetResponse.yaml new file mode 100644 index 000000000..d33f4edde --- /dev/null +++ b/api/services/ocean/aksV2/responses/rollGetResponse.yaml @@ -0,0 +1,24 @@ +description: Ocean AKS Get Roll Response +content: + application/json: + schema: + allOf: + - $ref: "../../../../commons/schemas/responseItemWrapper.yaml" + - type: object + properties: + request: + type: object + properties: + url: + example: "/ocean/azure/np/cluster/o-12345abc/roll/scr-12345abc" + method: + example: "GET" + response: + type: object + properties: + items: + type: array + items: + $ref: "../schemas/roll/roll-status.yaml" + kind: + example: "spotinst:ocean:azure:np:roll" diff --git a/api/services/ocean/aksV2/responses/rollListResponse.yaml b/api/services/ocean/aksV2/responses/rollListResponse.yaml new file mode 100644 index 000000000..facda0f75 --- /dev/null +++ b/api/services/ocean/aksV2/responses/rollListResponse.yaml @@ -0,0 +1,24 @@ +description: Ocean AKS Get Cluster Roll Response +content: + application/json: + schema: + allOf: + - $ref: "../../../../commons/schemas/responseItemWrapper.yaml" + - type: object + properties: + request: + type: object + properties: + url: + example: "/ocean/azure/np/cluster/o-12345abc/roll" + method: + example: "GET" + response: + type: object + properties: + items: + type: array + items: + $ref: "../schemas/roll/roll-status.yaml" + kind: + example: "spotinst:ocean:azure:np:roll" diff --git a/api/services/ocean/aksV2/responses/rollStopResponse.yaml b/api/services/ocean/aksV2/responses/rollStopResponse.yaml new file mode 100644 index 000000000..53aaeb7d6 --- /dev/null +++ b/api/services/ocean/aksV2/responses/rollStopResponse.yaml @@ -0,0 +1,46 @@ +description: Ocean AKS STOP Cluster Roll Response +content: + application/json: + schema: + allOf: + - $ref: "../../../../commons/schemas/responseItemWrapper.yaml" + - type: object + properties: + request: + type: object + properties: + url: + example: "/ocean/azure/np/cluster/o-12345abc/roll/scr-12345abc/stop" + method: + example: "PUT" + response: + type: object + properties: + items: + type: array + items: + allOf: + - $ref: "../schemas/roll/roll-status.yaml" + - type: object + properties: + status: + example: STOPPED + progress: + example: + detailedStatus: + progressPercentage: 50 + rollNodes: + - nodeName: aks-omnpbc2ebdb1-15563275-vmss00000q + status: REPLACED + - nodeName: aks-omnpbc2ebdb1-15563275-vmss000008 + status: DID_NOT_REPLACE + - nodeName: aks-omnpbc2ebdb1-15563275-vmss00000r + status: DID_NOT_REPLACE + - nodeName: aks-omnpe9429a2f-26725402-vmss00000z + status: REPLACED + - nodeName: aks-omnp0c85c2c2-26833420-vmss000001 + status: REPLACED + - nodeName: aks-omnp0c85c2c2-26833420-vmss000003 + status: DID_NOT_REPLACE + kind: + example: "spotinst:ocean:azure:np:roll" diff --git a/api/services/ocean/aksV2/schemas/oceanMigrationDiscovery.yaml b/api/services/ocean/aksV2/schemas/oceanMigrationDiscovery.yaml new file mode 100644 index 000000000..b6c6b8a65 --- /dev/null +++ b/api/services/ocean/aksV2/schemas/oceanMigrationDiscovery.yaml @@ -0,0 +1,16 @@ +title: Workload migration discovery details +description: "Information about available nodes which can be migrated to the Ocean cluster" +type: object +properties: + nodeName: + type: string + description: "The node name." + example: "aks-mynodepool-18735776-vmss000001" + nodePoolName: + type: string + description: "The NodePool Name." + example: "mynodepool" + runningPods: + type: integer + description: "The number of running pods on the node (appears if shouldFetchPods was true)." + example: "6" diff --git a/api/services/ocean/aksV2/schemas/roll/roll-batchMinHealthyPercentage.yaml b/api/services/ocean/aksV2/schemas/roll/roll-batchMinHealthyPercentage.yaml new file mode 100644 index 000000000..73b6d948a --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-batchMinHealthyPercentage.yaml @@ -0,0 +1,12 @@ +type: object +properties: + batchMinHealthyPercentage: + type: integer + description: > + Indicates the threshold of minimum healthy nodes in single batch. + If the amount of healthy nodes in single batch is under the threshold, the 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 + default: 50 diff --git a/api/services/ocean/aksV2/schemas/roll/roll-batchSizePercentage.yaml b/api/services/ocean/aksV2/schemas/roll/roll-batchSizePercentage.yaml new file mode 100644 index 000000000..67a49003a --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-batchSizePercentage.yaml @@ -0,0 +1,8 @@ +type: object +properties: + batchSizePercentage: + type: integer + description: > + Value as a percent to set the size of a batch in a roll. Valid values are 0-100. + In case of null as value, the default value in the backend will be 20%. + example: 25 diff --git a/api/services/ocean/aksV2/schemas/roll/roll-comment.yaml b/api/services/ocean/aksV2/schemas/roll/roll-comment.yaml new file mode 100644 index 000000000..47c7ca19e --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-comment.yaml @@ -0,0 +1,7 @@ +type: object +properties: + comment: + type: string + description: > + Add a comment description for the roll. The comment is limited to 256 chars and optional. + example: "This is why I deployed my cluster." diff --git a/api/services/ocean/aksV2/schemas/roll/roll-nodeNames.yaml b/api/services/ocean/aksV2/schemas/roll/roll-nodeNames.yaml new file mode 100644 index 000000000..64eca3244 --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-nodeNames.yaml @@ -0,0 +1,11 @@ +type: object +properties: + nodeNames: + type: array + description: > + List of node names to be rolled. Each identifier is a string. nodeNames can be null, and cannot be used together with nodePoolNames and vngIds. + items: + type: string + example: + - aks-omnpbc2ebdb1-15563275-vmss00000g + - aks-omnpe9429a2f-26725402-vmss000015 diff --git a/api/services/ocean/aksV2/schemas/roll/roll-nodePoolNames.yaml b/api/services/ocean/aksV2/schemas/roll/roll-nodePoolNames.yaml new file mode 100644 index 000000000..23ea8829e --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-nodePoolNames.yaml @@ -0,0 +1,12 @@ +type: object +properties: + nodePoolNames: + type: array + description: > + List of node pools to be rolled. + Each node pool name is a string. nodePoolNames can be null, and cannot be used together with nodeNames and vngIds. + items: + type: string + example: + - omnp35f6cccb + - omnp55bd559b diff --git a/api/services/ocean/aksV2/schemas/roll/roll-respectPdb.yaml b/api/services/ocean/aksV2/schemas/roll/roll-respectPdb.yaml new file mode 100644 index 000000000..673ea8c06 --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-respectPdb.yaml @@ -0,0 +1,8 @@ +type: object +properties: + respectPdb: + type: boolean + description: > + During the roll, if the parameter is set to true we honor PDB during the nodes replacement. + example: false + default: true diff --git a/api/services/ocean/aksV2/schemas/roll/roll-respectRestrictScaleDown.yaml b/api/services/ocean/aksV2/schemas/roll/roll-respectRestrictScaleDown.yaml new file mode 100644 index 000000000..e5b9c4af4 --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-respectRestrictScaleDown.yaml @@ -0,0 +1,8 @@ +type: object +properties: + respectRestrictScaleDown: + type: boolean + description: > + During the roll, if the parameter is set to true we honor Restrict Scale Down label during the nodes replacement. + example: true + default: false diff --git a/api/services/ocean/aksV2/schemas/roll/roll-status.yaml b/api/services/ocean/aksV2/schemas/roll/roll-status.yaml new file mode 100644 index 000000000..60ca39bec --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-status.yaml @@ -0,0 +1,92 @@ +type: object +properties: + id: + type: string + description: > + The identifier of the cluster roll. + example: scr-12345abc + oceanId: + type: string + description: > + The identifier of the ocean cluster being rolled. + example: o-12e31234 + scope: + type: string + enum: [Cluster, Vng, Node Pool, Node] + example: Cluster + status: + type: string + description: > + The status of the roll. + enum: [IN_PROGRESS, COMPLETED, PARTLY_COMPLETED, FAILED, STOPPED] + example: COMPLETED + currentBatch: + type: integer + description: > + The current batch being handled by the roll. + example: 1 + numOfBatches: + type: integer + description: > + The total number of batches in the roll. + example: 2 + comment: + type: string + example: "This is why I deployed my cluster." + progress: + type: object + properties: + progressPercentage: + type: integer + example: 0 + detailedStatus: + type: object + description: > + An object containing detailed information about the progress of the roll. + properties: + rollNodes: + type: array + description: > + An array of objects containing detailed information about each node handled by the roll. + items: + type: object + properties: + nodeName: + type: string + status: + description: > + The status of the node according to the roll. + type: string + enum: [REPLACED, TO_BE_REPLACED, COULD_NOT_BE_REPLACED, NOT_REPLACED_DUE_TO_PDB, DID_NOT_REPLACE, IN_PROGRESS] + example: + - nodeName: aks-omnpbc2ebdb1-15563275-vmss00000q + status: REPLACED + - nodeName: aks-omnpbc2ebdb1-15563275-vmss000008 + status: TO_BE_REPLACED + - nodeName: aks-omnpbc2ebdb1-15563275-vmss00000r + status: COULD_NOT_BE_REPLACED + - nodeName: aks-omnpe9429a2f-26725402-vmss00000z + status: NOT_REPLACED_DUE_TO_PDB + - nodeName: aks-omnp0c85c2c2-26833420-vmss000001 + status: IN_PROGRESS + - nodeName: aks-omnp0c85c2c2-26833420-vmss000003 + status: DID_NOT_REPLACE + respectPdb: + type: boolean + example: true + respectRestrictScaleDown: + type: boolean + example: false + batchMinHealthyPercentage: + type: integer + example: 70 + createdAt: + type: string + description: > + The creation timestamp of the roll. + example: 2019-03-24T15:46:09.000Z + updatedAt: + type: string + description: > + The latest update timestamp of the roll. + example: 2019-03-24T15:46:09.000Z \ No newline at end of file diff --git a/api/services/ocean/aksV2/schemas/roll/roll-vngIds.yaml b/api/services/ocean/aksV2/schemas/roll/roll-vngIds.yaml new file mode 100644 index 000000000..231823d31 --- /dev/null +++ b/api/services/ocean/aksV2/schemas/roll/roll-vngIds.yaml @@ -0,0 +1,12 @@ +type: object +properties: + vngIds: + type: array + description: > + List of virtual node group identifiers to be rolled. + Each identifier is a string. vngIds can be null, and cannot be used together with nodeNames and nodePoolNames. + items: + type: string + example: + - vng-69dc457b + - vng-175947a4 diff --git a/api/services/ocean/cd/schemas/oceanCDRolloutBaseline.yaml b/api/services/ocean/cd/schemas/oceanCDRolloutBaseline.yaml new file mode 100644 index 000000000..c952b5f2e --- /dev/null +++ b/api/services/ocean/cd/schemas/oceanCDRolloutBaseline.yaml @@ -0,0 +1,13 @@ +type: object +title: Ocean CD Verification Baseline +description: Represents object of Verification Baseline +properties: + baselineResult: + type: number + format: double + example: 2.453 + description: describe the baseline metric result + metric: + type: object + $ref: "./oceanCDRolloutBaselineMetric.yaml" + description: describe the baseline metric \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/oceanCDRolloutBaselineMetric.yaml b/api/services/ocean/cd/schemas/oceanCDRolloutBaselineMetric.yaml new file mode 100644 index 000000000..24207edf0 --- /dev/null +++ b/api/services/ocean/cd/schemas/oceanCDRolloutBaselineMetric.yaml @@ -0,0 +1,13 @@ +type: object +title: Ocean CD Verification Baseline Metric +description: Represents object of Verification Baseline Metric +properties: + threshold: + type: string + example: "<" + description: represent the baseline threshold + enum: [ "<", "<=", ">", ">=", "=", "range" ] + provider: + description: represent the baseline provider. + type: object + $ref: "./oceanCDRolloutBaselineMetricProvider.yaml" \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/oceanCDRolloutBaselineMetricProvider.yaml b/api/services/ocean/cd/schemas/oceanCDRolloutBaselineMetricProvider.yaml new file mode 100644 index 000000000..25b68329e --- /dev/null +++ b/api/services/ocean/cd/schemas/oceanCDRolloutBaselineMetricProvider.yaml @@ -0,0 +1,13 @@ +type: object +title: Ocean CD Verification Baseline Metric Provider +description: Represents object of Verification Baseline Metric Provider +properties: + prometheus: + type: object + $ref: "./verificationTemplate/oceanCDVerificationTemplateMetricPrometheus.yaml" + newRelic: + type: object + $ref: "./verificationTemplate/oceanCDVerificationTemplateMetricNewRelic.yaml" + datadog: + type: object + $ref: "./verificationTemplate/oceanCDVerificationTemplateMetricDatadog.yaml" \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/oceanCDRolloutVerificationResult.yaml b/api/services/ocean/cd/schemas/oceanCDRolloutVerificationResult.yaml index 740d8516e..fa3a90645 100644 --- a/api/services/ocean/cd/schemas/oceanCDRolloutVerificationResult.yaml +++ b/api/services/ocean/cd/schemas/oceanCDRolloutVerificationResult.yaml @@ -58,6 +58,10 @@ properties: type: string description: The step where the failure/success comes from example: "1" + baseline: + type: object + description: Describe baseline metric such as metric, threshold and result + $ref: "./oceanCDRolloutBaseline.yaml" providerDetails: type: object description: The chosen for the metric monitoring tool's details diff --git a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml index 70a7b9b30..dcab20c82 100644 --- a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml +++ b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetric.yaml @@ -43,3 +43,6 @@ properties: provider: type: object $ref: "oceanCDVerificationTemplateMetricProvider.yaml" + baseline: + type: objet + $ref: "oceanCDVerificationTemplateMetricBaseline.yaml" diff --git a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricBaseline.yaml b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricBaseline.yaml new file mode 100644 index 000000000..0f79a9a5b --- /dev/null +++ b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricBaseline.yaml @@ -0,0 +1,22 @@ +type: object +required: + - threshold + - provider +title: Ocean CD Verification Metric Baseline +properties: + threshold: + type: string + enum: ["<", ">", "<=", ">=", "=", "range"] + description: A mathematical expression needed for the comparison + example: ">" + minRange: + type: integer + example: 45 + description: Number in percent we allow the new version’s data result to be under baseline data result + maxRange: + type: integer + example: 55 + description: Number in percent we allow the new version’s data result to be under baseline data result + provider: + type: object + $ref: "oceanCDVerificationTemplateMetricBaselineProvider.yaml" \ No newline at end of file diff --git a/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricBaselineProvider.yaml b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricBaselineProvider.yaml new file mode 100644 index 000000000..9b5c62ec8 --- /dev/null +++ b/api/services/ocean/cd/schemas/verificationTemplate/oceanCDVerificationTemplateMetricBaselineProvider.yaml @@ -0,0 +1,13 @@ +type: object +title: Ocean CD Verification Metric Baseline Provider, only one provider type can be defined and it must be equal to the metric provider +description: The name of the monitoring tool chosen for the metric +properties: + prometheus: + type: object + $ref: "oceanCDVerificationTemplateMetricPrometheus.yaml" + newRelic: + type: object + $ref: "oceanCDVerificationTemplateMetricNewRelic.yaml" + datadog: + type: object + $ref: "oceanCDVerificationTemplateMetricDatadog.yaml" diff --git a/api/services/ocean/commons/parameters/azureRollId.yaml b/api/services/ocean/commons/parameters/azureRollId.yaml new file mode 100644 index 000000000..6ac87c3e6 --- /dev/null +++ b/api/services/ocean/commons/parameters/azureRollId.yaml @@ -0,0 +1,8 @@ +in: path +name: rollId +schema: + type: string +required: true +example: acr-12345abc +description: > + Ocean cluster roll identifier. diff --git a/api/spot.yaml b/api/spot.yaml index c4616fa24..98ffed34b 100644 --- a/api/spot.yaml +++ b/api/spot.yaml @@ -694,12 +694,20 @@ paths: $ref: services/ocean/aksV2/paths/clusterLaunchNodes.yaml /ocean/azure/np/virtualNodeGroup: $ref: services/ocean/aksV2/paths/virtualNodeGroups.yaml + /ocean/azure/np/cluster/{oceanClusterId}/migration/discovery: + $ref: services/ocean/aksV2/paths/workloadMigrationDiscovery.yaml /ocean/azure/np/virtualNodeGroup/{virtualNodeGroupId}: $ref: services/ocean/aksV2/paths/virtualNodeGroup.yaml /ocean/azure/np/virtualNodeGroup/import: $ref: services/ocean/aksV2/paths/importVirtualNodeGroup.yaml /ocean/azure/np/virtualNodeGroup/vmSizes: $ref: services/ocean/aksV2/paths/virtualNodeGroupAllowedVmSizes.yaml + /ocean/azure/np/cluster/{oceanClusterId}/roll: + $ref: services/ocean/aksV2/paths/roll.yaml + /ocean/azure/np/cluster/{oceanClusterId}/roll/{rollId}: + $ref: services/ocean/aksV2/paths/roll-get.yaml + /ocean/azure/np/cluster/{oceanClusterId}/roll/{rollId}/stop: + $ref: services/ocean/aksV2/paths/roll-stop.yaml /ocean/azure/k8s/cluster/{oceanClusterId}/aggregatedCosts: $ref: services/ocean/aks/paths/cluster-aggregated-costs.yaml /ocean/azure/k8s/cluster/{oceanClusterId}/aggregatedCosts/summary: