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

# Actions (Slurm)

Cedana API for actions (Slurm)

## POST /v1/slurm/checkpoint/job

> Checkpoint job

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for actions (Slurm)","name":"Actions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"CheckpointSlurmJob":{"properties":{"action_id":{"readOnly":true,"type":["string","null"]},"cluster_id":{"type":"string"},"job_id":{"type":["string","null"]},"job_name":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/SlurmCheckpointKind"},"reason":{"$ref":"#/components/schemas/SlurmCheckpointReason"}},"required":["cluster_id"],"type":"object"},"SlurmCheckpointKind":{"enum":["simple","rootfs","rootfsonly"],"type":"string"},"SlurmCheckpointReason":{"enum":["heartbeat","manual","preemption"],"type":"string"},"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/checkpoint/job":{"post":{"operationId":"checkpoint_slurm_job","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckpointSlurmJob"}}},"required":true},"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Returns the id for the task"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Missing or malformed cluster_id"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to find checkpointable resource"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/fetch from jobs table 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":"Checkpoint job","tags":["Actions (Slurm)"]}}}}
```

## Get path of latest checkpoint

> Returns the path of the latest successful checkpoint for a given checkpoint name

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for actions (Slurm)","name":"Actions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"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/checkpoint/path":{"get":{"description":"Returns the path of the latest successful checkpoint for a given checkpoint name","operationId":"get_latest_checkpoint_path","parameters":[{"in":"query","name":"name","required":false,"schema":{"type":["string","null"]}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Returns the restore path"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to get action for request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"No checkpoint exists under this name yet"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/fetch from jobs table 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":"Get path of latest checkpoint","tags":["Actions (Slurm)"]}}}}
```

## POST /v1/slurm/restore/job

> Restore job

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for actions (Slurm)","name":"Actions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"scheme":"bearer","type":"http"}},"schemas":{"RestoreSlurmJob":{"properties":{"action_id":{"type":"string"},"cluster_id":{"type":["string","null"]},"reason":{"$ref":"#/components/schemas/SlurmRestoreReason"}},"required":["action_id"],"type":"object"},"SlurmRestoreReason":{"enum":["nodeTermination","nodeUnschedulable","manual"],"type":"string"},"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/restore/job":{"post":{"operationId":"restore_slurm_job","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreSlurmJob"}}},"required":true},"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Returns the checkpoint id for the new checkpoint"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed create checkpoint"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed create restore"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/fetch from jobs table 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":"Restore job","tags":["Actions (Slurm)"]}}}}
```
