Skip to content

Commit

Permalink
Merge branch 'master' into DOC-2708-API-add-API-s-to-Edit-FinOps-User…
Browse files Browse the repository at this point in the history
…-Permissions-for-Accounts-and-Policies
  • Loading branch information
mdcolombaninetapp committed Feb 10, 2025
2 parents 1cd6d89 + 2ef2940 commit 79b4410
Show file tree
Hide file tree
Showing 14 changed files with 226 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ properties:
properties:
name:
type: string
description: Name of the Policy
description: >
Name of the Policy. Note: names cannot include these characters: + = @
example: my policy
description:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ properties:
example: test programmatic
name:
type: string
description: Name of the programmatic user.
description: >
Name of the programmatic user. Note: names cannot include these characters: + = @
example: testProgrammaticApi
accounts:
type: array
Expand Down
6 changes: 4 additions & 2 deletions api/services/administration/general/schemas/createUser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ type: object
properties:
firstName:
type: string
description: The first name of the user
description: >
The first name of the user. Note: names cannot include these characters: + = @
example: Test
lastName:
type: string
description: The last name of the user
description: >
The last name of the user. Note: names cannot include these characters: + = @
example: Test
email:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ properties:
example: "ugr-a1b2c3d4"
name:
type: string
description: user group name
description: >
Name of the user group. Note: names cannot include these characters: + = @
example: "Developers"
description:
type: string
Expand Down
22 changes: 22 additions & 0 deletions api/services/ocean/rightsizing/paths/oceanRightsizingSavings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
post:
summary: "Get Ocean Right-Sizing Savings"
description: |
Get right-sizing savings from downsizing operations for an Ocean cluster.
operationId: "oceanRightsizingSavings"
tags:
- "Ocean Automatic Rightsizing"
parameters:
- $ref: "../parameters/oceanId.yaml"
- $ref: "../../../../commons/parameters/accountId.yaml"
requestBody:
required: true
content:
application/json:
schema:
allOf:
- $ref: "../schemas/oceanRightsizingSavingsRequest.yaml"
responses:
200:
$ref: "../responses/oceanRightsizingSavingsResponse.yaml"
400:
description: "Bad Request"
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ content:
config:
type: object
properties:
recommendationsPercentile:
recommendationsCpuPercentile:
type: integer
example: 85
recommendationsMemoryPercentile:
type: integer
example: 85
kind:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
description: "Ocean right-sizing savings response"
content:
application/json:
schema:
allOf:
- $ref: "../../../../commons/schemas/responseItemWrapper.yaml"
- type: object
properties:
request:
type: object
properties:
url:
example: "/ocean/o-abcd1234/rightSizing/savings"
method:
example: "POST"
response:
type: object
properties:
items:
type: array
items:
$ref: "../schemas/oceanRightsizingSavings.yaml"
example:
- totalSavingsSummary:
cpuWithOcean: 100,
memoryWithOcean: 128,
savings: 1000,
percentage: 0.75
namespacesSavingsSummary:
- namespace: "kube-system"
savings: 500
- namespace: "default"
savings: 500
workloadSavings:
- workloadName: "coredns"
workloadType: "Deployment"
namespace: "kube-system"
cpuWithOcean: 25
cpuWithoutOcean: 50
memoryWithOcean: 32
memoryWithoutOcean: 64
savings: 250
isDeleted: True
- workloadName: "aws-node"
workloadType: "DaemonSet"
namespace: "kube-system"
cpuWithOcean: 25
cpuWithoutOcean: 50
memoryWithOcean: 32
memoryWithoutOcean: 64
savings: 250
isDeleted": False
count:
example: 1
kind:
example: "mcs:ocean:rightSizing:savings"
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
type: object
title: Ocean Right-Sizing Savings Response
description: >
Right-sizing savings response object
properties:
totalSavingsSummary: #todo baruch - add description for the main objects
type: object
description: A summary of the savings for all the workloads in the response
properties:
cpuWithOcean:
type: number
memoryWithOcean:
type: number
savings:
type: number
percentage:
type: number
namespacesSavingsSummary:
type: array
description: A summary of the savings for each namespace in the response
items:
type: object
properties:
namespace:
type: string
savings:
type: number
workloadSavings:
type: array
description: A list of the savings for each workload in the response
items:
type: object
properties:
workloadName:
type: string
workloadType:
type: string
namespace:
type: string
cpuWithOcean:
type: number
cpuWithoutOcean:
type: number
memoryWithOcean:
type: number
memoryWithoutOcean:
type: number
savings:
type: number
isDeleted:
type: boolean


Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
type: object
title: Ocean Right-Sizing Savings
description: >
Determines the Ocean right-sizing savings
required:
- endTime
- startTime
- workloads
properties:
startTime:
type: string
example: 2025-01-20T11:35:02.745Z
description: >
Start date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
endTime:
type: string
example: 2025-01-30T11:30:01.745Z
description: >
End date value using either the date format "yyyy-MM-dd'T'HH:mm:ss'Z'" or ms "1494751821472".
benchmark:
type: string
description: >
The benchmark to compare the savings against. The default is ORIGINAL.
enum: [ORIGINAL, CURRENT]
workloads:
$ref: "../schemas/oceanRightsizingSavingsWorkloadsRequest.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
title: Ocean Right-Sizing Savings Workloads
description: >
Determines the Ocean Savings filtering by the combinations of namespace::workload
type: object
properties:
namespaceName:
type: object
additionalProperties:
type: array
items:
type: object
properties: #todo baruch
workloadName:
type: string
description: The name of the workload
workloadType:
type: string
description: The type of the workload (e.g., Deployment, DaemonSet, StatefulSet)

