Class MaintenanceWindow

java.lang.Object
com.azure.resourcemanager.containerservice.models.MaintenanceWindow
All Implemented Interfaces:
com.azure.json.JsonSerializable<MaintenanceWindow>

public final class MaintenanceWindow extends Object implements com.azure.json.JsonSerializable<MaintenanceWindow>
Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster.
  • Constructor Details

    • MaintenanceWindow

      public MaintenanceWindow()
      Creates an instance of MaintenanceWindow class.
  • Method Details

    • schedule

      public Schedule schedule()
      Get the schedule property: Recurrence schedule for the maintenance window.
      Returns:
      the schedule value.
    • withSchedule

      public MaintenanceWindow withSchedule(Schedule schedule)
      Set the schedule property: Recurrence schedule for the maintenance window.
      Parameters:
      schedule - the schedule value to set.
      Returns:
      the MaintenanceWindow object itself.
    • durationHours

      public int durationHours()
      Get the durationHours property: Length of maintenance window range from 4 to 24 hours.
      Returns:
      the durationHours value.
    • withDurationHours

      public MaintenanceWindow withDurationHours(int durationHours)
      Set the durationHours property: Length of maintenance window range from 4 to 24 hours.
      Parameters:
      durationHours - the durationHours value to set.
      Returns:
      the MaintenanceWindow object itself.
    • utcOffset

      public String utcOffset()
      Get the utcOffset property: 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'.
      Returns:
      the utcOffset value.
    • withUtcOffset

      public MaintenanceWindow withUtcOffset(String utcOffset)
      Set the utcOffset property: 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'.
      Parameters:
      utcOffset - the utcOffset value to set.
      Returns:
      the MaintenanceWindow object itself.
    • startDate

      public LocalDate startDate()
      Get the startDate property: 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.
      Returns:
      the startDate value.
    • withStartDate

      public MaintenanceWindow withStartDate(LocalDate startDate)
      Set the startDate property: 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.
      Parameters:
      startDate - the startDate value to set.
      Returns:
      the MaintenanceWindow object itself.
    • startTime

      public String startTime()
      Get the startTime property: 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'.
      Returns:
      the startTime value.
    • withStartTime

      public MaintenanceWindow withStartTime(String startTime)
      Set the startTime property: 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'.
      Parameters:
      startTime - the startTime value to set.
      Returns:
      the MaintenanceWindow object itself.
    • notAllowedDates

      public List<DateSpan> notAllowedDates()
      Get the notAllowedDates property: 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.
      Returns:
      the notAllowedDates value.
    • withNotAllowedDates

      public MaintenanceWindow withNotAllowedDates(List<DateSpan> notAllowedDates)
      Set the notAllowedDates property: 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.
      Parameters:
      notAllowedDates - the notAllowedDates value to set.
      Returns:
      the MaintenanceWindow object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<MaintenanceWindow>
      Throws:
      IOException
    • fromJson

      public static MaintenanceWindow fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of MaintenanceWindow from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of MaintenanceWindow if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the MaintenanceWindow.