Skip to content

describe_instance_health

describe_instance_health(
    load_balancer_name: AccessPointName,
    *,
    config_overrides: Optional[ElasticLoadBalancingClientConfig] = None,
    instances: Optional[Instances] = None,
) -> DescribeEndPointStateOutput

Describes the state of the specified instances with respect to the specified load balancer. If no instances are specified, the call describes the state of all instances that are currently registered with the load balancer. If instances are specified, their state is returned even if they are no longer registered with the load balancer. The state of terminated instances is not returned.

Parameters:

Raises:

Examples:

To describe the health of the instances for a load balancer This example describes the health of the instances for the specified load balancer.

>>> client.describe_instance_health(load_balancer_name='my-load-balancer')
Source code in docs_src/capo_elastic_load_balancing/_services/elastic_load_balancing.py
def describe_instance_health(
    self,
    load_balancer_name: "capo_elastic_load_balancing.types.access_point_name.AccessPointName",
    *,
    config_overrides: Optional[ElasticLoadBalancingClientConfig] = None,
    instances: Optional[
        "capo_elastic_load_balancing.types.instances.Instances"
    ] = None,
) -> "capo_elastic_load_balancing.types.describe_end_point_state_output.DescribeEndPointStateOutput":
    """<p>Describes the state of the specified instances with respect to the specified load balancer. If no instances are specified, the call describes the state of all instances that are currently registered with the load balancer. If instances are specified, their state is returned even if they are no longer registered with the load balancer. The state of terminated instances is not returned.</p>

    Args:
        load_balancer_name: <p>The name of the load balancer.</p>
        instances: <p>The IDs of the instances.</p>

    Raises:
        capo_elastic_load_balancing.errors.access_point_not_found_exception.AccessPointNotFoundException: <p>The specified load balancer does not exist.</p>
        capo_elastic_load_balancing.errors.invalid_end_point_exception.InvalidEndPointException: <p>The specified endpoint is not valid.</p>
        capo_elastic_load_balancing.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe the health of the instances for a load balancer
        This example describes the health of the instances for the specified load balancer.

        >>> client.describe_instance_health(load_balancer_name='my-load-balancer')
    """

    def _handler(
        req: "OperationRequest[capo_elastic_load_balancing.types.describe_end_point_state_input.DescribeEndPointStateInput]",
    ) -> OperationResponse[
        "capo_elastic_load_balancing.types.describe_end_point_state_output.DescribeEndPointStateOutput"
    ]:
        import capo_elastic_load_balancing._operations.elastic_load_balancing_v7.describe_instance_health

        output, http_response = (
            capo_elastic_load_balancing._operations.elastic_load_balancing_v7.describe_instance_health.describe_instance_health(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeInstanceHealth")
    )
    input_: capo_elastic_load_balancing.types.describe_end_point_state_input.DescribeEndPointStateInput = {
        "load_balancer_name": load_balancer_name
    }
    if instances is not None:
        input_["instances"] = instances

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