Skip to content

start_canary async

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

Use this operation to run a canary that has already been created. The frequency of the canary runs is determined by the value of the canary's Schedule. To see a canary's schedule, use GetCanary.

Parameters:

Raises:

Source code in docs_src/capo_synthetics/_services/async_synthetics.py
async def start_canary(
    self,
    name: "capo_synthetics.types.canary_name.CanaryName",
    *,
    config_overrides: Optional[AsyncsyntheticsClientConfig] = None,
) -> "capo_synthetics.types.start_canary_response.StartCanaryResponse":
    """<p>Use this operation to run a canary that has already been created. The frequency of the canary runs is determined by the value of the canary's <code>Schedule</code>. To see a canary's schedule, use <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_GetCanary.html">GetCanary</a>.</p>

    Args:
        name: <p>The name of the canary that you want to run. To find canary names, use <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html">DescribeCanaries</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.start_canary_request.StartCanaryRequest]",
    ) -> AsyncOperationResponse[
        "capo_synthetics.types.start_canary_response.StartCanaryResponse"
    ]:
        import capo_synthetics._operations.synthetics.start_canary

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartCanary")
    )
    input_: capo_synthetics.types.start_canary_request.StartCanaryRequest = {
        "name": name
    }

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