Adds one or more instance groups to a running cluster.
Parameters:
Raises:
-
InternalServerError
–
Indicates that an error occurred while processing the request and that the request was not completed.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_emr/_services/async_emr.py
| async def add_instance_groups(
self,
*,
config_overrides: Optional[AsyncEMRClientConfig] = None,
instance_groups: Optional[
"capo_emr.types.instance_group_config_list.InstanceGroupConfigList"
] = None,
job_flow_id: Optional[
"capo_emr.types.xml_string_max_len256.XmlStringMaxLen256"
] = None,
) -> "capo_emr.types.add_instance_groups_output.AddInstanceGroupsOutput":
"""<p>Adds one or more instance groups to a running cluster.</p>
Args:
instance_groups: <p>Instance groups to add.</p>
job_flow_id: <p>Job flow in which to add the instance groups.</p>
Raises:
capo_emr.errors.internal_server_error.InternalServerError: <p>Indicates that an error occurred while processing the request and that the request was not completed.</p>
capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_emr.types.add_instance_groups_input.AddInstanceGroupsInput]",
) -> AsyncOperationResponse[
"capo_emr.types.add_instance_groups_output.AddInstanceGroupsOutput"
]:
import capo_emr._operations.elastic_map_reduce.add_instance_groups
(
output,
http_response,
) = await capo_emr._operations.elastic_map_reduce.add_instance_groups.async_add_instance_groups(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("AddInstanceGroups")
)
input_: capo_emr.types.add_instance_groups_input.AddInstanceGroupsInput = {}
if instance_groups is not None:
input_["instance_groups"] = instance_groups
if job_flow_id is not None:
input_["job_flow_id"] = job_flow_id
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|