Skip to content

describe_load_balancers

describe_load_balancers(
    *,
    config_overrides: Optional[ElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arns: Optional[LoadBalancerArns] = None,
    names: Optional[LoadBalancerNames] = None,
    marker: Optional[Marker] = None,
    page_size: Optional[PageSize] = None,
) -> DescribeLoadBalancersOutput

Describes the specified load balancers or all of your load balancers.

Parameters:

  • load_balancer_arns (Optional[LoadBalancerArns], default: None ) –

    The Amazon Resource Names (ARN) of the load balancers. You can specify up to 20 load balancers in a single call.

  • names (Optional[LoadBalancerNames], default: None ) –

    The names of the load balancers.

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

>>> client.describe_load_balancers(load_balancer_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188'])
Source code in docs_src/capo_elastic_load_balancing_v2/_services/elastic_load_balancingv2.py
def describe_load_balancers(
    self,
    *,
    config_overrides: Optional[ElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arns: Optional[
        "capo_elastic_load_balancing_v2.types.load_balancer_arns.LoadBalancerArns"
    ] = None,
    names: Optional[
        "capo_elastic_load_balancing_v2.types.load_balancer_names.LoadBalancerNames"
    ] = 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_load_balancers_output.DescribeLoadBalancersOutput":
    """<p>Describes the specified load balancers or all of your load balancers.</p>

    Args:
        load_balancer_arns: <p>The Amazon Resource Names (ARN) of the load balancers. You can specify up to 20 load balancers in a single call.</p>
        names: <p>The names of the load balancers.</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.load_balancer_not_found_exception.LoadBalancerNotFoundException: <p>The specified load balancer does not exist.</p>
        capo_elastic_load_balancing_v2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a load balancer
        This example describes the specified load balancer.

        >>> client.describe_load_balancers(load_balancer_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188'])
    """

    def _handler(
        req: "OperationRequest[capo_elastic_load_balancing_v2.types.describe_load_balancers_input.DescribeLoadBalancersInput]",
    ) -> OperationResponse[
        "capo_elastic_load_balancing_v2.types.describe_load_balancers_output.DescribeLoadBalancersOutput"
    ]:
        import capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.describe_load_balancers

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeLoadBalancers")
    )
    input_: capo_elastic_load_balancing_v2.types.describe_load_balancers_input.DescribeLoadBalancersInput = {}
    if load_balancer_arns is not None:
        input_["load_balancer_arns"] = load_balancer_arns
    if names is not None:
        input_["names"] = names
    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