Skip to content

get_experiment async

get_experiment(
    id: ExperimentId, *, config_overrides: Optional[AsyncfisClientConfig] = None
) -> GetExperimentResponse

Gets information about the specified experiment.

Parameters:

Raises:

Source code in docs_src/capo_fis/_services/async_fis.py
async def get_experiment(
    self,
    id: "capo_fis.types.experiment_id.ExperimentId",
    *,
    config_overrides: Optional[AsyncfisClientConfig] = None,
) -> "capo_fis.types.get_experiment_response.GetExperimentResponse":
    """<p>Gets information about the specified experiment.</p>

    Args:
        id: <p>The ID of the experiment.</p>

    Raises:
        capo_fis.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_fis.errors.validation_exception.ValidationException: <p>The specified input is not valid, or fails to satisfy the constraints for the request.</p>
        capo_fis.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_fis.types.get_experiment_request.GetExperimentRequest]",
    ) -> AsyncOperationResponse[
        "capo_fis.types.get_experiment_response.GetExperimentResponse"
    ]:
        import capo_fis._operations.fault_injection_simulator.get_experiment

        (
            output,
            http_response,
        ) = await capo_fis._operations.fault_injection_simulator.get_experiment.async_get_experiment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetExperiment")
    )
    input_: capo_fis.types.get_experiment_request.GetExperimentRequest = {"id": id}

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