Skip to content

describe_rules async

describe_rules(
    *,
    config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
    listener_arn: Optional[ListenerArn] = None,
    rule_arns: Optional[RuleArns] = None,
    marker: Optional[Marker] = None,
    page_size: Optional[PageSize] = None,
) -> DescribeRulesOutput

Describes the specified rules or the rules for the specified listener. You must specify either a listener or rules.

Parameters:

  • listener_arn (Optional[ListenerArn], default: None ) –

    The Amazon Resource Name (ARN) of the listener.

  • rule_arns (Optional[RuleArns], default: None ) –

    The Amazon Resource Names (ARN) of the rules.

  • marker (Optional[Marker], default: None ) –

    The marker for the next set of results. (You received this marker from a previous call.)

  • page_size (Optional[PageSize], default: None ) –

    The maximum number of results to return with this call.

Raises:

Examples:

To describe a rule This example describes the specified rule.

>>> await client.describe_rules(rule_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee'])
To describe rules for a Network Load Balancer listener
This example describes the rules for the specified Network Load Balancer listener, including rules that route based on source IP address type.
>>> await client.describe_rules(listener_arn='arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/net/my-nlb/1234567890abcdef/1234567890abcdef')
Source code in docs_src/capo_elastic_load_balancing_v2/_services/async_elastic_load_balancingv2.py
async def describe_rules(
    self,
    *,
    config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
    listener_arn: Optional[
        "capo_elastic_load_balancing_v2.types.listener_arn.ListenerArn"
    ] = None,
    rule_arns: Optional[
        "capo_elastic_load_balancing_v2.types.rule_arns.RuleArns"
    ] = None,
    marker: Optional["capo_elastic_load_balancing_v2.types.marker.Marker"] = None,
    page_size: Optional[
        "capo_elastic_load_balancing_v2.types.page_size.PageSize"
    ] = None,
) -> (
    "capo_elastic_load_balancing_v2.types.describe_rules_output.DescribeRulesOutput"
):
    """<p>Describes the specified rules or the rules for the specified listener. You must specify either a listener or rules.</p>

    Args:
        listener_arn: <p>The Amazon Resource Name (ARN) of the listener.</p>
        rule_arns: <p>The Amazon Resource Names (ARN) of the rules.</p>
        marker: <p>The marker for the next set of results. (You received this marker from a previous call.)</p>
        page_size: <p>The maximum number of results to return with this call.</p>

    Raises:
        capo_elastic_load_balancing_v2.errors.listener_not_found_exception.ListenerNotFoundException: <p>The specified listener does not exist.</p>
        capo_elastic_load_balancing_v2.errors.rule_not_found_exception.RuleNotFoundException: <p>The specified rule does not exist.</p>
        capo_elastic_load_balancing_v2.errors.unsupported_protocol_exception.UnsupportedProtocolException: <p>The specified protocol is not supported.</p>
        capo_elastic_load_balancing_v2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a rule
        This example describes the specified rule.

        >>> await client.describe_rules(rule_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee'])
        To describe rules for a Network Load Balancer listener
        This example describes the rules for the specified Network Load Balancer listener, including rules that route based on source IP address type.

        >>> await client.describe_rules(listener_arn='arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/net/my-nlb/1234567890abcdef/1234567890abcdef')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elastic_load_balancing_v2.types.describe_rules_input.DescribeRulesInput]",
    ) -> AsyncOperationResponse[
        "capo_elastic_load_balancing_v2.types.describe_rules_output.DescribeRulesOutput"
    ]:
        import capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.describe_rules

        (
            output,
            http_response,
        ) = await capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.describe_rules.async_describe_rules(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeRules")
    )
    input_: capo_elastic_load_balancing_v2.types.describe_rules_input.DescribeRulesInput = {}
    if listener_arn is not None:
        input_["listener_arn"] = listener_arn
    if rule_arns is not None:
        input_["rule_arns"] = rule_arns
    if marker is not None:
        input_["marker"] = marker
    if page_size is not None:
        input_["page_size"] = page_size

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