# Actions (Slurm)

Cedana API for actions (Slurm)

## POST /v2/slurm/checkpoint/job

> Checkpoint job

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Actions (Slurm)","description":"Cedana API for actions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"CheckpointSlurmJob":{"type":"object","properties":{"action_id":{"type":["string","null"],"readOnly":true},"job_id":{"type":["string","null"]},"job_name":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/CheckpointKind"},"reason":{"$ref":"#/components/schemas/CheckpointReason"}}},"CheckpointKind":{"type":"string","enum":["simple","rootfs","rootfsonly"]},"CheckpointReason":{"type":"string","enum":["heartbeat","manual"]},"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/slurm/checkpoint/job":{"post":{"tags":["Actions (Slurm)"],"summary":"Checkpoint job","operationId":"checkpoint_slurm_job","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckpointSlurmJob"}}},"required":true},"responses":{"200":{"description":"Returns the id for the task","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"Failed to find checkpointable resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Failed to connect/fetch from jobs table from database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```

## POST /v2/slurm/restore/job

> Restore job

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-staging"},"tags":[{"name":"Actions (Slurm)","description":"Cedana API for actions (Slurm)"}],"security":[{"Token":[]}],"components":{"securitySchemes":{"Token":{"type":"http","scheme":"bearer"}},"schemas":{"RestoreSlurmJob":{"type":"object","required":["action_id","cluster_id","reason"],"properties":{"action_id":{"type":"string"},"cluster_id":{"type":"string"},"reason":{"$ref":"#/components/schemas/RestoreReason"}}},"RestoreReason":{"type":"string","enum":["nodeTermination","nodeUnschedulable","manual"]},"ApiError":{"type":"object","description":"Standard error response for API endpoints","required":["message"],"properties":{"code":{"type":["string","null"],"description":"HTTP status code"},"details":{"description":"Optional additional error details"},"message":{"type":"string","description":"Error message describing what went wrong"}}}}},"paths":{"/v2/slurm/restore/job":{"post":{"tags":["Actions (Slurm)"],"summary":"Restore job","operationId":"restore_slurm_job","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreSlurmJob"}}},"required":true},"responses":{"200":{"description":"Returns the checkpoint id for the new checkpoint","content":{"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"Failed create checkpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Failed create restore","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Failed to connect/fetch from jobs table from database","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```
