Skip to content

get_test_template async

get_test_template(
    test_template_arn: ServiceOwnedArn,
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
) -> GetTestTemplateResponse

Retrieves a resilience test template by ARN, including the parameters it accepts and the fault actions it runs.

Parameters:

  • test_template_arn (ServiceOwnedArn) –

    The ARN of the test template to retrieve.

Raises:

Source code in docs_src/capo_resiliencehubv2/_services/async_resiliencehubv2.py
async def get_test_template(
    self,
    test_template_arn: "capo_resiliencehubv2.types.service_owned_arn.ServiceOwnedArn",
    *,
    config_overrides: Optional[Asyncresiliencehubv2ClientConfig] = None,
) -> (
    "capo_resiliencehubv2.types.get_test_template_response.GetTestTemplateResponse"
):
    """<p>Retrieves a resilience test template by ARN, including the parameters it accepts and the fault actions it runs.</p>

    Args:
        test_template_arn: <p>The ARN of the test template to retrieve.</p>

    Raises:
        capo_resiliencehubv2.errors.access_denied_exception.AccessDeniedException: <p>Access denied — caller lacks required permissions.</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.get_test_template_request.GetTestTemplateRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehubv2.types.get_test_template_response.GetTestTemplateResponse"
    ]:
        import capo_resiliencehubv2._operations.ngrh_service_core.get_test_template

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTestTemplate")
    )
    input_: capo_resiliencehubv2.types.get_test_template_request.GetTestTemplateRequest = {
        "test_template_arn": test_template_arn
    }

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