putManagedScalingPolicy method
Future<void>
putManagedScalingPolicy({
- required String clusterId,
- required ManagedScalingPolicy managedScalingPolicy,
Creates or updates a managed scaling policy for an Amazon EMR cluster. The managed scaling policy defines the limits for resources, such as EC2 instances that can be added or terminated from a cluster. The policy only applies to the core and task nodes. The master node cannot be scaled after initial configuration.
Parameter clusterId
:
Specifies the ID of an EMR cluster where the managed scaling policy is
attached.
Parameter managedScalingPolicy
:
Specifies the constraints for the managed scaling policy.
Implementation
Future<void> putManagedScalingPolicy({
required String clusterId,
required ManagedScalingPolicy managedScalingPolicy,
}) async {
ArgumentError.checkNotNull(clusterId, 'clusterId');
ArgumentError.checkNotNull(managedScalingPolicy, 'managedScalingPolicy');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ElasticMapReduce.PutManagedScalingPolicy'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ClusterId': clusterId,
'ManagedScalingPolicy': managedScalingPolicy,
},
);
}