Skip to content

list_recommendation_templates async

list_recommendation_templates(
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    assessment_arn: Optional[Arn] = None,
    reverse_order: Optional[BooleanOptional] = None,
    status: Optional[RecommendationTemplateStatusList] = None,
    recommendation_template_arn: Optional[Arn] = None,
    name: Optional[EntityName] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListRecommendationTemplatesResponse

Lists the recommendation templates for the Resilience Hub applications.

Parameters:

  • assessment_arn (Optional[Arn], default: None ) –

    Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn:partition:resiliencehub:region:account:app-assessment/app-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.

  • reverse_order (Optional[BooleanOptional], default: None ) –

    The default is to sort by ascending startTime. To sort by descending startTime, set reverseOrder to true.

  • status (Optional[RecommendationTemplateStatusList], default: None ) –

    Status of the action.

  • recommendation_template_arn (Optional[Arn], default: None ) –

    The Amazon Resource Name (ARN) for a recommendation template.

  • name (Optional[EntityName], default: None ) –

    The name for one of the listed recommendation templates.

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

    Null, or the token from a previous call to get the next set of results.

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

    Maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

Raises:

  • AccessDeniedException –

    You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.

  • InternalServerException –

    This exception occurs when there is an internal failure in the Resilience Hub service.

  • ThrottlingException –

    This exception occurs when you have exceeded the limit on the number of requests per second.

  • ValidationException –

    This exception occurs when a request is not valid.

  • UnknownServiceError –

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

Source code in docs_src/capo_resiliencehub/_services/async_resiliencehub.py
async def list_recommendation_templates(
    self,
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    assessment_arn: Optional["capo_resiliencehub.types.arn.Arn"] = None,
    reverse_order: Optional[
        "capo_resiliencehub.types.boolean_optional.BooleanOptional"
    ] = None,
    status: Optional[
        "capo_resiliencehub.types.recommendation_template_status_list.RecommendationTemplateStatusList"
    ] = None,
    recommendation_template_arn: Optional[
        "capo_resiliencehub.types.arn.Arn"
    ] = None,
    name: Optional["capo_resiliencehub.types.entity_name.EntityName"] = None,
    next_token: Optional["capo_resiliencehub.types.next_token.NextToken"] = None,
    max_results: Optional["capo_resiliencehub.types.max_results.MaxResults"] = None,
) -> "capo_resiliencehub.types.list_recommendation_templates_response.ListRecommendationTemplatesResponse":
    """<p>Lists the recommendation templates for the Resilience Hub applications.</p>

    Args:
        assessment_arn: <p>Amazon Resource Name (ARN) of the assessment. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app-assessment/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
        reverse_order: <p>The default is to sort by ascending <b>startTime</b>. To sort by descending <b>startTime</b>, set reverseOrder to <code>true</code>.</p>
        status: <p>Status of the action.</p>
        recommendation_template_arn: <p>The Amazon Resource Name (ARN) for a recommendation template.</p>
        name: <p>The name for one of the listed recommendation templates.</p>
        next_token: <p>Null, or the token from a previous call to get the next set of results.</p>
        max_results: <p>Maximum number of results to include in the response. If more results exist than the specified <code>MaxResults</code> value, a token is included in the response so that the remaining results can be retrieved.</p>

    Raises:
        capo_resiliencehub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.</p>
        capo_resiliencehub.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Resilience Hub service.</p>
        capo_resiliencehub.errors.throttling_exception.ThrottlingException: <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p>
        capo_resiliencehub.errors.validation_exception.ValidationException: <p>This exception occurs when a request is not valid.</p>
        capo_resiliencehub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_resiliencehub.types.list_recommendation_templates_request.ListRecommendationTemplatesRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehub.types.list_recommendation_templates_response.ListRecommendationTemplatesResponse"
    ]:
        import capo_resiliencehub._operations.aws_resilience_hub.list_recommendation_templates

        (
            output,
            http_response,
        ) = await capo_resiliencehub._operations.aws_resilience_hub.list_recommendation_templates.async_list_recommendation_templates(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_resiliencehub.types.list_recommendation_templates_response.ListRecommendationTemplatesResponse",
    ) -> dict[str, Any]:
        import capo_resiliencehub.types.list_recommendation_templates_response

        return capo_resiliencehub.types.list_recommendation_templates_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListRecommendationTemplates", redact_output=_redact_output
        ),
    )
    input_: capo_resiliencehub.types.list_recommendation_templates_request.ListRecommendationTemplatesRequest = {}
    if assessment_arn is not None:
        input_["assessment_arn"] = assessment_arn
    if reverse_order is not None:
        input_["reverse_order"] = reverse_order
    if status is not None:
        input_["status"] = status
    if recommendation_template_arn is not None:
        input_["recommendation_template_arn"] = recommendation_template_arn
    if name is not None:
        input_["name"] = name
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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