Maintenance Window Options - Get
Gets a list of available maintenance windows.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current?maintenanceWindowOptionsName={maintenanceWindowOptionsName}&api-version=2023-08-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
database
|
path | True |
string |
The name of the database to get maintenance windows options for. |
|
resource
|
path | True |
string |
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
|
server
|
path | True |
string |
The name of the server. |
|
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
|
api-version
|
query | True |
string |
The API version to use for the request. |
|
maintenance
|
query | True |
string |
Maintenance window options name. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Successfully retrieved the list of maintenance windows options. |
|
| Other Status Codes |
*** Error Responses: *** |
Examples
Gets a list of available maintenance windows for a selected database.
Sample request
Sample response
{
"properties": {
"isEnabled": true,
"maintenanceWindowCycles": [
{
"dayOfWeek": "Saturday",
"startTime": "00:00:00",
"duration": "PT60M"
}
],
"minDurationInMinutes": 60,
"defaultDurationInMinutes": 120,
"minCycles": 2,
"timeGranularityInMinutes": 5,
"allowMultipleMaintenanceWindowsPerCycle": true
},
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/maintenancewindowoptions/current",
"name": "current",
"type": "Microsoft.Sql/servers/databases/maintenancewindows"
}
Definitions
| Name | Description |
|---|---|
|
Day |
Day of maintenance window. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Maintenance |
Maintenance window options. |
|
Maintenance |
Maintenance window time range. |
DayOfWeek
Day of maintenance window.
| Value | Description |
|---|---|
| Sunday | |
| Monday | |
| Tuesday | |
| Wednesday | |
| Thursday | |
| Friday | |
| Saturday |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
MaintenanceWindowOptions
Maintenance window options.
| Name | Type | Description |
|---|---|---|
| id |
string |
Resource ID. |
| name |
string |
Resource name. |
| properties.allowMultipleMaintenanceWindowsPerCycle |
boolean |
Whether we allow multiple maintenance windows per cycle. |
| properties.defaultDurationInMinutes |
integer (int32) |
Default duration for maintenance window. |
| properties.isEnabled |
boolean |
Whether maintenance windows are enabled for the database. |
| properties.maintenanceWindowCycles |
Available maintenance cycles e.g. {Saturday, 0, 4860}, {Wednesday, 0, 2460}. |
|
| properties.minCycles |
integer (int32) |
Minimum number of maintenance windows cycles to be set on the database. |
| properties.minDurationInMinutes |
integer (int32) |
Minimum duration of maintenance window. |
| properties.timeGranularityInMinutes |
integer (int32) |
Time granularity in minutes for maintenance windows. |
| type |
string |
Resource type. |
MaintenanceWindowTimeRange
Maintenance window time range.
| Name | Type | Description |
|---|---|---|
| dayOfWeek |
Day of maintenance window. |
|
| duration |
string |
Duration of maintenance window in minutes. |
| startTime |
string |
Start time minutes offset from 12am. |