Skip to content

list_rules async

list_rules(
    *,
    config_overrides: Optional[AsyncRoute53RecoveryReadinessClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
    resource_type: Optional[__string] = None,
) -> ListRulesResponse

Lists all readiness rules, or lists the readiness rules for a specific resource type.

Parameters:

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

    The number of objects that you want to return with this call.

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

    The token that identifies which batch of results you want to see.

  • resource_type (Optional[__string], default: None ) –

    The resource type that a readiness rule applies to.

Raises:

Source code in docs_src/capo_route53_recovery_readiness/_services/async_route53_recovery_readiness.py
async def list_rules(
    self,
    *,
    config_overrides: Optional[AsyncRoute53RecoveryReadinessClientConfig] = None,
    max_results: Optional[
        "capo_route53_recovery_readiness.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_route53_recovery_readiness.types.__string.__string"
    ] = None,
    resource_type: Optional[
        "capo_route53_recovery_readiness.types.__string.__string"
    ] = None,
) -> "capo_route53_recovery_readiness.types.list_rules_response.ListRulesResponse":
    """<p>Lists all readiness rules, or lists the readiness rules for a specific resource type.</p>

    Args:
        max_results: <p>The number of objects that you want to return with this call.</p>
        next_token: <p>The token that identifies which batch of results you want to see.</p>
        resource_type: <p>The resource type that a readiness rule applies to.</p>

    Raises:
        capo_route53_recovery_readiness.errors.access_denied_exception.AccessDeniedException: User does not have sufficient access to perform this action.
        capo_route53_recovery_readiness.errors.internal_server_exception.InternalServerException: An unexpected error occurred.
        capo_route53_recovery_readiness.errors.throttling_exception.ThrottlingException: Request was denied due to request throttling.
        capo_route53_recovery_readiness.errors.validation_exception.ValidationException: The input fails to satisfy the constraints specified by an AWS service.
        capo_route53_recovery_readiness.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_route53_recovery_readiness.types.list_rules_request.ListRulesRequest]",
    ) -> AsyncOperationResponse[
        "capo_route53_recovery_readiness.types.list_rules_response.ListRulesResponse"
    ]:
        import capo_route53_recovery_readiness._operations.route53_recovery_readiness.list_rules

        (
            output,
            http_response,
        ) = await capo_route53_recovery_readiness._operations.route53_recovery_readiness.list_rules.async_list_rules(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRules")
    )
    input_: capo_route53_recovery_readiness.types.list_rules_request.ListRulesRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if resource_type is not None:
        input_["resource_type"] = resource_type

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