Maintenance
Schedule planned downtime in advance.
Schedule Maintenance
Create a planned maintenance event.
HTTP Method & URL: POST /api/admin/Incident
Authorization: Requires X-API-KEY
Request
- Headers
- Payload
- cURL
| Name | Value | Required | Description |
|---|---|---|---|
X-API-KEY | string | Yes | Your unique API key. |
Content-Type | application/json | Yes | Sending JSON data. |
Body: IncidentCreateModel (with Type: "Maintenance")
{
"Title": "Scheduled Database Maintenance",
"Type": "Maintenance",
"Description": "We will be performing routine database optimizations.",
"StartDate": "2023-11-01T02:00:00Z",
"EndDate": "2023-11-01T04:00:00Z",
"AffectedComponents": ["3fa85f64-5717-4562-b3fc-2c963f66afa0"]
}
curl -X POST "https://stg.itechops.com/api/admin/Incident" \
-H "X-API-KEY: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"Title": "Scheduled Database Maintenance",
"Type": "Maintenance",
"Description": "We will be performing routine database optimizations.",
"StartDate": "2023-11-01T02:00:00Z",
"EndDate": "2023-11-01T04:00:00Z",
"AffectedComponents": ["3fa85f64-5717-4562-b3fc-2c963f66afa0"]
}'
Responses
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 500 Server Error
Description: Success. Returns the Maintenance ID.
Response Body: ApiResponse<Guid>
{
"Success": true,
"Result": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"Message": "Maintenance scheduled"
}
Description: Invalid schedule.
{
"Success": false,
"Result": null,
"Message": "End date must be after start date."
}
Description: Authentication failed.
{
"Success": false,
"Result": null,
"Message": "Invalid or missing API key."
}
Description: Internal server error.
{
"Success": false,
"Result": null,
"Message": "An unexpected error occurred."
}
Get Ongoing Maintenance
Retrieve currently active maintenance windows.
HTTP Method & URL: GET /api/maintenance/status
Request
- cURL
curl -X GET "https://stg.itechops.com/api/maintenance/status"
Responses
- 200 OK
- 401 Unauthorized
- 500 Server Error
Description: Success. Returns a list of active maintenance windows.
[
{
"IncidentId": "3fa85f64-5717-4562-b3fc-2c963f66afa9",
"Title": "Scheduled Database Maintenance",
"Status": "In Progress",
"StartDate": "2023-11-01T02:00:00Z"
}
]
Description: Authentication failed.
{
"Success": false,
"Result": null,
"Message": "Invalid or missing API key."
}
Description: Internal server error.
{
"Success": false,
"Result": null,
"Message": "An unexpected error occurred."
}