VPCLattice / Client / list_targets

list_targets#

VPCLattice.Client.list_targets(**kwargs)#

Lists the targets for the target group. By default, all targets are included. You can use this API to check the health status of targets. You can also filter the results by target.

See also: AWS API Documentation

Request Syntax

response = client.list_targets(
    maxResults=123,
    nextToken='string',
    targetGroupIdentifier='string',
    targets=[
        {
            'id': 'string',
            'port': 123
        },
    ]
)
Parameters:
  • maxResults (integer) – The maximum number of results to return.

  • nextToken (string) – A pagination token for the next page of results.

  • targetGroupIdentifier (string) –

    [REQUIRED]

    The ID or Amazon Resource Name (ARN) of the target group.

  • targets (list) –

    The targets.

    • (dict) –

      Describes a target.

      • id (string) – [REQUIRED]

        The ID of the target. If the target group type is INSTANCE, this is an instance ID. If the target group type is IP, this is an IP address. If the target group type is LAMBDA, this is the ARN of a Lambda function. If the target group type is ALB, this is the ARN of an Application Load Balancer.

      • port (integer) –

        The port on which the target is listening. For HTTP, the default is 80. For HTTPS, the default is 443.

Return type:

dict

Returns:

Response Syntax

{
    'items': [
        {
            'id': 'string',
            'port': 123,
            'reasonCode': 'string',
            'status': 'DRAINING'|'UNAVAILABLE'|'HEALTHY'|'UNHEALTHY'|'INITIAL'|'UNUSED'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • items (list) –

      Information about the targets.

      • (dict) –

        Summary information about a target.

        • id (string) –

          The ID of the target. If the target group type is INSTANCE, this is an instance ID. If the target group type is IP, this is an IP address. If the target group type is LAMBDA, this is the ARN of a Lambda function. If the target type is ALB, this is the ARN of an Application Load Balancer.

        • port (integer) –

          The port on which the target is listening.

        • reasonCode (string) –

          The code for why the target status is what it is.

        • status (string) –

          The status of the target.

          • DRAINING: The target is being deregistered. No new connections are sent to this target while current connections are being drained. The default draining time is 5 minutes.

          • UNAVAILABLE: Health checks are unavailable for the target group.

          • HEALTHY: The target is healthy.

          • UNHEALTHY: The target is unhealthy.

          • INITIAL: Initial health checks on the target are being performed.

          • UNUSED: Target group is not used in a service.

    • nextToken (string) –

      If there are additional results, a pagination token for the next page of results.

Exceptions