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 to list.
(dict) –
Describes a target.
id (string) – [REQUIRED]
The ID of the target. If the target type of the target group is
INSTANCE
, this is an instance ID. If the target type isIP
, this is an IP address. If the target type isLAMBDA
, this is the ARN of the Lambda function. If the target type isALB
, this is the ARN of the Application Load Balancer.port (integer) –
The port on which the target is listening. For HTTP, the default is
80
. For HTTPS, the default is443
.
- 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 type of the target group is
INSTANCE
, this is an instance ID. If the target type isIP
, this is an IP address. If the target type isLAMBDA
, this is the ARN of the Lambda function. If the target type isALB
, this is the ARN of the 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 will be sent to this target while current connections are being drained. 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
VPCLattice.Client.exceptions.ValidationException
VPCLattice.Client.exceptions.AccessDeniedException
VPCLattice.Client.exceptions.ThrottlingException
VPCLattice.Client.exceptions.ResourceNotFoundException
VPCLattice.Client.exceptions.InternalServerException