Skip to content

complete_experiment_run async

complete_experiment_run(
    experiment_id: ExperimentId,
    run_id: ExperimentRunId,
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
) -> CompleteExperimentRunOutput

Completes a run that is reported from the caller's code. Call this after reporting the run's cases with PutExperimentRunResults. The run's status becomes COMPLETED, and the service computes its summary and, when it has a rule, its verdict. Cases that were never reported count as not run. The run record is written to the run's log stream in the experiment's results log group. After the run ends, PutExperimentRunResults calls for it fail with a ConflictException (RUN_TERMINAL).

Parameters:

  • experiment_id (ExperimentId) –

    The ID of the experiment the run belongs to.

  • run_id (ExperimentRunId) –

    The ID of the run to complete.

Raises:

Examples:

Complete a reported run The following example completes a run reported from the caller's code whose 50 cases were all reported. The run has a rule, so it gets a verdict. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> await client.complete_experiment_run(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', run_id='ci-build-4821')
Source code in docs_src/capo_cloudwatchomni/_services/async_cloud_watch_omni.py
async def complete_experiment_run(
    self,
    experiment_id: "capo_cloudwatchomni.types.experiment_id.ExperimentId",
    run_id: "capo_cloudwatchomni.types.experiment_run_id.ExperimentRunId",
    *,
    config_overrides: Optional[AsyncCloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.complete_experiment_run_output.CompleteExperimentRunOutput":
    """Completes a run that is reported from the caller's code. Call this after reporting the run's cases with PutExperimentRunResults. The run's status becomes COMPLETED, and the service computes its summary and, when it has a rule, its verdict. Cases that were never reported count as not run. The run record is written to the run's log stream in the experiment's results log group. After the run ends, PutExperimentRunResults calls for it fail with a ConflictException (RUN_TERMINAL).

    Args:
        experiment_id: The ID of the experiment the run belongs to.
        run_id: The ID of the run to complete.

    Raises:
        capo_cloudwatchomni.errors.access_denied_exception.AccessDeniedException: The caller is not authorized to perform this action.
        capo_cloudwatchomni.errors.conflict_exception.ConflictException: The operation could not be completed because of a conflict with the current state of the resource.
        capo_cloudwatchomni.errors.internal_server_exception.InternalServerException: An unexpected error occurred while processing the request.
        capo_cloudwatchomni.errors.resource_not_found_exception.ResourceNotFoundException: The specified resource does not exist.
        capo_cloudwatchomni.errors.throttling_exception.ThrottlingException: The request was throttled due to exceeding the allowed request rate.
        capo_cloudwatchomni.errors.validation_exception.ValidationException: A parameter is specified incorrectly.
        capo_cloudwatchomni.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Complete a reported run
        The following example completes a run reported from the caller's code whose 50 cases were all reported. The run has a rule, so it gets a verdict. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> await client.complete_experiment_run(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', run_id='ci-build-4821')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatchomni.types.complete_experiment_run_input.CompleteExperimentRunInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatchomni.types.complete_experiment_run_output.CompleteExperimentRunOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.complete_experiment_run

        (
            output,
            http_response,
        ) = await capo_cloudwatchomni._operations.cloud_watch_omni_frontend.complete_experiment_run.async_complete_experiment_run(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_cloudwatchomni.types.complete_experiment_run_output.CompleteExperimentRunOutput",
    ) -> dict[str, Any]:
        import capo_cloudwatchomni.types.complete_experiment_run_output

        return capo_cloudwatchomni.types.complete_experiment_run_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CompleteExperimentRun", redact_output=_redact_output),
    )
    input_: capo_cloudwatchomni.types.complete_experiment_run_input.CompleteExperimentRunInput = {
        "experiment_id": experiment_id,
        "run_id": run_id,
    }

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