> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/mariadb-cloud/reference/mariadb-cloud-api-reference-guide/maintenance-and-upgrade.md).

# Maintenance And Upgrade

Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades.

## Read Maintenance Windows

> Retrieve a list of available maintenance windows

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Maintenance and Upgrade","description":"Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades."}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"v1.MaintenanceWindow":{"type":"object","properties":{"display_name":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"}}},"errr.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/errr.ErrorDetails"}},"exception":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"path":{"type":"string"},"timestamp":{"type":"integer"},"trace_id":{"type":"string"}}},"errr.ErrorDetails":{"type":"object","properties":{"error":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/provisioning/v1/maintenance-windows":{"get":{"description":"Retrieve a list of available maintenance windows","tags":["Maintenance and Upgrade"],"summary":"Read Maintenance Windows","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/v1.MaintenanceWindow"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}}}}}}}
```

## Set Service Maintenance Window

> Set the maintenance window the service.

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Maintenance and Upgrade","description":"Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades."}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/errr.ErrorDetails"}},"exception":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"path":{"type":"string"},"timestamp":{"type":"integer"},"trace_id":{"type":"string"}}},"errr.ErrorDetails":{"type":"object","properties":{"error":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]},"v1.SetMaintenanceWindowRequest":{"type":"object","properties":{"name":{"type":"string"}}}}},"paths":{"/provisioning/v1/services/{service_id}/maintenance-window":{"post":{"description":"Set the maintenance window the service.","tags":["Maintenance and Upgrade"],"summary":"Set Service Maintenance Window","parameters":[{"schema":{"type":"string"},"description":"The ID for the service.","name":"service_id","in":"path","required":true}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.SetMaintenanceWindowRequest"}}},"description":"The request body.","required":true}}}}}
```

## List Maintenance Activities

> Retrieve the list of maintenance activities for a specific service.

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Maintenance and Upgrade","description":"Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades."}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"v1.MaintenanceActivityResponse":{"type":"object","properties":{"auto_apply_after":{"type":"string"},"classification":{"type":"string","enum":["infrastructure","security","database"]},"completed_at":{"type":"string"},"created_by":{"type":"string"},"created_on":{"type":"string"},"current_version":{"type":"string"},"deferral_count":{"type":"integer"},"deferred_until":{"type":"string"},"description":{"type":"string"},"expected_impact":{"type":"string","enum":["no_downtime","brief_downtime","extended_downtime"]},"expected_impact_description":{"type":"string"},"expected_impact_label":{"description":"ExpectedImpactLabel / ExpectedImpactDescription are the backend-owned display strings for ExpectedImpact — the UI renders them verbatim instead of mapping the enum itself.","type":"string"},"forced_apply_by":{"type":"string"},"id":{"type":"string"},"is_critical":{"type":"boolean"},"metadata":{"type":"object"},"priority":{"type":"string","enum":["recommended","required"]},"reschedule_count":{"type":"integer"},"scheduled_at":{"type":"string"},"scheduled_window":{"type":"string"},"service_id":{"type":"string"},"started_at":{"type":"string"},"state":{"type":"string","enum":["available","scheduled","deferred","in_progress","completed","failed","cancelled"]},"target_completion_date":{"type":"string"},"target_version":{"type":"string"},"updated_on":{"type":"string"}}},"errr.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/errr.ErrorDetails"}},"exception":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"path":{"type":"string"},"timestamp":{"type":"integer"},"trace_id":{"type":"string"}}},"errr.ErrorDetails":{"type":"object","properties":{"error":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/provisioning/v1/services/{service_id}/maintenance":{"get":{"description":"Retrieve the list of maintenance activities for a specific service.","tags":["Maintenance and Upgrade"],"summary":"List Maintenance Activities","parameters":[{"schema":{"type":"string"},"description":"The ID for the service.","name":"service_id","in":"path","required":true},{"schema":{"type":"boolean"},"description":"Include completed/failed/cancelled activities (default: true)","name":"include_completed","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/v1.MaintenanceActivityResponse"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}}}}}}}
```

## Apply Maintenance Activities

> Immediately execute maintenance activities for a service. If the request body contains an empty activity\_ids array, all active activities are applied. Activities are executed sequentially (infrastructure first, then security, then database). If the service is not ready, activities are rescheduled to the next maintenance window.

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Maintenance and Upgrade","description":"Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades."}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"v1.MaintenanceActivityResponse":{"type":"object","properties":{"auto_apply_after":{"type":"string"},"classification":{"type":"string","enum":["infrastructure","security","database"]},"completed_at":{"type":"string"},"created_by":{"type":"string"},"created_on":{"type":"string"},"current_version":{"type":"string"},"deferral_count":{"type":"integer"},"deferred_until":{"type":"string"},"description":{"type":"string"},"expected_impact":{"type":"string","enum":["no_downtime","brief_downtime","extended_downtime"]},"expected_impact_description":{"type":"string"},"expected_impact_label":{"description":"ExpectedImpactLabel / ExpectedImpactDescription are the backend-owned display strings for ExpectedImpact — the UI renders them verbatim instead of mapping the enum itself.","type":"string"},"forced_apply_by":{"type":"string"},"id":{"type":"string"},"is_critical":{"type":"boolean"},"metadata":{"type":"object"},"priority":{"type":"string","enum":["recommended","required"]},"reschedule_count":{"type":"integer"},"scheduled_at":{"type":"string"},"scheduled_window":{"type":"string"},"service_id":{"type":"string"},"started_at":{"type":"string"},"state":{"type":"string","enum":["available","scheduled","deferred","in_progress","completed","failed","cancelled"]},"target_completion_date":{"type":"string"},"target_version":{"type":"string"},"updated_on":{"type":"string"}}},"errr.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/errr.ErrorDetails"}},"exception":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"path":{"type":"string"},"timestamp":{"type":"integer"},"trace_id":{"type":"string"}}},"errr.ErrorDetails":{"type":"object","properties":{"error":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/provisioning/v1/services/{service_id}/maintenance/apply":{"post":{"description":"Immediately execute maintenance activities for a service. If the request body contains an empty activity_ids array, all active activities are applied. Activities are executed sequentially (infrastructure first, then security, then database). If the service is not ready, activities are rescheduled to the next maintenance window.","tags":["Maintenance and Upgrade"],"summary":"Apply Maintenance Activities","parameters":[{"schema":{"type":"string"},"description":"The ID for the service.","name":"service_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/v1.MaintenanceActivityResponse"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}},"description":"Apply request","required":true}}}}}
```

