Downtime
- GET /api/downtime/
Search for existing downtime blocks.
- Query Parameters:
start (int) – set to a UNIX timestamp to get downtime blocks starting or ending at or after that timestamp
end (int) – set to a UNIX timestamp to get downtime blocks starting or ending at or before that timestamp
planned (int) – set to
1
to get only planned downtime blocks or0
to get only unplanned downtime blockmachine (int) – if provided, only downtime blocks on the machine with this ID will be returned. Can be provided multiple times to include downtime blocks from multiple machines.
category (int) – if provided, only downtime blocks with this category will be returned. Can be provided multiple times to include downtime blocks from multiple categories. Use
0
to get downtime blocks without a category set.user (int) – set to the ID of a user to get only downtime blocks reported by that user. Can be provided multiple times to include downtime blocks from multiple users. Use
0
to get downtime blocks that were created automatically.alarm (int) – set to the ID of an alarm to get only downtime blocks associated with it. Use
0
to get only downtime blocks that are not associated with an alarm.issue (int) – set to the ID of an issue to get only downtime blocks associated with it. Use
0
to get only downtime blocks that are not associated with an issue.maintenance_item (int) – set to the ID of a maintenance item to get only downtime blocks associated with it. Use
0
to get only downtime blocks that are not associated with a maintenance item.
- Returns:
an object mapping downtime block ID to downtime block object
- PUT /api/downtime/(int: machine_id)
Report downtime on a machine.
- Parameters:
machine_id – the ID of the machine to create a downtime block for
- Status Codes:
201 Created – on success
404 Not Found – if the machine does not exist
- Reqjson:
a Downtime object (can be partial, but at least
start
is required)- Returns:
the newly created Downtime object
- GET /api/downtime/(int: downtime_id)
Get a single downtime block.
- Parameters:
downtime_id – the ID of the downtime block
- Status Codes:
404 Not Found – if the downtime ID is invalid
- PATCH /api/downtime/(int: downtime_id)
Edit a downtime block.
- Parameters:
downtime_id – the ID of the downtime block
- Status Codes:
404 Not Found – if the downtime ID is invalid
- Reqjson:
a (partial) Downtime object
- Returns:
the entire modified downtime block
- DELETE /api/downtime/(int: downtime_id)
Delete a downtime block.
- Parameters:
downtime_id – the ID of the downtime block
- Status Codes:
404 Not Found – if the downtime ID is invalid
204 No Content – on success
- GET /api/downtime/categories
Get all user-defined downtime categories.
- Returns:
an object mapping category ID to category object
- PUT /api/downtime/categories
Create a new downtime category.
- Status Codes:
201 Created – if the creation is successful
400 Bad Request – if the
name
field is missing
- Returns:
the new category object
- PATCH /api/downtime/categories/(int: category_id)
Edit an existing downtime category.
- Status Codes:
404 Not Found – if the category does not exist
- DELETE /api/downtime/categories/(int: category_id)
Delete an existing downtime category.
- Status Codes:
404 Not Found – if the category does not exist
204 No Content – on success