addInstanceGroups method
Future<AddInstanceGroupsOutput>
addInstanceGroups({
- required List<
InstanceGroupConfig> instanceGroups, - required String jobFlowId,
Adds one or more instance groups to a running cluster.
May throw InternalServerError.
Parameter instanceGroups
:
Instance groups to add.
Parameter jobFlowId
:
Job flow in which to add the instance groups.
Implementation
Future<AddInstanceGroupsOutput> addInstanceGroups({
required List<InstanceGroupConfig> instanceGroups,
required String jobFlowId,
}) async {
ArgumentError.checkNotNull(instanceGroups, 'instanceGroups');
ArgumentError.checkNotNull(jobFlowId, 'jobFlowId');
_s.validateStringLength(
'jobFlowId',
jobFlowId,
0,
256,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'ElasticMapReduce.AddInstanceGroups'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InstanceGroups': instanceGroups,
'JobFlowId': jobFlowId,
},
);
return AddInstanceGroupsOutput.fromJson(jsonResponse.body);
}