Skip to content

describe_listeners

describe_listeners(
    *,
    config_overrides: Optional[ElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arn: Optional[LoadBalancerArn] = None,
    listener_arns: Optional[ListenerArns] = None,
    marker: Optional[Marker] = None,
    page_size: Optional[PageSize] = None,
) -> DescribeListenersOutput

Describes the specified listeners or the listeners for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. You must specify either a load balancer or one or more listeners.

Parameters:

  • load_balancer_arn (Optional[LoadBalancerArn], default: None ) –

    The Amazon Resource Name (ARN) of the load balancer.

  • listener_arns (Optional[ListenerArns], default: None ) –

    The Amazon Resource Names (ARN) of the listeners.

  • 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 listener This example describes the specified listener.

>>> client.describe_listeners(listener_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2'])
Source code in docs_src/capo_elastic_load_balancing_v2/_services/elastic_load_balancingv2.py
def describe_listeners(
    self,
    *,
    config_overrides: Optional[ElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arn: Optional[
        "capo_elastic_load_balancing_v2.types.load_balancer_arn.LoadBalancerArn"
    ] = None,
    listener_arns: Optional[
        "capo_elastic_load_balancing_v2.types.listener_arns.ListenerArns"
    ] = 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_listeners_output.DescribeListenersOutput":
    """<p>Describes the specified listeners or the listeners for the specified Application Load Balancer, Network Load Balancer, or Gateway Load Balancer. You must specify either a load balancer or one or more listeners.</p>

    Args:
        load_balancer_arn: <p>The Amazon Resource Name (ARN) of the load balancer.</p>
        listener_arns: <p>The Amazon Resource Names (ARN) of the listeners.</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.load_balancer_not_found_exception.LoadBalancerNotFoundException: <p>The specified load balancer 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 listener
        This example describes the specified listener.

        >>> client.describe_listeners(listener_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2'])
    """

    def _handler(
        req: "OperationRequest[capo_elastic_load_balancing_v2.types.describe_listeners_input.DescribeListenersInput]",
    ) -> OperationResponse[
        "capo_elastic_load_balancing_v2.types.describe_listeners_output.DescribeListenersOutput"
    ]:
        import capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.describe_listeners

        output, http_response = (
            capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.describe_listeners.describe_listeners(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeListeners")
    )
    input_: capo_elastic_load_balancing_v2.types.describe_listeners_input.DescribeListenersInput = {}
    if load_balancer_arn is not None:
        input_["load_balancer_arn"] = load_balancer_arn
    if listener_arns is not None:
        input_["listener_arns"] = listener_arns
    if marker is not None:
        input_["marker"] = marker
    if page_size is not None:
        input_["page_size"] = page_size

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output