## Schedule Maintenance Activities

> Schedule maintenance activities for a service at a specific maintenance window. If the request body contains an empty activity\_ids array, all active activities are scheduled. Also serves as reschedule/defer: a previously scheduled activity can be moved to a different window. Rejected if any active activity for the service is past its forced\_apply\_by deadline.

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Maintenance and Upgrade","description":"Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades."}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"v1.MaintenanceActivityResponse":{"type":"object","properties":{"auto_apply_after":{"type":"string"},"classification":{"type":"string","enum":["infrastructure","security","database"]},"completed_at":{"type":"string"},"created_by":{"type":"string"},"created_on":{"type":"string"},"current_version":{"type":"string"},"deferral_count":{"type":"integer"},"deferred_until":{"type":"string"},"description":{"type":"string"},"expected_impact":{"type":"string","enum":["no_downtime","brief_downtime","extended_downtime"]},"expected_impact_description":{"type":"string"},"expected_impact_label":{"description":"ExpectedImpactLabel / ExpectedImpactDescription are the backend-owned display strings for ExpectedImpact — the UI renders them verbatim instead of mapping the enum itself.","type":"string"},"forced_apply_by":{"type":"string"},"id":{"type":"string"},"is_critical":{"type":"boolean"},"metadata":{"type":"object"},"priority":{"type":"string","enum":["recommended","required"]},"reschedule_count":{"type":"integer"},"scheduled_at":{"type":"string"},"scheduled_window":{"type":"string"},"service_id":{"type":"string"},"started_at":{"type":"string"},"state":{"type":"string","enum":["available","scheduled","deferred","in_progress","completed","failed","cancelled"]},"target_completion_date":{"type":"string"},"target_version":{"type":"string"},"updated_on":{"type":"string"}}},"errr.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/errr.ErrorDetails"}},"exception":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"path":{"type":"string"},"timestamp":{"type":"integer"},"trace_id":{"type":"string"}}},"errr.ErrorDetails":{"type":"object","properties":{"error":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]},"v1.ScheduleMaintenanceRequest":{"type":"object","properties":{"activity_ids":{"type":"array","items":{"type":"string"}},"name":{"type":"string"}}}}},"paths":{"/provisioning/v1/services/{service_id}/maintenance/schedule":{"post":{"description":"Schedule maintenance activities for a service at a specific maintenance window. If the request body contains an empty activity_ids array, all active activities are scheduled. Also serves as reschedule/defer: a previously scheduled activity can be moved to a different window. Rejected if any active activity for the service is past its forced_apply_by deadline.","tags":["Maintenance and Upgrade"],"summary":"Schedule Maintenance Activities","parameters":[{"schema":{"type":"string"},"description":"The ID for the service.","name":"service_id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/v1.MaintenanceActivityResponse"}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.ScheduleMaintenanceRequest"}}},"description":"Schedule request","required":true}}}}}
```

## Upgrade Database Version

> Upgrade Database Version

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Maintenance and Upgrade","description":"Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades."}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/errr.ErrorDetails"}},"exception":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"path":{"type":"string"},"timestamp":{"type":"integer"},"trace_id":{"type":"string"}}},"errr.ErrorDetails":{"type":"object","properties":{"error":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]},"v1.UpgradeDatabaseVersionRequest":{"type":"object","properties":{"version":{"type":"string"}}}}},"paths":{"/provisioning/v1/services/{service_id}/upgrade/database":{"post":{"description":"Upgrade Database Version","tags":["Maintenance and Upgrade"],"summary":"Upgrade Database Version","parameters":[{"schema":{"type":"string"},"description":"service id","name":"service_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/v1.UpgradeDatabaseVersionRequest"}}},"description":"upgrade database version request","required":true}}}}}
```

