Maintenance API
Endpoints for managing scheduled maintenance.
List Maintenance
GET /api/v1/maintenance
Query Parameters
| Parameter | Description |
|---|---|
statusPageId | Filter by status page |
status | Filter by status |
upcoming | Only future maintenance |
Response
{
"data": [
{
"id": 1,
"title": "Database Upgrade",
"description": "Upgrading database to latest version",
"status": "scheduled",
"statusPageId": 1,
"scheduledStartTime": "2024-01-20T02:00:00Z",
"scheduledEndTime": "2024-01-20T04:00:00Z",
"autoStart": true,
"affectedComponents": [...]
}
]
}Get Maintenance
GET /api/v1/maintenance/:id
Create Maintenance
POST /api/v1/maintenance
Request Body
{
"title": "Scheduled Maintenance",
"description": "Description of the maintenance work",
"statusPageId": 1,
"scheduledStartTime": "2024-01-20T02:00:00Z",
"scheduledEndTime": "2024-01-20T04:00:00Z",
"autoStart": true,
"componentIds": [1, 2]
}Valid Statuses
scheduledin_progresscompletedcancelled
Update Maintenance
PATCH /api/v1/maintenance/:id
Request Body
{
"title": "Updated Title",
"scheduledEndTime": "2024-01-20T05:00:00Z"
}Start Maintenance
POST /api/v1/maintenance/:id/start
Manually starts the maintenance (changes status to in_progress).
Complete Maintenance
POST /api/v1/maintenance/:id/complete
Request Body
{
"message": "Maintenance completed successfully."
}Cancel Maintenance
POST /api/v1/maintenance/:id/cancel
Request Body
{
"message": "Maintenance has been postponed."
}Delete Maintenance
DELETE /api/v1/maintenance/:id
