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

# Policy (Slurm)

Cedana API for policies (Slurm)

## List maintenance windows

> Returns all maintenance windows

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for policies (Slurm)","name":"Policy (Slurm)"}],"security":[{"Auth Token":[]}],"components":{"securitySchemes":{},"schemas":{"SlurmMaintenanceWindow":{"properties":{"created_at":{"format":"date-time","type":["string","null"]},"end_time":{"format":"date-time","type":["string","null"]},"id":{"type":["string","null"]},"nodes":{"items":{"type":"string"},"type":["array","null"]},"partitions":{"items":{"type":"string"},"type":["array","null"]},"reason":{"type":["string","null"]},"start_time":{"format":"date-time","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/maintenance_window":{"get":{"description":"Returns all maintenance windows","operationId":"list_maintenance_windows","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SlurmMaintenanceWindow"},"type":"array"}}},"description":"Returns all SLURM maintenance windows"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/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 maintenance windows","tags":["Policy (Slurm)"]}}}}
```

## Create maintenance window

> Creates a new maintenance window for SLURM clusters

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for policies (Slurm)","name":"Policy (Slurm)"}],"security":[{"Auth Token":[]}],"components":{"securitySchemes":{},"schemas":{"CreateMaintenanceWindow":{"properties":{"end_time":{"format":"date-time","type":"string"},"nodes":{"items":{"type":"string"},"type":["array","null"]},"partitions":{"items":{"type":"string"},"type":["array","null"]},"reason":{"type":"string"},"start_time":{"format":"date-time","type":"string"},"status":{"type":["string","null"]}},"required":["start_time","end_time","reason"],"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/maintenance_window":{"post":{"description":"Creates a new maintenance window for SLURM clusters","operationId":"create_maintenance_window","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMaintenanceWindow"}}},"required":true},"responses":{"201":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Returns the maintenance window id for the new maintenance window"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Invalid request parameters"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/execute request against 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":"Create maintenance window","tags":["Policy (Slurm)"]}}}}
```

## Get maintenance window

> Returns a specific maintenance window by ID

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for policies (Slurm)","name":"Policy (Slurm)"}],"security":[{"Auth Token":[]}],"components":{"securitySchemes":{},"schemas":{"SlurmMaintenanceWindow":{"properties":{"created_at":{"format":"date-time","type":["string","null"]},"end_time":{"format":"date-time","type":["string","null"]},"id":{"type":["string","null"]},"nodes":{"items":{"type":"string"},"type":["array","null"]},"partitions":{"items":{"type":"string"},"type":["array","null"]},"reason":{"type":["string","null"]},"start_time":{"format":"date-time","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/maintenance_window/{id}":{"get":{"description":"Returns a specific maintenance window by ID","operationId":"get_maintenance_window","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlurmMaintenanceWindow"}}},"description":"Returns the maintenance window"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Invalid UUID provided"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Maintenance window not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/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":"Get maintenance window","tags":["Policy (Slurm)"]}}}}
```

## Update maintenance window

> Updates an existing maintenance window

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for policies (Slurm)","name":"Policy (Slurm)"}],"security":[{"Auth Token":[]}],"components":{"securitySchemes":{},"schemas":{"UpdateMaintenanceWindow":{"properties":{"end_time":{"format":"date-time","type":["string","null"]},"nodes":{"items":{"type":"string"},"type":["array","null"]},"partitions":{"items":{"type":"string"},"type":["array","null"]},"reason":{"type":["string","null"]},"start_time":{"format":"date-time","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/maintenance_window/{id}":{"put":{"description":"Updates an existing maintenance window","operationId":"update_maintenance_window","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMaintenanceWindow"}}},"required":true},"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Successfully updated maintenance window and returns id"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Invalid UUID provided"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Maintenance window not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/execute request against 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":"Update maintenance window","tags":["Policy (Slurm)"]}}}}
```

## Delete maintenance window

> Deletes a maintenance window by ID

```json
{"openapi":"3.1.0","info":{"title":"Cedana API","version":"0.0.0-dev"},"tags":[{"description":"Cedana API for policies (Slurm)","name":"Policy (Slurm)"}],"security":[{"Auth Token":[]}],"components":{"securitySchemes":{},"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/maintenance_window/{id}":{"delete":{"description":"Deletes a maintenance window by ID","operationId":"delete_maintenance_window","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Successfully deleted maintenance window and returns id"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Invalid UUID provided"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Maintenance window not found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}},"description":"Failed to connect/execute request against 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":"Delete maintenance window","tags":["Policy (Slurm)"]}}}}
```
