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

# Nodes (Slurm)

Cedana API for nodes (Slurm)

## GET /v1/slurm/nodes

> List nodes

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for nodes (Slurm)","name":"Nodes (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmNode":{"properties":{"cpus":{"format":"int32","type":["integer","null"]},"id":{"format":"uuid","type":"string"},"memory":{"format":"int64","type":["integer","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]}},"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/nodes":{"get":{"operationId":"list","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SlurmNode"},"type":"array"}}},"description":"Returns nodes"},"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 nodes","tags":["Nodes (Slurm)"]}}}}
```

## Sync nodes

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

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for nodes (Slurm)","name":"Nodes (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmNodeSyncRequest":{"properties":{"cluster_id":{"format":"uuid","type":"string"},"nodes":{"items":{"$ref":"#/components/schemas/SlurmNodeSync"},"type":"array"}},"required":["cluster_id","nodes"],"type":"object"},"SlurmNodeSync":{"description":"SlurmNodeSync is the format sent by cedana-slurm when syncing nodes","properties":{"cpus":{"format":"int32","type":"integer"},"id":{"type":"string"},"memory":{"format":"int64","type":"integer"},"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/nodes/sync":{"post":{"description":"Receives a batch of SLURM nodes from the cedana-slurm plugin and upserts them.\nNodes missing from the payload are marked as STALE.","operationId":"sync","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlurmNodeSyncRequest"}}},"required":true},"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Nodes synced successfully"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to sync nodes 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 nodes","tags":["Nodes (Slurm)"]}}}}
```

## GET /v1/slurm/nodes\_paginated

> List nodes (paginated)

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for nodes (Slurm)","name":"Nodes (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"SlurmNode":{"properties":{"cpus":{"format":"int32","type":["integer","null"]},"id":{"format":"uuid","type":"string"},"memory":{"format":"int64","type":["integer","null"]},"name":{"type":["string","null"]},"status":{"type":["string","null"]}},"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/nodes_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/SlurmNode"},"type":"array"}}},"description":"Returns nodes"},"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 nodes (paginated)","tags":["Nodes (Slurm)"]}}}}
```
