Skip to content

remove_auto_scaling_policy

remove_auto_scaling_policy(
    *,
    config_overrides: Optional[EMRClientConfig] = None,
    cluster_id: Optional[ClusterId] = None,
    instance_group_id: Optional[InstanceGroupId] = None,
) -> RemoveAutoScalingPolicyOutput

Removes an automatic scaling policy from a specified instance group within an Amazon EMR cluster.

Parameters:

  • cluster_id (Optional[ClusterId], default: None ) –

    Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.

  • instance_group_id (Optional[InstanceGroupId], default: None ) –

    Specifies the ID of the instance group to which the scaling policy is applied.

Raises:

Source code in docs_src/capo_emr/_services/emr.py
def remove_auto_scaling_policy(
    self,
    *,
    config_overrides: Optional[EMRClientConfig] = None,
    cluster_id: Optional["capo_emr.types.cluster_id.ClusterId"] = None,
    instance_group_id: Optional[
        "capo_emr.types.instance_group_id.InstanceGroupId"
    ] = None,
) -> (
    "capo_emr.types.remove_auto_scaling_policy_output.RemoveAutoScalingPolicyOutput"
):
    """<p>Removes an automatic scaling policy from a specified instance group within an Amazon EMR cluster.</p>

    Args:
        cluster_id: <p>Specifies the ID of a cluster. The instance group to which the automatic scaling policy is applied is within this cluster.</p>
        instance_group_id: <p>Specifies the ID of the instance group to which the scaling policy is applied.</p>

    Raises:
        capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_emr.types.remove_auto_scaling_policy_input.RemoveAutoScalingPolicyInput]",
    ) -> OperationResponse[
        "capo_emr.types.remove_auto_scaling_policy_output.RemoveAutoScalingPolicyOutput"
    ]:
        import capo_emr._operations.elastic_map_reduce.remove_auto_scaling_policy

        output, http_response = (
            capo_emr._operations.elastic_map_reduce.remove_auto_scaling_policy.remove_auto_scaling_policy(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RemoveAutoScalingPolicy")
    )
    input_: capo_emr.types.remove_auto_scaling_policy_input.RemoveAutoScalingPolicyInput = {}
    if cluster_id is not None:
        input_["cluster_id"] = cluster_id
    if instance_group_id is not None:
        input_["instance_group_id"] = instance_group_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output