ModifyInstanceGroups modifies the number of nodes and configuration settings of an instance group. The input parameters include the new target instance count for the group and the instance group ID. The call will either succeed or fail atomically.
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/emr.py
| def modify_instance_groups(
self,
*,
config_overrides: Optional[EMRClientConfig] = None,
cluster_id: Optional["capo_emr.types.cluster_id.ClusterId"] = None,
instance_groups: Optional[
"capo_emr.types.instance_group_modify_config_list.InstanceGroupModifyConfigList"
] = None,
) -> None:
"""<p>ModifyInstanceGroups modifies the number of nodes and configuration settings of an instance group. The input parameters include the new target instance count for the group and the instance group ID. The call will either succeed or fail atomically.</p>
Args:
cluster_id: <p>The ID of the cluster to which the instance group belongs.</p>
instance_groups: <p>Instance groups to change.</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.
"""
def _handler(
req: "OperationRequest[capo_emr.types.modify_instance_groups_input.ModifyInstanceGroupsInput]",
) -> OperationResponse[None]:
import capo_emr._operations.elastic_map_reduce.modify_instance_groups
output, http_response = (
capo_emr._operations.elastic_map_reduce.modify_instance_groups.modify_instance_groups(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ModifyInstanceGroups")
)
input_: capo_emr.types.modify_instance_groups_input.ModifyInstanceGroupsInput = {}
if cluster_id is not None:
input_["cluster_id"] = cluster_id
if instance_groups is not None:
input_["instance_groups"] = instance_groups
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|