---
title: "Check Cluster Capacity"
method: POST
path: "/clusters/{cluster_id}/capacity-check"
tags: ["clusters"]
---

# Check Cluster Capacity

`POST /clusters/{cluster_id}/capacity-check`

## Request

- Base URL: `https://api.mengi.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mengi.cloud/clusters/{cluster_id}/capacity-check`
- Auth: none declared

Tell, before creating or resizing a workload, whether it fits on a
shared cluster.

Shared clusters cap the CPU and memory requests of everything in the
tenant; a pod over the cap is rejected at admission and ends up as a
failed deployment or database. This answers the same question up front
from the tenant's live quota. For dedicated clusters and clusters that
are not running yet `applies` is false.

## Path parameters

- `cluster_id` string, uuid, required

## Request body

- CapacityCheckRequest: Describe the workload the user is about to create or resize.
  - `kind` 'deployment' | 'database', required
  - `cpu_request` number
  - `memory_request_mb` integer
  - `replicas` integer
  - `deployment_type` string
  - `engine` string, nullable
  - `tier` string, nullable
  - `exclude_deployment_id` string, uuid, nullable
  - `exclude_database_id` string, uuid, nullable

## Response `200`

Successful Response

- CapacityCheckResponse: `applies` is false when the cluster has no quota to check against (not shared, not running, or the host could not be read); `fits` is then true and the amounts are zero.
  - `applies` boolean, required
  - `fits` boolean, required
  - `required` ResourceAmountResponse, required
    - `cpu_millicores` integer, required
    - `memory_mb` integer, required
  - `free` ResourceAmountResponse, required
    - `cpu_millicores` integer, required
    - `memory_mb` integer, required
  - `quota` ResourceAmountResponse, required
    - `cpu_millicores` integer, required
    - `memory_mb` integer, required
  - `used` ResourceAmountResponse, required
    - `cpu_millicores` integer, required
    - `memory_mb` integer, required
  - `message` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mengi/apis/mengi-cloud.md) · [All operations](https://skmtc.dev/mengi/apis/mengi-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/mengi/apis/mengi-cloud/revisions/4ae9b375cdbb?raw)
