Get
Returns the specified target group.
To get the list of all available target groups, make a List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetTargetGroupRequest =
cloudApi.apploadbalancer.target_group_service.GetTargetGroupRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.TargetGroupServiceClient);
const result = await client.get(
GetTargetGroupRequest.fromPartial({
targetGroupId: "targetGroupId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.apploadbalancer.v1.target_group_service_pb2 import GetTargetGroupRequest
from yandex.cloud.apploadbalancer.v1.target_group_service_pb2_grpc import TargetGroupServiceStub
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(TargetGroupServiceStub)
response = service.Get(GetTargetGroupRequest(target_group_id="targetGroupId"))
print(response)
GetTargetGroupRequest
targetGroupId
: string
ID of the target group to return.
To get the target group ID, make a TargetGroupService.List request.
TargetGroup
A target group resource. For details about the concept, see documentation.
id
: string
ID of the target group. Generated at creation time.
name
: string
Name of the target group. The name is unique within the folder.
description
: string
Description of the target group.
folderId
: string
ID of the folder that the target group belongs to.
labels
: string
Target group labels as key:value
pairs.
For details about the concept, see documentation.
targets
: Target
List of targets in the target group.
createdAt
: google.protobuf.Timestamp
Creation timestamp.
Target
A target resource. For details about the concept, see documentation.
One of addressType
Reference to the target. As of now, targets must only be referred to by their IP addresses.
ipAddress
: stringIP address of the target.
subnetId
: string
ID of the subnet that the target is connected to.
privateIpv4Address
: bool
If set, will not require subnet_id
to validate the target.
Instead, the address should belong to one of the following ranges:
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
Only one of subnet_id
or private_ipv4_address
should be set.