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=2021-11-01

URI Parameters

Name In Required Type Description
databaseName
path True

string

The name of the database to get maintenance windows options for.

resourceGroupName
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.

serverName
path True

string

The name of the server.

subscriptionId
path True

string

The subscription ID that identifies an Azure subscription.

api-version
query True

string

The API version to use for the request.

maintenanceWindowOptionsName
query True

string

Maintenance window options name.

Responses

Name Type Description
200 OK

MaintenanceWindowOptions

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

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/maintenanceWindowOptions/current?maintenanceWindowOptionsName=current&api-version=2021-11-01

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
DayOfWeek

Day of maintenance window.

MaintenanceWindowOptions

Maintenance window options.

MaintenanceWindowTimeRange

Maintenance window time range.

DayOfWeek

Day of maintenance window.

Name Type Description
Friday

string

Monday

string

Saturday

string

Sunday

string

Thursday

string

Tuesday

string

Wednesday

string

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

Default duration for maintenance window.

properties.isEnabled

boolean

Whether maintenance windows are enabled for the database.

properties.maintenanceWindowCycles

MaintenanceWindowTimeRange[]

Available maintenance cycles e.g. {Saturday, 0, 4860}, {Wednesday, 0, 2460}.

properties.minCycles

integer

Minimum number of maintenance windows cycles to be set on the database.

properties.minDurationInMinutes

integer

Minimum duration of maintenance window.

properties.timeGranularityInMinutes

integer

Time granularity in minutes for maintenance windows.

type

string

Resource type.

MaintenanceWindowTimeRange

Maintenance window time range.

Name Type Description
dayOfWeek

DayOfWeek

Day of maintenance window.

duration

string

Duration of maintenance window in minutes.

startTime

string

Start time minutes offset from 12am.