setTimeBasedAutoScaling method
Future<void>
setTimeBasedAutoScaling({
- required String instanceId,
- WeeklyAutoScalingSchedule? autoScalingSchedule,
Specify the time-based auto scaling configuration for a specified instance. For more information, see Managing Load with Time-based and Load-based Instances.
Required Permissions: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions.
May throw ValidationException. May throw ResourceNotFoundException.
Parameter instanceId
:
The instance ID.
Parameter autoScalingSchedule
:
An AutoScalingSchedule
with the instance schedule.
Implementation
Future<void> setTimeBasedAutoScaling({
required String instanceId,
WeeklyAutoScalingSchedule? autoScalingSchedule,
}) async {
ArgumentError.checkNotNull(instanceId, 'instanceId');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'OpsWorks_20130218.SetTimeBasedAutoScaling'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InstanceId': instanceId,
if (autoScalingSchedule != null)
'AutoScalingSchedule': autoScalingSchedule,
},
);
}