DescribeTargetGroups - Elastic Load Balancing

DescribeTargetGroups

Describes the specified target groups or all of your target groups. By default, all target groups are described. Alternatively, you can specify one of the following to filter the results: the ARN of the load balancer, the names of one or more target groups, or the ARNs of one or more target groups.

To describe the targets for a target group, use DescribeTargetHealth. To describe the attributes of a target group, use DescribeTargetGroupAttributes.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

LoadBalancerArn

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

Type: String

Required: No

Marker

The marker for the next set of results. (You received this marker from a previous call.)

Type: String

Required: No

Names.member.N

The names of the target groups.

Type: Array of strings

Required: No

PageSize

The maximum number of results to return with this call.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 400.

Required: No

TargetGroupArns.member.N

The Amazon Resource Names (ARN) of the target groups.

Type: Array of strings

Required: No

Response Elements

The following elements are returned by the service.

NextMarker

If there are additional results, this is the marker for the next set of results. Otherwise, this is null.

Type: String

TargetGroups.member.N

Information about the target groups.

Type: Array of TargetGroup objects

Errors

For information about the errors that are common to all actions, see Common Errors.

LoadBalancerNotFound

The specified load balancer does not exist.

HTTP Status Code: 400

TargetGroupNotFound

The specified target group does not exist.

HTTP Status Code: 400

Examples

Describe a target group

This example describes the specified target group.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=DescribeTargetGroups &TargetGroupArns.member.1=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 &Version=2015-12-01 &AUTHPARAMS

Sample Response

<DescribeTargetGroupsResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/"> <DescribeTargetGroupsResult> <TargetGroups> <member> <TargetGroupArn>arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067</TargetGroupArn> <HealthCheckTimeoutSeconds>5</HealthCheckTimeoutSeconds> <HealthCheckPort>traffic-port</HealthCheckPort> <Matcher> <HttpCode>200</HttpCode> </Matcher> <TargetGroupName>my-targets</TargetGroupName> <HealthCheckProtocol>HTTP</HealthCheckProtocol> <HealthCheckPath>/</HealthCheckPath> <Protocol>HTTP</Protocol> <Port>80</Port> <VpcId>vpc-3ac0fb5f</VpcId> <HealthyThresholdCount>5</HealthyThresholdCount> <HealthCheckIntervalSeconds>30</HealthCheckIntervalSeconds> <LoadBalancerArns> <member>arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188</member> </LoadBalancerArns> <UnhealthyThresholdCount>2</UnhealthyThresholdCount> </member> </TargetGroups> </DescribeTargetGroupsResult> <ResponseMetadata> <RequestId>70092c0e-f3a9-11e5-ae48-cff02092876b</RequestId> </ResponseMetadata> </DescribeTargetGroupsResponse>

Describe all target groups for a load balancer

This example describes all target groups for the specified load balancer.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=DescribeTargetGroups &LoadBalancerArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 &Version=2015-12-01 &AUTHPARAMS

Describe all target groups

This example describes all of your target groups.

Sample Request

https://elasticloadbalancing.amazonaws.com/?Action=DescribeTargetGroups &Version=2015-12-01 &AUTHPARAMS

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: