maintenance_windows
Creates, updates, deletes, gets or lists a maintenance_windows
resource.
Overview
Name | maintenance_windows |
Type | Resource |
Id | azure.sql.maintenance_windows |
Fields
- vw_maintenance_windows
- maintenance_windows
Name | Datatype | Description |
---|---|---|
databaseName | text | field from the properties object |
maintenanceWindowName | text | field from the properties object |
resourceGroupName | text | field from the properties object |
serverName | text | field from the properties object |
subscriptionId | text | field from the properties object |
time_ranges | text | field from the properties object |
Name | Datatype | Description |
---|---|---|
properties | object | Maintenance windows resource properties. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | databaseName, maintenanceWindowName, resourceGroupName, serverName, subscriptionId | Gets maintenance windows settings for a database. |
create_or_update | INSERT | databaseName, maintenanceWindowName, resourceGroupName, serverName, subscriptionId | Sets maintenance windows settings for a database. |
SELECT
examples
Gets maintenance windows settings for a database.
- vw_maintenance_windows
- maintenance_windows
SELECT
databaseName,
maintenanceWindowName,
resourceGroupName,
serverName,
subscriptionId,
time_ranges
FROM azure.sql.vw_maintenance_windows
WHERE databaseName = '{{ databaseName }}'
AND maintenanceWindowName = '{{ maintenanceWindowName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
SELECT
properties
FROM azure.sql.maintenance_windows
WHERE databaseName = '{{ databaseName }}'
AND maintenanceWindowName = '{{ maintenanceWindowName }}'
AND resourceGroupName = '{{ resourceGroupName }}'
AND serverName = '{{ serverName }}'
AND subscriptionId = '{{ subscriptionId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new maintenance_windows
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO azure.sql.maintenance_windows (
databaseName,
maintenanceWindowName,
resourceGroupName,
serverName,
subscriptionId,
properties
)
SELECT
'{{ databaseName }}',
'{{ maintenanceWindowName }}',
'{{ resourceGroupName }}',
'{{ serverName }}',
'{{ subscriptionId }}',
'{{ properties }}'
;
- name: your_resource_model_name
props:
- name: properties
value:
- name: timeRanges
value:
- - name: dayOfWeek
value: string
- name: startTime
value: string
- name: duration
value: string