Skip to content

stop_canary async

stop_canary(
    name: CanaryName, *, config_overrides: Optional[AsyncsyntheticsClientConfig] = None
) -> StopCanaryResponse

Stops the canary to prevent all future runs. If the canary is currently running,the run that is in progress completes on its own, publishes metrics, and uploads artifacts, but it is not recorded in Synthetics as a completed run.

You can use StartCanary to start it running again with the canary’s current schedule at any point in the future.

Parameters:

  • name (CanaryName) –

    The name of the canary that you want to stop. To find the names of your canaries, use ListCanaries.

Raises:

Source code in docs_src/capo_synthetics/_services/async_synthetics.py
async def stop_canary(
    self,
    name: "capo_synthetics.types.canary_name.CanaryName",
    *,
    config_overrides: Optional[AsyncsyntheticsClientConfig] = None,
) -> "capo_synthetics.types.stop_canary_response.StopCanaryResponse":
    """<p>Stops the canary to prevent all future runs. If the canary is currently running,the run that is in progress completes on its own, publishes metrics, and uploads artifacts, but it is not recorded in Synthetics as a completed run.</p> <p>You can use <code>StartCanary</code> to start it running again with the canary’s current schedule at any point in the future. </p>

    Args:
        name: <p>The name of the canary that you want to stop. To find the names of your canaries, use <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html">ListCanaries</a>.</p>

    Raises:
        capo_synthetics.errors.conflict_exception.ConflictException: <p>A conflicting operation is already in progress.</p>
        capo_synthetics.errors.internal_server_exception.InternalServerException: <p>An unknown internal error occurred.</p>
        capo_synthetics.errors.resource_not_found_exception.ResourceNotFoundException: <p>One of the specified resources was not found.</p>
        capo_synthetics.errors.validation_exception.ValidationException: <p>A parameter could not be validated.</p>
        capo_synthetics.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_synthetics.types.stop_canary_request.StopCanaryRequest]",
    ) -> AsyncOperationResponse[
        "capo_synthetics.types.stop_canary_response.StopCanaryResponse"
    ]:
        import capo_synthetics._operations.synthetics.stop_canary

        (
            output,
            http_response,
        ) = await capo_synthetics._operations.synthetics.stop_canary.async_stop_canary(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopCanary")
    )
    input_: capo_synthetics.types.stop_canary_request.StopCanaryRequest = {
        "name": name
    }

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