Skip to content

stop_human_loop async

stop_human_loop(
    *,
    config_overrides: Optional[AsyncSageMakerA2IRuntimeClientConfig] = None,
    human_loop_name: Optional[HumanLoopName] = None,
) -> StopHumanLoopResponse

Stops the specified human loop.

Parameters:

  • human_loop_name (Optional[HumanLoopName], default: None ) –

    The name of the human loop that you want to stop.

Raises:

  • InternalServerException –

    We couldn't process your request because of an issue with the server. Try again later.

  • ResourceNotFoundException –

    We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.

  • ThrottlingException –

    You exceeded the maximum number of requests.

  • ValidationException –

    The request isn't valid. Check the syntax and try again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker_a2i_runtime/_services/async_sage_maker_a2_i_runtime.py
async def stop_human_loop(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerA2IRuntimeClientConfig] = None,
    human_loop_name: Optional[
        "capo_sagemaker_a2i_runtime.types.human_loop_name.HumanLoopName"
    ] = None,
) -> "capo_sagemaker_a2i_runtime.types.stop_human_loop_response.StopHumanLoopResponse":
    """<p>Stops the specified human loop.</p>

    Args:
        human_loop_name: <p>The name of the human loop that you want to stop.</p>

    Raises:
        capo_sagemaker_a2i_runtime.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_sagemaker_a2i_runtime.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again. </p>
        capo_sagemaker_a2i_runtime.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_sagemaker_a2i_runtime.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_sagemaker_a2i_runtime.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker_a2i_runtime.types.stop_human_loop_request.StopHumanLoopRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker_a2i_runtime.types.stop_human_loop_response.StopHumanLoopResponse"
    ]:
        import capo_sagemaker_a2i_runtime._operations.amazon_sage_maker_a2_i_runtime.stop_human_loop

        (
            output,
            http_response,
        ) = await capo_sagemaker_a2i_runtime._operations.amazon_sage_maker_a2_i_runtime.stop_human_loop.async_stop_human_loop(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopHumanLoop")
    )
    input_: capo_sagemaker_a2i_runtime.types.stop_human_loop_request.StopHumanLoopRequest = {}
    if human_loop_name is not None:
        input_["human_loop_name"] = human_loop_name

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output