Skip to content

get_canary

get_canary(
    name: CanaryName,
    *,
    config_overrides: Optional[syntheticsClientConfig] = None,
    dry_run_id: Optional[UUID] = None,
) -> GetCanaryResponse

Retrieves complete information about one canary. You must specify the name of the canary that you want. To get a list of canaries and their names, use DescribeCanaries.

Parameters:

  • name (CanaryName) –

    The name of the canary that you want details for.

  • dry_run_id (Optional[UUID], default: None ) –

    The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.

Raises:

Source code in docs_src/capo_synthetics/_services/synthetics.py
def get_canary(
    self,
    name: "capo_synthetics.types.canary_name.CanaryName",
    *,
    config_overrides: Optional[syntheticsClientConfig] = None,
    dry_run_id: Optional["capo_synthetics.types.uuid.UUID"] = None,
) -> "capo_synthetics.types.get_canary_response.GetCanaryResponse":
    """<p>Retrieves complete information about one canary. You must specify the name of the canary that you want. To get a list of canaries and their names, use <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_DescribeCanaries.html">DescribeCanaries</a>.</p>

    Args:
        name: <p>The name of the canary that you want details for.</p>
        dry_run_id: <p>The DryRunId associated with an existing canary’s dry run. You can use this DryRunId to retrieve information about the dry run.</p>

    Raises:
        capo_synthetics.errors.internal_server_exception.InternalServerException: <p>An unknown internal error occurred.</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.
    """

    def _handler(
        req: "OperationRequest[capo_synthetics.types.get_canary_request.GetCanaryRequest]",
    ) -> OperationResponse[
        "capo_synthetics.types.get_canary_response.GetCanaryResponse"
    ]:
        import capo_synthetics._operations.synthetics.get_canary

        output, http_response = (
            capo_synthetics._operations.synthetics.get_canary.get_canary(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCanary")
    )
    input_: capo_synthetics.types.get_canary_request.GetCanaryRequest = {
        "name": name
    }
    if dry_run_id is not None:
        input_["dry_run_id"] = dry_run_id

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