maintenance_events
Creates, updates, deletes, gets or lists a maintenance_events resource.
Overview
| Name | maintenance_events |
| Type | Resource |
| Id | azure.postgresql_flexible_servers.maintenance_events |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
deferrable | boolean | A value indicating whether this maintenance event can be rescheduled by the customer. Required. |
deferralDeadline | string (date-time) | The latest date/time this maintenance event can be postponed to (UTC). Present only when deferrable is true. |
description | string | The human-readable description of the maintenance event. |
endTime | string (date-time) | The scheduled end time of the maintenance event (UTC). Required. |
estimatedDowntime | string | The estimated downtime as an ISO 8601 duration string (e.g., 'PT60S' = 60 seconds). |
lastUpdatedTime | string (date-time) | The time this maintenance event record was last updated (UTC). |
maintenanceEventId | string | A service-generated identifier for this maintenance event, assigned by the platform (e.g., 'YL1T-HFG'). The format is not contractual and clients should not attempt to parse or construct this value. |
maintenanceType | string | The maintenance type (e.g., 'PlannedMaintenance'). Required. "PlannedMaintenance" (PlannedMaintenance) |
originalStartTime | string (date-time) | The initial scheduled start time before any reschedule (UTC). Equals startTime when the event has never been rescheduled. Required. |
rescheduledFrom | string (date-time) | The previous scheduled start time before the most recent reschedule (UTC). Null if the event has never been rescheduled. |
startTime | string (date-time) | The scheduled start time of the maintenance event (UTC). Required. |
status | string | The customer-facing status of the maintenance event. Required. Known values are: "Planned", "InProgress", "Complete", "Rescheduled", and "Canceled". (Planned, InProgress, Complete, Rescheduled, Canceled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
deferrable | boolean | A value indicating whether this maintenance event can be rescheduled by the customer. Required. |
deferralDeadline | string (date-time) | The latest date/time this maintenance event can be postponed to (UTC). Present only when deferrable is true. |
description | string | The human-readable description of the maintenance event. |
endTime | string (date-time) | The scheduled end time of the maintenance event (UTC). Required. |
estimatedDowntime | string | The estimated downtime as an ISO 8601 duration string (e.g., 'PT60S' = 60 seconds). |
lastUpdatedTime | string (date-time) | The time this maintenance event record was last updated (UTC). |
maintenanceEventId | string | A service-generated identifier for this maintenance event, assigned by the platform (e.g., 'YL1T-HFG'). The format is not contractual and clients should not attempt to parse or construct this value. |
maintenanceType | string | The maintenance type (e.g., 'PlannedMaintenance'). Required. "PlannedMaintenance" (PlannedMaintenance) |
originalStartTime | string (date-time) | The initial scheduled start time before any reschedule (UTC). Equals startTime when the event has never been rescheduled. Required. |
rescheduledFrom | string (date-time) | The previous scheduled start time before the most recent reschedule (UTC). Null if the event has never been rescheduled. |
startTime | string (date-time) | The scheduled start time of the maintenance event (UTC). Required. |
status | string | The customer-facing status of the maintenance event. Required. Known values are: "Planned", "InProgress", "Complete", "Rescheduled", and "Canceled". (Planned, InProgress, Complete, Rescheduled, Canceled) |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, server_name, maintenance_event_id, subscription_id | Gets information about a maintenance event for a flexible server. | |
list | select | resource_group_name, server_name, subscription_id | maintenanceStatus | Lists all maintenance events for a flexible server. |
reschedule | exec | resource_group_name, server_name, maintenance_event_id, subscription_id, postponeToDateTime | Reschedules a maintenance event to a new date and time. | |
apply_now | exec | resource_group_name, server_name, maintenance_event_id, subscription_id | Applies the maintenance event immediately. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
maintenance_event_id | string | The name of the MaintenanceEventResource. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
server_name | string | The name of the server. Required. |
subscription_id | string | |
maintenanceStatus | string | Filter maintenance events by status. Known values are: "Upcoming" and "Past". Default value is None. |
SELECT examples
- get
- list
Gets information about a maintenance event for a flexible server.
SELECT
id,
name,
deferrable,
deferralDeadline,
description,
endTime,
estimatedDowntime,
lastUpdatedTime,
maintenanceEventId,
maintenanceType,
originalStartTime,
rescheduledFrom,
startTime,
status,
systemData,
type
FROM azure.postgresql_flexible_servers.maintenance_events
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND maintenance_event_id = '{{ maintenance_event_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Lists all maintenance events for a flexible server.
SELECT
id,
name,
deferrable,
deferralDeadline,
description,
endTime,
estimatedDowntime,
lastUpdatedTime,
maintenanceEventId,
maintenanceType,
originalStartTime,
rescheduledFrom,
startTime,
status,
systemData,
type
FROM azure.postgresql_flexible_servers.maintenance_events
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND server_name = '{{ server_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND maintenanceStatus = '{{ maintenanceStatus }}'
;
Lifecycle Methods
- reschedule
- apply_now
Reschedules a maintenance event to a new date and time.
EXEC azure.postgresql_flexible_servers.maintenance_events.reschedule
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@maintenance_event_id='{{ maintenance_event_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"postponeToDateTime": "{{ postponeToDateTime }}"
}'
;
Applies the maintenance event immediately.
EXEC azure.postgresql_flexible_servers.maintenance_events.apply_now
@resource_group_name='{{ resource_group_name }}' --required,
@server_name='{{ server_name }}' --required,
@maintenance_event_id='{{ maintenance_event_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;