> For the complete documentation index, see [llms.txt](https://docs.cedana.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cedana.ai/references/api/clusters-slurm.md).

# Clusters (Slurm)

Cedana API for clusters (Slurm)

## GET /v1/slurm/clusters

> List clusters

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for clusters (Slurm)","name":"Clusters (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmCluster":{"properties":{"id":{"format":"uuid","type":"string"},"metadata":{},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"type":"object"},"HttpError":{"description":"Standard JSON error body for all 4xx/5xx responses.\n\nHandlers return plain-text errors internally; [`normalize_error_response`]\nconverts anything the stack produces (handlers, extractors, the auth layer)\nto this shape, so generated SDK clients can rely on a single error schema.","properties":{"message":{"description":"Human-readable description of what went wrong","type":"string"}},"required":["message"],"type":"object"}}},"paths":{"/v1/slurm/clusters":{"get":{"operationId":"list","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SlurmCluster"},"type":"array"}}},"description":"Returns clusters"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to fetch from database"},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Client error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Server error"}},"summary":"List clusters","tags":["Clusters (Slurm)"]}}}}
```

## Sync clusters

> Receives a batch of SLURM clusters from the cedana-slurm plugin and upserts them.\
> Clusters missing from the payload (for this cluster\_id) are marked STALE.

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for clusters (Slurm)","name":"Clusters (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmClusterSyncRequest":{"properties":{"cluster_id":{"format":"uuid","type":"string"},"clusters":{"items":{"$ref":"#/components/schemas/SlurmClusterSync"},"type":"array"}},"required":["cluster_id","clusters"],"type":"object"},"SlurmClusterSync":{"description":"SlurmClusterSync is the format sent by cedana-slurm when syncing clusters","properties":{"id":{"type":"string"},"metadata":{},"name":{"type":"string"},"status":{"type":"string"}},"required":["name"],"type":"object"},"HttpError":{"description":"Standard JSON error body for all 4xx/5xx responses.\n\nHandlers return plain-text errors internally; [`normalize_error_response`]\nconverts anything the stack produces (handlers, extractors, the auth layer)\nto this shape, so generated SDK clients can rely on a single error schema.","properties":{"message":{"description":"Human-readable description of what went wrong","type":"string"}},"required":["message"],"type":"object"}}},"paths":{"/v1/slurm/clusters/sync":{"post":{"description":"Receives a batch of SLURM clusters from the cedana-slurm plugin and upserts them.\nClusters missing from the payload (for this cluster_id) are marked STALE.","operationId":"sync","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlurmClusterSyncRequest"}}},"required":true},"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Clusters synced successfully"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to sync clusters to database"},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Client error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Server error"}},"summary":"Sync clusters","tags":["Clusters (Slurm)"]}}}}
```

## GET /v1/slurm/clusters\_paginated

> List clusters (paginated)

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for clusters (Slurm)","name":"Clusters (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmCluster":{"properties":{"id":{"format":"uuid","type":"string"},"metadata":{},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"],"type":"object"},"HttpError":{"description":"Standard JSON error body for all 4xx/5xx responses.\n\nHandlers return plain-text errors internally; [`normalize_error_response`]\nconverts anything the stack produces (handlers, extractors, the auth layer)\nto this shape, so generated SDK clients can rely on a single error schema.","properties":{"message":{"description":"Human-readable description of what went wrong","type":"string"}},"required":["message"],"type":"object"}}},"paths":{"/v1/slurm/clusters_paginated":{"get":{"operationId":"list_paginated","parameters":[{"description":"Number of records to skip (default: 0)","in":"query","name":"offset","required":false,"schema":{"format":"int64","type":"integer"}},{"description":"Maximum number of records to return (default: 50, max: 100)","in":"query","name":"limit","required":false,"schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SlurmCluster"},"type":"array"}}},"description":"Returns clusters"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to fetch from database"},"4XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Client error"},"5XX":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Server error"}},"summary":"List clusters (paginated)","tags":["Clusters (Slurm)"]}}}}
```