## Upgrade Kubernetes Version

> Upgrade Kubernetes Version

```json
{"openapi":"3.1.1","info":{"title":"MariaDB Cloud DBaaS API","version":"1.0"},"tags":[{"name":"Maintenance and Upgrade","description":"Manage scheduled maintenance and version upgrades for a service. View and set maintenance windows, list maintenance activities, apply or schedule (reschedule) them, and trigger database and Kubernetes version upgrades."}],"servers":[{"url":"https://api.skysql.com/"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"apiKey","name":"X-API-Key","in":"header"}},"schemas":{"errr.ErrorResponse":{"type":"object","properties":{"code":{"type":"integer"},"errors":{"type":"array","items":{"$ref":"#/components/schemas/errr.ErrorDetails"}},"exception":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"path":{"type":"string"},"timestamp":{"type":"integer"},"trace_id":{"type":"string"}}},"errr.ErrorDetails":{"type":"object","properties":{"error":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"metadata":{"type":"object","additionalProperties":true},"solution":{"type":"string"},"type":{"$ref":"#/components/schemas/errr.Type"}}},"errr.Type":{"type":"string","enum":["fatal","error","warning"]}}},"paths":{"/provisioning/v1/services/{service_id}/upgrade/kubernetes_version":{"post":{"description":"Upgrade Kubernetes Version","tags":["Maintenance and Upgrade"],"summary":"Upgrade Kubernetes Version","parameters":[{"schema":{"type":"string"},"description":"service id","name":"service_id","in":"path","required":true}],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errr.ErrorResponse"}}}}}}}}}
```
