> 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)

## List nodes

> Paginated. \`total\_count\` is the number of nodes matching the filters before paging.

```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":{"PaginatedSlurmNodeResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/SlurmNode"},"type":"array"},"total_count":{"format":"int64","type":"integer"}},"required":["nodes","total_count"],"type":"object"},"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":{"description":"Paginated. `total_count` is the number of nodes matching the filters before paging.","operationId":"list","parameters":[{"description":"Exact node id to fetch","in":"query","name":"id","required":false,"schema":{"format":"uuid","type":["string","null"]}},{"description":"Only return nodes belonging to this cluster","in":"query","name":"cluster_id","required":false,"schema":{"format":"uuid","type":["string","null"]}},{"description":"Row offset (default 0)","in":"query","name":"offset","required":false,"schema":{"format":"int64","type":["integer","null"]}},{"description":"Page size (default 50, max 500)","in":"query","name":"limit","required":false,"schema":{"format":"int64","type":["integer","null"]}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSlurmNodeResponse"}}},"description":"Returns nodes with total count"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Invalid query parameters"},"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)"]}}}}
```
