Skip to content

list_resiliency_policies async

list_resiliency_policies(
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    policy_name: Optional[EntityName] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> ListResiliencyPoliciesResponse

Lists the resiliency policies for the Resilience Hub applications.

Parameters:

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

    Name of the resiliency policy.

  • 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.

  • ResourceNotFoundException –

    This exception occurs when the specified resource could not be found.

  • 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_resiliency_policies(
    self,
    *,
    config_overrides: Optional[AsyncresiliencehubClientConfig] = None,
    policy_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_resiliency_policies_response.ListResiliencyPoliciesResponse":
    """<p>Lists the resiliency policies for the Resilience Hub applications.</p>

    Args:
        policy_name: <p>Name of the resiliency policy.</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.resource_not_found_exception.ResourceNotFoundException: <p>This exception occurs when the specified resource could not be found.</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_resiliency_policies_request.ListResiliencyPoliciesRequest]",
    ) -> AsyncOperationResponse[
        "capo_resiliencehub.types.list_resiliency_policies_response.ListResiliencyPoliciesResponse"
    ]:
        import capo_resiliencehub._operations.aws_resilience_hub.list_resiliency_policies

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

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

        return capo_resiliencehub.types.list_resiliency_policies_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ListResiliencyPolicies", redact_output=_redact_output),
    )
    input_: capo_resiliencehub.types.list_resiliency_policies_request.ListResiliencyPoliciesRequest = {}
    if policy_name is not None:
        input_["policy_name"] = policy_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