From 84547b9dc3c5f07e6499c51d49ed0d24b21c8b4f Mon Sep 17 00:00:00 2001 From: Thalia Wang <58485997+wenxuan0923@users.noreply.github.com> Date: Wed, 2 Nov 2022 18:25:05 -0700 Subject: [PATCH] Add MaintenanceWindow into MaintenanceConfigurationProperties (#21337) * Add MaintenanceWindow into MaintenanceConfigurationProperties * Fx PrettierCheck --- ...ationsCreate_Update_MaintenanceWindow.json | 77 ++++++ ...onfigurationsDelete_MaintenanceWindow.json | 13 + ...ceConfigurationsGet_MaintenanceWindow.json | 48 ++++ ...eConfigurationsList_MaintenanceWindow.json | 61 +++++ .../2022-10-02-preview/managedClusters.json | 223 ++++++++++++++++++ 5 files changed, 422 insertions(+) create mode 100644 specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json create mode 100644 specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json create mode 100644 specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json create mode 100644 specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json new file mode 100644 index 000000000000..0163da82b36b --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json @@ -0,0 +1,77 @@ +{ + "parameters": { + "api-version": "2022-10-02-preview", + "subscriptionId": "subid1", + "resourceGroupName": "rg1", + "resourceName": "clustername1", + "configName": "aksManagedAutoUpgradeSchedule", + "parameters": { + "properties": { + "maintenanceWindow": { + "schedule": { + "relativeMonthly": { + "intervalMonths": 3, + "weekIndex": "First", + "dayOfWeek": "Monday" + } + }, + "durationHours": 10, + "utcOffset": "+05:30", + "startDate": "2023-01-01", + "startTime": "08:30", + "notAllowedDates": [ + { + "start": "2023-02-18", + "end": "2023-02-25" + }, + { + "start": "2023-12-23", + "end": "2024-01-05" + } + ] + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default", + "type": "Microsoft.ContainerService/managedClusters/maintenanceConfigurations", + "name": "aksManagedAutoUpgradeSchedule", + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" + }, + "properties": { + "maintenanceWindow": { + "schedule": { + "weekly": { + "intervalWeeks": 3, + "dayOfWeek": "Monday" + } + }, + "durationHours": 10, + "utcOffset": "+05:30", + "startDate": "2023-01-01", + "startTime": "08:30", + "notAllowedDates": [ + { + "start": "2023-02-18", + "end": "2023-02-25" + }, + { + "start": "2023-12-23", + "end": "2024-01-05" + } + ] + } + } + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json new file mode 100644 index 000000000000..a666c27116f4 --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "api-version": "2022-10-02-preview", + "subscriptionId": "subid1", + "resourceGroupName": "rg1", + "resourceName": "clustername1", + "configName": "aksManagedNodeOSUpgradeSchedule" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json new file mode 100644 index 000000000000..7aa8d9a58d16 --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json @@ -0,0 +1,48 @@ +{ + "parameters": { + "api-version": "2022-10-02-preview", + "subscriptionId": "subid1", + "resourceGroupName": "rg1", + "resourceName": "clustername1", + "configName": "aksManagedNodeOSUpgradeSchedule" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default", + "name": "aksManagedNodeOSUpgradeSchedule", + "systemData": { + "createdBy": "user1", + "createdByType": "User", + "createdAt": "2020-01-01T17:18:19.1234567Z", + "lastModifiedBy": "user2", + "lastModifiedByType": "User", + "lastModifiedAt": "2020-01-02T17:18:19.1234567Z" + }, + "properties": { + "maintenanceWindow": { + "schedule": { + "daily": { + "intervalDays": 3 + } + }, + "durationHours": 4, + "utcOffset": "-07:00", + "startDate": "2023-01-01", + "startTime": "09:30", + "notAllowedDates": [ + { + "start": "2023-02-18", + "end": "2023-02-25" + }, + { + "start": "2023-12-23", + "end": "2024-01-05" + } + ] + } + } + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json new file mode 100644 index 000000000000..78781cf50c97 --- /dev/null +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2022-10-02-preview", + "subscriptionId": "subid1", + "resourceGroupName": "rg1", + "resourceName": "clustername1" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default", + "name": "aksManagedNodeOSUpgradeSchedule", + "properties": { + "maintenanceWindow": { + "schedule": { + "daily": { + "intervalDays": 5 + } + }, + "durationHours": 10, + "utcOffset": "-07:00", + "startDate": "2023-01-01", + "startTime": "13:30" + } + } + }, + { + "id": "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/maintenanceConfigurations/default", + "name": "aksManagedAutoUpgradeSchedule", + "properties": { + "maintenanceWindow": { + "schedule": { + "absoluteMonthly": { + "intervalMonths": 3, + "dayOfMonth": 15 + } + }, + "durationHours": 5, + "utcOffset": "+00:00", + "startDate": "2023-01-01", + "startTime": "08:30", + "notAllowedDates": [ + { + "start": "2023-02-18", + "end": "2023-02-25" + }, + { + "start": "2023-12-23", + "end": "2024-01-05" + } + ] + } + } + } + ] + } + } + } +} diff --git a/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/managedClusters.json b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/managedClusters.json index a7e14c913254..fa4463e3285b 100644 --- a/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/managedClusters.json +++ b/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-10-02-preview/managedClusters.json @@ -738,6 +738,9 @@ "x-ms-examples": { "List maintenance configurations by Managed Cluster": { "$ref": "./examples/MaintenanceConfigurationsList.json" + }, + "List maintenance configurations configured with maintenance window by Managed Cluster": { + "$ref": "./examples/MaintenanceConfigurationsList_MaintenanceWindow.json" } } } @@ -787,6 +790,9 @@ "x-ms-examples": { "Get Maintenance Configuration": { "$ref": "./examples/MaintenanceConfigurationsGet.json" + }, + "Get Maintenance Configuration Configured With Maintenance Window": { + "$ref": "./examples/MaintenanceConfigurationsGet_MaintenanceWindow.json" } } }, @@ -844,6 +850,9 @@ "x-ms-examples": { "Create/Update Maintenance Configuration": { "$ref": "./examples/MaintenanceConfigurationsCreate_Update.json" + }, + "Create/Update Maintenance Configuration with Maintenance Window": { + "$ref": "./examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json" } } }, @@ -892,6 +901,9 @@ "x-ms-examples": { "Delete Maintenance Configuration": { "$ref": "./examples/MaintenanceConfigurationsDelete.json" + }, + "Delete Maintenance Configuration For Node OS Upgrade": { + "$ref": "./examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json" } } } @@ -4088,10 +4100,221 @@ }, "x-ms-identifiers": [], "description": "Time slots on which upgrade is not allowed." + }, + "maintenanceWindow": { + "type": "object", + "$ref": "#/definitions/MaintenanceWindow", + "description": "Maintenance window for the maintenance configuration." } }, "description": "Properties used to configure planned maintenance for a Managed Cluster." }, + "MaintenanceWindow": { + "type": "object", + "properties": { + "schedule": { + "$ref": "#/definitions/Schedule", + "description": "Recurrence schedule for the maintenance window." + }, + "durationHours": { + "type": "integer", + "format": "int32", + "minimum": 4, + "maximum": 24, + "default": 24, + "description": "Length of maintenance window range from 4 to 24 hours." + }, + "utcOffset": { + "type": "string", + "pattern": "^(-|\\+)[0-9]{2}:[0-9]{2}$", + "description": "The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not specified, the default is '+00:00'." + }, + "startDate": { + "type": "string", + "format": "date", + "description": "The date the maintenance window activates. If the current date is before this date, the maintenance window is inactive and will not be used for upgrades. If not specified, the maintenance window will be active right away." + }, + "startTime": { + "type": "string", + "pattern": "^\\d{2}:\\d{2}$", + "description": "The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time '00:00'." + }, + "notAllowedDates": { + "type": "array", + "items": { + "$ref": "#/definitions/DateSpan" + }, + "x-ms-identifiers": [], + "description": "Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time." + } + }, + "description": "Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster.", + "required": [ + "schedule", + "durationHours", + "startTime" + ] + }, + "Schedule": { + "type": "object", + "properties": { + "daily": { + "$ref": "#/definitions/DailySchedule" + }, + "weekly": { + "$ref": "#/definitions/WeeklySchedule" + }, + "absoluteMonthly": { + "$ref": "#/definitions/AbsoluteMonthlySchedule" + }, + "relativeMonthly": { + "$ref": "#/definitions/RelativeMonthlySchedule" + } + }, + "description": "One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule." + }, + "DailySchedule": { + "type": "object", + "properties": { + "intervalDays": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 7, + "description": "Specifies the number of days between each set of occurrences." + } + }, + "description": "For schedules like: 'recur every day' or 'recur every 3 days'.", + "required": [ + "intervalDays" + ] + }, + "WeeklySchedule": { + "type": "object", + "properties": { + "intervalWeeks": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 4, + "description": "Specifies the number of weeks between each set of occurrences." + }, + "dayOfWeek": { + "$ref": "#/definitions/WeekDay", + "description": "Specifies on which day of the week the maintenance occurs." + } + }, + "description": "For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'.", + "required": [ + "intervalWeeks", + "dayOfWeek" + ] + }, + "AbsoluteMonthlySchedule": { + "type": "object", + "properties": { + "intervalMonths": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 6, + "description": "Specifies the number of months between each set of occurrences." + }, + "dayOfMonth": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 31, + "description": "The date of the month." + } + }, + "description": "For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'.", + "required": [ + "intervalMonths", + "dayOfMonth" + ] + }, + "RelativeMonthlySchedule": { + "type": "object", + "properties": { + "intervalMonths": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 6, + "description": "Specifies the number of months between each set of occurrences." + }, + "weekIndex": { + "type": "string", + "enum": [ + "First", + "Second", + "Third", + "Fourth", + "Last" + ], + "x-ms-enum": { + "name": "type", + "modelAsString": true, + "values": [ + { + "value": "First", + "description": "First." + }, + { + "value": "Second", + "description": "Second." + }, + { + "value": "Third", + "description": "Third." + }, + { + "value": "Fourth", + "description": "Fourth." + }, + { + "value": "Last", + "description": "Last." + } + ] + }, + "title": "The week index.", + "description": "Specifies on which instance of the allowed days specified in daysOfWeek the maintenance occurs." + }, + "dayOfWeek": { + "$ref": "#/definitions/WeekDay", + "description": "Specifies on which day of the week the maintenance occurs." + } + }, + "description": "For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last Friday'.", + "required": [ + "intervalMonths", + "weekIndex", + "dayOfWeek" + ] + }, + "DateSpan": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date", + "description": "The start date of the date span." + }, + "end": { + "type": "string", + "format": "date", + "description": "The end date of the date span." + } + }, + "title": "A date range.", + "description": "For example, between '2022-12-23' and '2023-01-05'.", + "required": [ + "start", + "end" + ] + }, "TimeInWeek": { "type": "object", "properties": {