Share via


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

ErrorResponse

*** 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=2023-08-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.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

MaintenanceWindowOptions

Maintenance window options.

MaintenanceWindowTimeRange

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

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

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

MaintenanceWindowTimeRange[]

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

DayOfWeek

Day of maintenance window.

duration

string

Duration of maintenance window in minutes.

startTime

string

Start time minutes offset from 12am.