> 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/partitions-slurm.md).

# Partitions (Slurm)

Cedana API for partitions (Slurm)

## GET /v1/slurm/partitions

> List partitions

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for partitions (Slurm)","name":"Partitions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmPartition":{"properties":{"default_time":{"format":"int64","type":"integer"},"id":{"format":"uuid","type":"string"},"is_default":{"type":"boolean"},"max_time":{"format":"int64","type":"integer"},"name":{"type":"string"},"nodes":{"type":"string"},"priority_tier":{"format":"int32","type":"integer"},"state":{"type":"string"},"total_cpus":{"format":"int32","type":"integer"},"total_nodes":{"format":"int32","type":"integer"}},"required":["id","name","state","total_nodes","total_cpus","nodes","max_time","default_time","priority_tier","is_default"],"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/partitions":{"get":{"operationId":"list","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SlurmPartition"},"type":"array"}}},"description":"Returns partitions"},"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 partitions","tags":["Partitions (Slurm)"]}}}}
```

## Sync partitions

> Receives a batch of SLURM partitions from the cedana-slurm plugin and upserts them.\
> Partitions missing from the payload are marked STALE.

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for partitions (Slurm)","name":"Partitions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmPartitionSyncRequest":{"properties":{"cluster_id":{"format":"uuid","type":"string"},"partitions":{"items":{"$ref":"#/components/schemas/SlurmPartitionSync"},"type":"array"}},"required":["cluster_id","partitions"],"type":"object"},"SlurmPartitionSync":{"properties":{"default_time":{"format":"int64","type":"integer"},"is_default":{"type":"boolean"},"max_time":{"format":"int64","type":"integer"},"name":{"type":"string"},"nodes":{"type":"string"},"priority_tier":{"format":"int32","type":"integer"},"state":{"type":"string"},"total_cpus":{"format":"int32","type":"integer"},"total_nodes":{"format":"int32","type":"integer"}},"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/partitions/sync":{"post":{"description":"Receives a batch of SLURM partitions from the cedana-slurm plugin and upserts them.\nPartitions missing from the payload are marked STALE.","operationId":"sync","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlurmPartitionSyncRequest"}}},"required":true},"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Partitions synced successfully"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Cluster not registered"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to sync partitions 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 partitions","tags":["Partitions (Slurm)"]}}}}
```

## GET /v1/slurm/partitions\_paginated

> List partitions (paginated)

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for partitions (Slurm)","name":"Partitions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmPartition":{"properties":{"default_time":{"format":"int64","type":"integer"},"id":{"format":"uuid","type":"string"},"is_default":{"type":"boolean"},"max_time":{"format":"int64","type":"integer"},"name":{"type":"string"},"nodes":{"type":"string"},"priority_tier":{"format":"int32","type":"integer"},"state":{"type":"string"},"total_cpus":{"format":"int32","type":"integer"},"total_nodes":{"format":"int32","type":"integer"}},"required":["id","name","state","total_nodes","total_cpus","nodes","max_time","default_time","priority_tier","is_default"],"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/partitions_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 (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/SlurmPartition"},"type":"array"}}},"description":"Returns partitions"},"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 partitions (paginated)","tags":["Partitions (Slurm)"]}}}}
```
