Skip to content

delete_experiment

delete_experiment(
    experiment_id: ExperimentId,
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> DeleteExperimentOutput

Deletes an experiment and its runs. The runs' stored results and cases are also deleted; records in the caller's log group are kept. Fails with a ConflictException while a run is RUNNING or STOPPING; stop the runs first. Deleting an experiment that does not exist or was already deleted succeeds. A large experiment can take more than one call: while the delete is still in progress, the call fails with a ConflictException (DELETE_IN_PROGRESS), and repeating the call continues it.

Parameters:

  • experiment_id (ExperimentId) –

    The ID of the experiment to delete.

Raises:

Examples:

Delete an experiment The following example deletes an experiment that has no RUNNING or STOPPING runs. The response is empty. Payloads are shown as JSON; on the wire they are CBOR-encoded.

>>> client.delete_experiment(experiment_id='exp-01JC8Z5V7Q3M9K2T4R6W8Y0ABC')
Source code in docs_src/capo_cloudwatchomni/_services/cloud_watch_omni.py
def delete_experiment(
    self,
    experiment_id: "capo_cloudwatchomni.types.experiment_id.ExperimentId",
    *,
    config_overrides: Optional[CloudWatchOmniClientConfig] = None,
) -> "capo_cloudwatchomni.types.delete_experiment_output.DeleteExperimentOutput":
    """Deletes an experiment and its runs. The runs' stored results and cases are also deleted; records in the caller's log group are kept. Fails with a ConflictException while a run is RUNNING or STOPPING; stop the runs first. Deleting an experiment that does not exist or was already deleted succeeds. A large experiment can take more than one call: while the delete is still in progress, the call fails with a ConflictException (DELETE_IN_PROGRESS), and repeating the call continues it.

    Args:
        experiment_id: The ID of the experiment 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.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 an experiment
        The following example deletes an experiment that has no RUNNING or STOPPING runs. The response is empty. Payloads are shown as JSON; on the wire they are CBOR-encoded.

        >>> client.delete_experiment(experiment_id='exp-01JC8Z5V7Q3M9K2T4R6W8Y0ABC')
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatchomni.types.delete_experiment_input.DeleteExperimentInput]",
    ) -> OperationResponse[
        "capo_cloudwatchomni.types.delete_experiment_output.DeleteExperimentOutput"
    ]:
        import capo_cloudwatchomni._operations.cloud_watch_omni_frontend.delete_experiment

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteExperiment")
    )
    input_: capo_cloudwatchomni.types.delete_experiment_input.DeleteExperimentInput = {
        "experiment_id": experiment_id
    }

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