MaintenanceWindow Class

  • java.lang.Object
    • com.azure.resourcemanager.containerservice.models.MaintenanceWindow

Implements

public final class MaintenanceWindow
implements JsonSerializable<MaintenanceWindow>

Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster.

Constructor Summary

Constructor Description
MaintenanceWindow()

Creates an instance of MaintenanceWindow class.

Method Summary

Modifier and Type Method and Description
int durationHours()

Get the durationHours property: Length of maintenance window range from 4 to 24 hours.

static MaintenanceWindow fromJson(JsonReader jsonReader)

Reads an instance of MaintenanceWindow from the JsonReader.

List<DateSpan> notAllowedDates()

Get the notAllowedDates property: Date ranges on which upgrade is not allowed.

Schedule schedule()

Get the schedule property: Recurrence schedule for the maintenance window.

LocalDate startDate()

Get the startDate property: The date the maintenance window activates.

String startTime()

Get the startTime property: The start time of the maintenance window.

JsonWriter toJson(JsonWriter jsonWriter)
String utcOffset()

Get the utcOffset property: The UTC offset in format +/-HH:mm.

void validate()

Validates the instance.

MaintenanceWindow withDurationHours(int durationHours)

Set the durationHours property: Length of maintenance window range from 4 to 24 hours.

MaintenanceWindow withNotAllowedDates(List<DateSpan> notAllowedDates)

Set the notAllowedDates property: Date ranges on which upgrade is not allowed.

MaintenanceWindow withSchedule(Schedule schedule)

Set the schedule property: Recurrence schedule for the maintenance window.

MaintenanceWindow withStartDate(LocalDate startDate)

Set the startDate property: The date the maintenance window activates.

MaintenanceWindow withStartTime(String startTime)

Set the startTime property: The start time of the maintenance window.

MaintenanceWindow withUtcOffset(String utcOffset)

Set the utcOffset property: The UTC offset in format +/-HH:mm.

Methods inherited from java.lang.Object

Constructor Details

MaintenanceWindow

public MaintenanceWindow()

Creates an instance of MaintenanceWindow class.

Method Details

durationHours

public int durationHours()

Get the durationHours property: Length of maintenance window range from 4 to 24 hours.

Returns:

the durationHours value.

fromJson

public static MaintenanceWindow fromJson(JsonReader jsonReader)

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:

IOException

- If the deserialized JSON object was missing any required properties.

notAllowedDates

public List 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.

schedule

public Schedule schedule()

Get the schedule property: Recurrence schedule for the maintenance window.

Returns:

the schedule value.

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.

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

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.

validate

public void validate()

Validates the instance.

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.

withNotAllowedDates

public MaintenanceWindow withNotAllowedDates(List 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.

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.

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.

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.

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.

Applies to