# Service Outages

## GET /service-outages

> Get the outages (including applied overrides) of a specific service

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"0.0.1"},"tags":[{"name":"Service Outages"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}}},"paths":{"/service-outages":{"get":{"tags":["Service Outages"],"summary":"Get the outages (including applied overrides) of a specific service","parameters":[{"name":"service","in":"query","description":"the id of the service for which the outages should be fetched","schema":{"type":"number"}},{"name":"from","in":"query","description":"from date, ISO-UTC e.g. 2021-05-25T21:24:56.771Z","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","description":"until date, ISO-UTC e.g. 2021-05-26T21:24:56.771Z","schema":{"type":"string","format":"date-time"}},{"name":"ignore-overrides","in":"query","description":"if the outages should not take overrides into account, default is false","schema":{"type":"boolean"}}],"responses":{"200":{"description":"The outages of the service","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"}}}}}}}}}}}}
```

## GET /service-outages/overrides

> Get the overrides of a specific service

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"0.0.1"},"tags":[{"name":"Service Outages"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}}},"paths":{"/service-outages/overrides":{"get":{"tags":["Service Outages"],"summary":"Get the overrides of a specific service","parameters":[{"name":"service","in":"query","description":"the id of the service for which the overrides should be fetched","schema":{"type":"number"}},{"name":"from","in":"query","description":"from date, ISO-UTC e.g. 2021-05-25T21:24:56.771Z","schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","description":"until date, ISO-UTC e.g. 2021-05-26T21:24:56.771Z","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"The overrides of the service","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"service":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"description":{"type":"string"},"oneOpenIncidentOnly":{"type":"boolean"},"showUptimeHistory":{"type":"boolean"},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}}}},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"}}}}}}}}}}}}
```

## POST /service-outages/overrides

> Override a part of a service's outage history

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"0.0.1"},"tags":[{"name":"Service Outages"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}}},"paths":{"/service-outages/overrides":{"post":{"tags":["Service Outages"],"summary":"Override a part of a service's outage history","requestBody":{"description":"override that should be made","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"service":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"description":{"type":"string"},"oneOpenIncidentOnly":{"type":"boolean"},"showUptimeHistory":{"type":"boolean"},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}}}},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"}}}}},"required":true},"responses":{"201":{"description":"The added override","content":{"application/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1service-outages~1overrides/post/requestBody/content/application~1json/schema/properties"}}}}}}}}}}
```

## GET /service-outages/overrides/{id}

> Get the specific service outage override

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"0.0.1"},"tags":[{"name":"Service Outages"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}}},"paths":{"/service-outages/overrides/{id}":{"get":{"tags":["Service Outages"],"summary":"Get the specific service outage override","parameters":[{"name":"id","in":"path","description":"entity ID","required":true,"schema":{"type":"number"}}],"responses":{"200":{"description":"The override","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"service":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"description":{"type":"string"},"oneOpenIncidentOnly":{"type":"boolean"},"showUptimeHistory":{"type":"boolean"},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}}}},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"}}}}}}}}}}}
```

## PUT /service-outages/overrides/{id}

> Update an existing service outage override

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"0.0.1"},"tags":[{"name":"Service Outages"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}}},"paths":{"/service-outages/overrides/{id}":{"put":{"tags":["Service Outages"],"summary":"Update an existing service outage override","parameters":[{"name":"id","in":"path","description":"entity ID","required":true,"schema":{"type":"number"}}],"requestBody":{"description":"override that should be made","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"service":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"description":{"type":"string"},"oneOpenIncidentOnly":{"type":"boolean"},"showUptimeHistory":{"type":"boolean"},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"}}}}}},"status":{"type":"string","description":"the service status","enum":["OPERATIONAL","UNDER_MAINTENANCE","DEGRADED","PARTIAL_OUTAGE","MAJOR_OUTAGE"]},"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"}}}}},"required":true},"responses":{"200":{"description":"The updated override","content":{"application/json":{"schema":{"type":"object","properties":{"$ref":"#/paths/~1service-outages~1overrides~1{id}/put/requestBody/content/application~1json/schema/properties"}}}}}}}}}}
```

## DELETE /service-outages/overrides/{id}

> Remove a service outage override

OpenAPI:

```json
{"openapi":"3.0.1","info":{"title":"ilert REST API","version":"0.0.1"},"tags":[{"name":"Service Outages"}],"servers":[{"url":"/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","description":"The Bearer API key of your user <a href='/api-docs/#section/Authentication'>more info</a>.","name":"Authorization","in":"header"}}},"paths":{"/service-outages/overrides/{id}":{"delete":{"tags":["Service Outages"],"summary":"Remove a service outage override","parameters":[{"name":"id","in":"path","description":"entity ID","required":true,"schema":{"type":"number"}}],"responses":{"204":{"description":"the response","content":{}}}}}}}
```
