Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions api/commons/schemas/responseItemWrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ allOf:
response:
type: "object"
properties:
kind:
type: "string"
description: >
The data type of each item in the response.
items:
type: "array"
description: >
Array of data objects.
items:
type: "object"
count:
type: "integer"
example: 1
description: >
Size of the data object array.
kind:
type: "string"
description: >
The data type of each item in the response.
12 changes: 12 additions & 0 deletions api/services/ocean/rightsizing/parameters/limit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
in: query
name: limit
schema:
type: integer
format: int16
default: 100
minimum: 1
maximum: 200
required: false
example: 100
description: >
Number of entries to return.
9 changes: 9 additions & 0 deletions api/services/ocean/rightsizing/parameters/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
in: path
name: namespace
schema:
type: string
required: true
example: kube-system
description: >
Kubernetes namespace.

11 changes: 11 additions & 0 deletions api/services/ocean/rightsizing/parameters/offset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
in: query
name: offset
schema:
type: integer
format: int16
default: 0
minimum: 0
example: 0
required: false
description: >
Number of entries to skip before returning page.
9 changes: 9 additions & 0 deletions api/services/ocean/rightsizing/parameters/workloadName.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
in: path
name: workloadName
schema:
type: string
required: true
example: redis-controller
description: >
Kubernetes workload name.

14 changes: 14 additions & 0 deletions api/services/ocean/rightsizing/parameters/workloadType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
in: path
name: workloadType
schema:
type: string
enum:
- deployment
- daemonSet
- statefulSet
- rollout
required: true
example: deployment
description: >
Workload type as defined in kubernetes.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
get:
summary: "Get Workload Recommendation Application History"
description: |
Returns a set of recommendation application history records associated with workload.
operationId: "getWorkloadRecommendationApplicationHistory"
tags:
- "Ocean Automatic Rightsizing"
parameters:
- $ref: "../parameters/oceanId.yaml"
- $ref: "../parameters/namespace.yaml"
- $ref: "../parameters/workloadType.yaml"
- $ref: "../parameters/workloadName.yaml"
- $ref: "../../../../commons/parameters/accountId.yaml"
- $ref: "../parameters/offset.yaml"
- $ref: "../parameters/limit.yaml"
responses:
200:
$ref: "../responses/oceanRightsizingRecommendationApplicationHistoryResponse.yaml"
400:
description: "Invalid request provided"
404:
description: "Non existent resource has been queried"
422:
description: "Business rule violated"

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
description: "Ocean Rightsizing Recommendation Application History Response"
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/o-abcd1234/rightSizing/namespaces/kube-system/deployment/redis-controller/recommendation-application-history"
method:
example: "GET"
response:
type: object
properties:
kind:
example: "mcs:ocean:rightSizing:recommendationApplicationHistory"
items:
type: array
items:
$ref: "../schemas/oceanRightsizingRecommendationApplicationHistory.yaml"
example:
- page:
- containerName: "my-app-container"
actionType: "APPLIED"
currentResources:
cpu: 4000
memory: 16000
recommendedResources:
cpu: 2000
memory: 8000
occurredAt: 1776178797289
ruleName: "my-app-rule"
count:
example: 1

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type: object
title: Compute Resource
description: >
Represents CPU and memory resource values.
properties:
cpu:
type: integer
format: int32
description: CPU resource value in millicores.
example: 4000
memory:
type: integer
format: int32
description: Memory resource value in MiB.
example: 16000

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
title: Recommendation Application History
description: >
A page of recommendation application history records.
properties:
page:
type: array
items:
$ref: "../schemas/oceanRightsizingRecommendationApplicationItem.yaml"

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
type: object
title: Recommendation Application Item
description: >
A single recommendation application history record for a container.
properties:
containerName:
type: string
description: Name of the container.
example: "my-app-container"
actionType:
type: string
description: The type of action that was taken or the reason it was not applied.
enum:
- APPLIED
- CPU_ONLY_APPLIED
- MEMORY_ONLY_APPLIED
- OUTSIDE_OF_TIME_WINDOW
- THRESHOLD_NOT_MET
- HPA_RESTRICTED
- UNSUPPORTED_HPA
- INVALID_HPA
- PRELIMINARY_RESTRICTED
example: "APPLIED"
currentResources:
$ref: "../schemas/oceanRightsizingComputeResource.yaml"
recommendedResources:
$ref: "../schemas/oceanRightsizingComputeResource.yaml"
occurredAt:
type: integer
format: int64
description: Timestamp (epoch millis) when the action occurred.
example: 1776178797289
ruleName:
type: string
description: Name of the rightsizing rule that triggered this action.
example: "my-app-rule"

2 changes: 2 additions & 0 deletions api/spot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,8 @@ paths:
$ref: services/ocean/rightsizing/paths/oceanRightsizingClusterConfiguration.yaml
/ocean/{oceanId}/rightSizing/savings:
$ref: services/ocean/rightsizing/paths/oceanRightsizingSavings.yaml
/ocean/{oceanId}/rightSizing/namespaces/{namespace}/{workloadType}/{workloadName}/recommendation-application-history:
$ref: services/ocean/rightsizing/paths/oceanRightsizingRecommendationApplicationHistory.yaml
/security/v1/compliances:
$ref: services/security/v1/paths/compliances.yaml
/security/v1/compliances/count:
Expand Down
Loading