Skip to content

delete_experiment_run

delete_experiment_run(
    experiment_id: ExperimentId,
    run_id: ExperimentRunId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> DeleteExperimentRunOutput

Deletes a run that has ended. Also deletes the run's stored results and cases, and the live control run of a target run. Records in the experiment's results log group, in the log stream {experimentId}/{runId}, are kept, so a deleted run's ID cannot be reused: PutExperimentRunResults fails with a ConflictException (RUN_ID_DELETED). Deleting a run that does not exist or was already deleted succeeds, but the experiment must exist. Fails with a ConflictException (RUN_ACTIVE) while the run is RUNNING or STOPPING; stop or complete it first. Also fails with RUN_REFERENCED for a live control run while its target run exists, and for the control of a RUNNING or STOPPING run. A run with many cases can need more than one call: DELETE_IN_PROGRESS means the delete is still in progress, and repeating the call continues it.

Parameters:

  • experiment_id (ExperimentId) –

    The ID of the experiment the run belongs to. The experiment must exist.

  • run_id (ExperimentRunId) –

    The ID of the run to delete.

Raises:

Examples:

Delete a run The following example deletes a reported run that has ended. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.delete_experiment_run(experiment_id='exp-01JD8K3M5N7P9Q2R4S6T8V0W1X', run_id='ci-build-4821')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def delete_experiment_run(
    self,
    experiment_id: "capo_cloudwatchomni.types.experiment_id.ExperimentId",
    run_id: "capo_cloudwatchomni.types.experiment_run_id.ExperimentRunId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.delete_experiment_run_output.DeleteExperimentRunOutput":
    """Deletes a run that has ended. Also deletes the run's stored results and cases, and the live control run of a target run. Records in the experiment's results log group, in the log stream {experimentId}/{runId}, are kept, so a deleted run's ID cannot be reused: PutExperimentRunResults fails with a ConflictException (RUN_ID_DELETED). Deleting a run that does not exist or was already deleted succeeds, but the experiment must exist. Fails with a ConflictException (RUN_ACTIVE) while the run is RUNNING or STOPPING; stop or complete it first. Also fails with RUN_REFERENCED for a live control run while its target run exists, and for the control of a RUNNING or STOPPING run. A run with many cases can need more than one call: DELETE_IN_PROGRESS means the delete is still in progress, and repeating the call continues it.

    Args:
        experiment_id: The ID of the experiment the run belongs to. The experiment must exist.
        run_id: The ID of the run to delete.

    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:
        Delete a run
        The following example deletes a reported run that has ended. Payloads are shown as JSON; on the wire they are CBOR-encoded.

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

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.delete_experiment_run_input.DeleteExperimentRunInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.delete_experiment_run_output.DeleteExperimentRunOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.delete_experiment_run

        output, http_response = (
            capo_cloudwatchomni._operations.cloud_watch_omni_frontend.delete_experiment_run.delete_experiment_run(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteExperimentRun")
    )
    input_: capo_cloudwatchomni.types.delete_experiment_run_input.DeleteExperimentRunInput = {
        "experiment_id": experiment_id,
        "run_id": run_id,
    }

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