---
title: "Create Ocean Rightsizing Rule"
method: POST
path: "/ocean/{oceanId}/rightSizing/rule"
tags: ["Ocean Automatic Rightsizing"]
---

# Create Ocean Rightsizing Rule

`POST /ocean/{oceanId}/rightSizing/rule`

## Parameters

- `#/paths/~1ocean~1%7BoceanId%7D~1rightSizing~1rule/get/parameters/0` — unresolved $ref
- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref

## Request body

- object — Determines the Ocean Rightsizing rule
  - `ruleName` string — The unique name of the rule
  - `restartReplicas` 'MORE_THAN_ONE_REPLICA' | 'ALL_MANIFEST' | 'NO_RESTART' — Enable to sequentially restart pod batches according to recommendations, for all pods, only more than 1 replica, or not any pod.
  - `excludePreliminaryRecommendations` boolean — Exclude preliminary recommendations (recommendations based on less than 4 full days of data).
  - `recommendationApplicationIntervals` object[], required — Determines the Ocean Rightsizing rule recommendation application intervals
    - `repetitionBasis` 'WEEKLY' | 'MONTHLY' — The repetition basis
    - `monthlyRepetitionBasis` object — Determines the Ocean Rightsizing rule monthly repetition basis
      - `intervalMonths` integer[] — Array of the months (in number), when we want to trigger the apply recommendations.
      - `weekOfTheMonth` 'FIRST' | 'SECOND' | 'THIRD' | 'FOURTH' | 'LAST' — Array of the weeks in the month, when we want to trigger the apply recommendations.
      - `weeklyRepetitionBasis` WeeklyRepetitionBasis — unresolved $ref
    - `weeklyRepetitionBasis` object — Determines the Ocean Rightsizing rule weekly repetition basis
      - `intervalDays` string[] — Array of the days of the week, when we want to trigger the apply recommendations.
      - `intervalHours` object
        - `startTime` string
        - `endTime` string
  - `recommendationApplicationMinThreshold` object — Determines the extent of difference between current request and recommendation to trigger a change in percentage
    - `cpuPercentage` number
    - `memoryPercentage` number
  - `recommendationApplicationBoundaries` object — Determines the Ocean Rightsizing rule recommendation application boundaries.
    - `cpu` object
      - `min` integer — the minimal value of cpu in vCpu
      - `max` integer — the maximal value of cpu in vCpu
    - `memory` object
      - `min` integer — the minimal value of memory in Gib
      - `max` integer — the maximal value of memory in Gib
  - `recommendationApplicationOverheadValues` object — Determines the Ocean Rightsizing rule recommendation application overhead values
    - `cpuPercentage` number
    - `memoryPercentage` number
  - `recommendationApplicationHPA` object — HPA Rightsizing Rule Recommendation Configuration
    - `allowHPARecommendations` boolean — Determines by the rule if recommendation application is allowed for workloads with HPA definition.
  - `autoApplyDefinition` object — Ocean Rightsizing Rule Auto Apply Configuration
    - `enabled` boolean — Determines if auto apply is enabled.
    - `namespaces` string[] — A list of namespaces that match the auto-apply rule.
    - `labels` object — A set of key-value label pairs used to automatically apply this rule to all workloads in the cluster that match these labels.
  - `cpuPercentile` integer — vCPU percentile for calculating recommendations.
  - `memoryPercentile` integer — Memory percentile for calculating recommendations.
  - `downsideOnly` boolean — When set to 'true', only downscale recommendations will be applied.

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
