updateMaintenanceStartTime method
Updates a gateway's maintenance window schedule, with settings for monthly or weekly cadence, specific day and time to begin maintenance, and which types of updates to apply. Time configuration uses the gateway's time zone. You can pass values for a complete maintenance schedule, or update policy, or both. Previous values will persist for whichever setting you choose not to modify. If an incomplete or invalid maintenance schedule is passed, the entire request will be rejected with an error and no changes will occur.
A complete maintenance schedule must include values for both
MinuteOfHour and HourOfDay, and either
DayOfMonth or DayOfWeek.
May throw InternalServerError.
May throw InvalidGatewayRequestException.
Parameter dayOfMonth :
The day of the month component of the maintenance start time represented
as an ordinal number from 1 to 28, where 1 represents the first day of the
month. It is not possible to set the maintenance schedule to start on days
29 through 31.
Parameter dayOfWeek :
The day of the week component of the maintenance start time week
represented as an ordinal number from 0 to 6, where 0 represents Sunday
and 6 represents Saturday.
Parameter hourOfDay :
The hour component of the maintenance start time represented as hh,
where hh is the hour (00 to 23). The hour of the day is in the time
zone of the gateway.
Parameter minuteOfHour :
The minute component of the maintenance start time represented as
mm, where mm is the minute (00 to 59). The minute of the
hour is in the time zone of the gateway.
Parameter softwareUpdatePreferences :
A set of variables indicating the software update preferences for the
gateway.
Includes AutomaticUpdatePolicy field with the following
inputs:
ALL_VERSIONS - Enables regular gateway maintenance updates.
EMERGENCY_VERSIONS_ONLY - Disables regular gateway
maintenance updates. The gateway will still receive emergency version
updates on rare occasions if necessary to remedy highly critical security
or durability issues. You will be notified before an emergency version
update is applied. These updates are applied during your gateway's
scheduled maintenance window.
Implementation
Future<UpdateMaintenanceStartTimeOutput> updateMaintenanceStartTime({
required String gatewayARN,
int? dayOfMonth,
int? dayOfWeek,
int? hourOfDay,
int? minuteOfHour,
SoftwareUpdatePreferences? softwareUpdatePreferences,
}) async {
_s.validateNumRange(
'dayOfMonth',
dayOfMonth,
1,
28,
);
_s.validateNumRange(
'dayOfWeek',
dayOfWeek,
0,
6,
);
_s.validateNumRange(
'hourOfDay',
hourOfDay,
0,
23,
);
_s.validateNumRange(
'minuteOfHour',
minuteOfHour,
0,
59,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StorageGateway_20130630.UpdateMaintenanceStartTime'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'GatewayARN': gatewayARN,
if (dayOfMonth != null) 'DayOfMonth': dayOfMonth,
if (dayOfWeek != null) 'DayOfWeek': dayOfWeek,
if (hourOfDay != null) 'HourOfDay': hourOfDay,
if (minuteOfHour != null) 'MinuteOfHour': minuteOfHour,
if (softwareUpdatePreferences != null)
'SoftwareUpdatePreferences': softwareUpdatePreferences,
},
);
return UpdateMaintenanceStartTimeOutput.fromJson(jsonResponse.body);
}