example:
namespaceName1:
- workloadName: workloadName1
workloadType: Deployment
- workloadName: workloadName2
workloadType: DaemonSet
namespaceName2:
- workloadName: workloadName3
workloadType: StatefulSet
- workloadName: workloadName4
workloadType: Deployment
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ required:
properties:
config:
type: object
required:
- recommendationsPercentile
minProperties: 1
properties:
recommendationsPercentile:
recommendationsCpuPercentile:
type: integer
description: Change the percentile that the right-sizing recommendations calculation will take into account.
description: Change the cpu percentile that the right-sizing recommendations calculation will take into account.
example: 85
enum: [ 85, 90, 95, 99 ]
enum: [ 85, 90, 95, 99 ]
recommendationsMemoryPercentile:
type: integer
description: Change the memory percentile that the right-sizing recommendations calculation will take into account.
example: 85
enum: [ 85, 90, 95, 100 ]
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ properties:
logCollection:
$ref: "oceanSparkClusterConfigLogCollection.yaml"
spark:
$ref: "oceanSparkClusterConfigSpark.yaml"
$ref: "oceanSparkClusterConfigSpark.yaml"
workspaces:
$ref: "oceanSparkClusterConfigWorkspaces.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: object
description: >
The object specifying the Ocean Spark Workspaces configuration.
properties:
storageClassOverride:
allOf:
- $ref: "k8sName.yaml"
- example: my-custom-storage-class
description: |
The storage class to use for Ocean Spark workspaces. If not set, the cluster's default storage class will
be used.
2 changes: 2 additions & 0 deletions api/spot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ paths:
$ref: services/ocean/rightsizing/paths/oceanRightsizingAcknowledgeRollbacks.yaml
/ocean/{oceanId}/rightSizing/cluster/configuration:
$ref: services/ocean/rightsizing/paths/oceanRightsizingClusterConfiguration.yaml
/ocean/{oceanId}/rightSizing/savings:
$ref: services/ocean/rightsizing/paths/oceanRightsizingSavings.yaml
/security/v1/compliances:
$ref: services/security/v1/paths/compliances.yaml
/security/v1/compliances/count:
Expand Down

0 comments on commit 79b4410

Please sign in to comment.