Skip to content

get_canary_runs

get_canary_runs(
    name: CanaryName,
    *,
    config_overrides: Optional[syntheticsClientConfig] = None,
    next_token: Optional[Token] = None,
    max_results: Optional[MaxSize100] = None,
    dry_run_id: Optional[UUID] = None,
    run_type: Optional[RunType] = None,
) -> GetCanaryRunsResponse

Retrieves a list of runs for a specified canary.

Parameters:

  • name (CanaryName) –

    The name of the canary that you want to see runs for.

  • next_token (Optional[Token], default: None ) –

    A token that indicates that there is more data available. You can use this token in a subsequent GetCanaryRuns operation to retrieve the next set of results.

    When auto retry is enabled for the canary, the first subsequent retry is suffixed with *1 indicating its the first retry and the next subsequent try is suffixed with *2.

  • max_results (Optional[MaxSize100], default: None ) –

    Specify this parameter to limit how many runs are returned each time you use the GetCanaryRuns operation. If you omit this parameter, the default of 100 is used.

  • 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.

  • run_type (Optional[RunType], default: None ) –
    • When you provide RunType=CANARY_RUN and dryRunId, you will get an exception

    • When a value is not provided for RunType, the default value is CANARY_RUN

    • When CANARY_RUN is provided, all canary runs excluding dry runs are returned

    • When DRY_RUN is provided, all dry runs excluding canary runs are returned

Raises:

Source code in docs_src/capo_synthetics/_services/synthetics.py
def get_canary_runs(
    self,
    name: "capo_synthetics.types.canary_name.CanaryName",
    *,
    config_overrides: Optional[syntheticsClientConfig] = None,
    next_token: Optional["capo_synthetics.types.token.Token"] = None,
    max_results: Optional["capo_synthetics.types.max_size100.MaxSize100"] = None,
    dry_run_id: Optional["capo_synthetics.types.uuid.UUID"] = None,
    run_type: Optional["capo_synthetics.types.run_type.RunType"] = None,
) -> "capo_synthetics.types.get_canary_runs_response.GetCanaryRunsResponse":
    """<p>Retrieves a list of runs for a specified canary.</p>

    Args:
        name: <p>The name of the canary that you want to see runs for.</p>
        next_token: <p>A token that indicates that there is more data available. You can use this token in a subsequent <code>GetCanaryRuns</code> operation to retrieve the next set of results.</p> <note> <p>When auto retry is enabled for the canary, the first subsequent retry is suffixed with *1 indicating its the first retry and the next subsequent try is suffixed with *2.</p> </note>
        max_results: <p>Specify this parameter to limit how many runs are returned each time you use the <code>GetCanaryRuns</code> operation. If you omit this parameter, the default of 100 is used.</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>
        run_type: <ul> <li> <p>When you provide <code>RunType=CANARY_RUN</code> and <code>dryRunId</code>, you will get an exception </p> </li> <li> <p>When a value is not provided for <code>RunType</code>, the default value is <code>CANARY_RUN</code> </p> </li> <li> <p>When <code>CANARY_RUN</code> is provided, all canary runs excluding dry runs are returned</p> </li> <li> <p>When <code>DRY_RUN</code> is provided, all dry runs excluding canary runs are returned</p> </li> </ul>

    Raises:
        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.
    """

    def _handler(
        req: "OperationRequest[capo_synthetics.types.get_canary_runs_request.GetCanaryRunsRequest]",
    ) -> OperationResponse[
        "capo_synthetics.types.get_canary_runs_response.GetCanaryRunsResponse"
    ]:
        import capo_synthetics._operations.synthetics.get_canary_runs

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCanaryRuns")
    )
    input_: capo_synthetics.types.get_canary_runs_request.GetCanaryRunsRequest = {
        "name": name
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if dry_run_id is not None:
        input_["dry_run_id"] = dry_run_id
    if run_type is not None:
        input_["run_type"] = run_type

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