Skip to content

describe_target_groups async

describe_target_groups(
    *,
    config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arn: Optional[LoadBalancerArn] = None,
    target_group_arns: Optional[TargetGroupArns] = None,
    names: Optional[TargetGroupNames] = None,
    marker: Optional[Marker] = None,
    page_size: Optional[PageSize] = None,
) -> DescribeTargetGroupsOutput

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.

Parameters:

  • load_balancer_arn (Optional[LoadBalancerArn], default: None ) –

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

  • target_group_arns (Optional[TargetGroupArns], default: None ) –

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

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

    The names of the target groups.

  • 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 target group This example describes the specified target group.

>>> await client.describe_target_groups(target_group_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067'])
Source code in docs_src/capo_elastic_load_balancing_v2/_services/async_elastic_load_balancingv2.py
async def describe_target_groups(
    self,
    *,
    config_overrides: Optional[AsyncElasticLoadBalancingv2ClientConfig] = None,
    load_balancer_arn: Optional[
        "capo_elastic_load_balancing_v2.types.load_balancer_arn.LoadBalancerArn"
    ] = None,
    target_group_arns: Optional[
        "capo_elastic_load_balancing_v2.types.target_group_arns.TargetGroupArns"
    ] = None,
    names: Optional[
        "capo_elastic_load_balancing_v2.types.target_group_names.TargetGroupNames"
    ] = 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_target_groups_output.DescribeTargetGroupsOutput":
    """<p>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.</p>

    Args:
        load_balancer_arn: <p>The Amazon Resource Name (ARN) of the load balancer.</p>
        target_group_arns: <p>The Amazon Resource Names (ARN) of the target groups.</p>
        names: <p>The names of the target groups.</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.target_group_not_found_exception.TargetGroupNotFoundException: <p>The specified target group 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 target group
        This example describes the specified target group.

        >>> await client.describe_target_groups(target_group_arns=['arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elastic_load_balancing_v2.types.describe_target_groups_input.DescribeTargetGroupsInput]",
    ) -> AsyncOperationResponse[
        "capo_elastic_load_balancing_v2.types.describe_target_groups_output.DescribeTargetGroupsOutput"
    ]:
        import capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.describe_target_groups

        (
            output,
            http_response,
        ) = await capo_elastic_load_balancing_v2._operations.elastic_load_balancing_v10.describe_target_groups.async_describe_target_groups(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeTargetGroups")
    )
    input_: capo_elastic_load_balancing_v2.types.describe_target_groups_input.DescribeTargetGroupsInput = {}
    if load_balancer_arn is not None:
        input_["load_balancer_arn"] = load_balancer_arn
    if target_group_arns is not None:
        input_["target_group_arns"] = target_group_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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output