modifyClusterMaintenance method
Modifies the maintenance settings of a cluster.
May throw ClusterNotFoundFault. May throw InvalidClusterStateFault.
Parameter clusterIdentifier
:
A unique identifier for the cluster.
Parameter deferMaintenance
:
A boolean indicating whether to enable the deferred maintenance window.
Parameter deferMaintenanceDuration
:
An integer indicating the duration of the maintenance window in days. If
you specify a duration, you can't specify an end time. The duration must
be 45 days or less.
Parameter deferMaintenanceEndTime
:
A timestamp indicating end time for the deferred maintenance window. If
you specify an end time, you can't specify a duration.
Parameter deferMaintenanceIdentifier
:
A unique identifier for the deferred maintenance window.
Parameter deferMaintenanceStartTime
:
A timestamp indicating the start time for the deferred maintenance window.
Implementation
Future<ModifyClusterMaintenanceResult> modifyClusterMaintenance({
required String clusterIdentifier,
bool? deferMaintenance,
int? deferMaintenanceDuration,
DateTime? deferMaintenanceEndTime,
String? deferMaintenanceIdentifier,
DateTime? deferMaintenanceStartTime,
}) async {
ArgumentError.checkNotNull(clusterIdentifier, 'clusterIdentifier');
_s.validateStringLength(
'clusterIdentifier',
clusterIdentifier,
0,
2147483647,
isRequired: true,
);
_s.validateStringLength(
'deferMaintenanceIdentifier',
deferMaintenanceIdentifier,
0,
2147483647,
);
final $request = <String, dynamic>{};
$request['ClusterIdentifier'] = clusterIdentifier;
deferMaintenance?.also((arg) => $request['DeferMaintenance'] = arg);
deferMaintenanceDuration
?.also((arg) => $request['DeferMaintenanceDuration'] = arg);
deferMaintenanceEndTime?.also(
(arg) => $request['DeferMaintenanceEndTime'] = _s.iso8601ToJson(arg));
deferMaintenanceIdentifier
?.also((arg) => $request['DeferMaintenanceIdentifier'] = arg);
deferMaintenanceStartTime?.also(
(arg) => $request['DeferMaintenanceStartTime'] = _s.iso8601ToJson(arg));
final $result = await _protocol.send(
$request,
action: 'ModifyClusterMaintenance',
version: '2012-12-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['ModifyClusterMaintenanceMessage'],
shapes: shapes,
resultWrapper: 'ModifyClusterMaintenanceResult',
);
return ModifyClusterMaintenanceResult.fromXml($result);
}