Skip to content

list_experiments async

list_experiments(
    *,
    config_overrides: Optional[AsyncfisClientConfig] = None,
    max_results: Optional[ListExperimentsMaxResults] = None,
    next_token: Optional[NextToken] = None,
    experiment_template_id: Optional[ExperimentTemplateId] = None,
) -> ListExperimentsResponse

Lists your experiments.

Parameters:

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

    The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

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

    The token for the next page of results.

  • experiment_template_id (Optional[ExperimentTemplateId], default: None ) –

    The ID of the experiment template.

Raises:

  • ValidationException –

    The specified input is not valid, or fails to satisfy the constraints for the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_fis/_services/async_fis.py
async def list_experiments(
    self,
    *,
    config_overrides: Optional[AsyncfisClientConfig] = None,
    max_results: Optional[
        "capo_fis.types.list_experiments_max_results.ListExperimentsMaxResults"
    ] = None,
    next_token: Optional["capo_fis.types.next_token.NextToken"] = None,
    experiment_template_id: Optional[
        "capo_fis.types.experiment_template_id.ExperimentTemplateId"
    ] = None,
) -> "capo_fis.types.list_experiments_response.ListExperimentsResponse":
    """<p>Lists your experiments.</p>

    Args:
        max_results: <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
        next_token: <p>The token for the next page of results.</p>
        experiment_template_id: <p>The ID of the experiment template.</p>

    Raises:
        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.list_experiments_request.ListExperimentsRequest]",
    ) -> AsyncOperationResponse[
        "capo_fis.types.list_experiments_response.ListExperimentsResponse"
    ]:
        import capo_fis._operations.fault_injection_simulator.list_experiments

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListExperiments")
    )
    input_: capo_fis.types.list_experiments_request.ListExperimentsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if experiment_template_id is not None:
        input_["experiment_template_id"] = experiment_template_id

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