Skip to content

update_test async

update_test(
    test_id: TestId,
    service_arn: Arn,
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    logging_configuration: Optional[LoggingConfiguration] = None,
    stop_conditions: Optional[StopConditionList] = None,
    role_name: Optional[IamRoleName] = None,
    parameters: Optional[TestParameters] = None,
) -> UpdateTestResponse

Updates the configuration of an existing test.

Parameters:

  • test_id (TestId) –

    The identifier of the test to update.

  • service_arn (Arn) –

    The ARN of the service the test belongs to.

  • logging_configuration (Optional[LoggingConfiguration], default: None ) –

    The updated logging configuration for the test.

  • stop_conditions (Optional[StopConditionList], default: None ) –

    The updated stop conditions for the test.

  • role_name (Optional[IamRoleName], default: None ) –

    The updated IAM execution role name.

  • parameters (Optional[TestParameters], default: None ) –

    The updated parameter values for the test.

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/async_resiliencehubv2.py
async def update_test(
    self,
    test_id: "capo_resiliencehubv2.types.test_id.TestId",
    service_arn: "capo_resiliencehubv2.types.arn.Arn",
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
    logging_configuration: Optional[
        "capo_resiliencehubv2.types.logging_configuration.LoggingConfiguration"
    ] = None,
    stop_conditions: Optional[
        "capo_resiliencehubv2.types.stop_condition_list.StopConditionList"
    ] = None,
    role_name: Optional[
        "capo_resiliencehubv2.types.iam_role_name.IamRoleName"
    ] = None,
    parameters: Optional[
        "capo_resiliencehubv2.types.test_parameters.TestParameters"
    ] = None,
) -> "capo_resiliencehubv2.types.update_test_response.UpdateTestResponse":
    """<p>Updates the configuration of an existing test.</p>

    Args:
        test_id: <p>The identifier of the test to update.</p>
        service_arn: <p>The ARN of the service the test belongs to.</p>
        logging_configuration: <p>The updated logging configuration for the test.</p>
        stop_conditions: <p>The updated stop conditions for the test.</p>
        role_name: <p>The updated IAM execution role name.</p>
        parameters: <p>The updated parameter values for the test.</p>

    Raises:
        capo_resiliencehubv2.errors.access_denied_exception.AccessDeniedException: <p>Access denied — caller lacks required permissions.</p>
        capo_resiliencehubv2.errors.conflict_exception.ConflictException: <p>Conflict — resource already exists.</p>
        capo_resiliencehubv2.errors.internal_server_exception.InternalServerException: <p>Internal service error.</p>
        capo_resiliencehubv2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource not found.</p>
        capo_resiliencehubv2.errors.validation_exception.ValidationException: <p>Validation error — invalid input parameters.</p>
        capo_resiliencehubv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resiliencehubv2.types.update_test_request.UpdateTestRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehubv2.types.update_test_response.UpdateTestResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.update_test

        (
            output,
            http_response,
        ) = await capo_resiliencehubv2._operations.ngrh_service_core.update_test.async_update_test(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTest")
    )
    input_: capo_resiliencehubv2.types.update_test_request.UpdateTestRequest = {
        "test_id": test_id,
        "service_arn": service_arn,
    }
    if logging_configuration is not None:
        input_["logging_configuration"] = logging_configuration
    if stop_conditions is not None:
        input_["stop_conditions"] = stop_conditions
    if role_name is not None:
        input_["role_name"] = role_name
    if parameters is not None:
        input_["parameters"] = parameters

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