Skip to main content

Get

Returns the specified TargetGroup resource.

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);
})();

GetTargetGroupRequest

targetGroupId : string

ID of the TargetGroup resource to return. To get the target group ID, use a TargetGroupService.List request.

TargetGroup

A TargetGroup resource. For more information, see Target groups and resources.

id : string

Output only. ID of the target group.

folderId : string

ID of the folder that the target group belongs to.

createdAt : google.protobuf.Timestamp

Output only. Creation timestamp in RFC3339 text format.

name : string

Name of the target group. The name is unique within the folder. 3-63 characters long.

description : string

Description of the target group. 0-256 characters long.

labels : string

Resource labels as key:value pairs. Maximum of 64 per resource.

regionId : string

ID of the region where the target group resides.

targets : Target

A list of targets in the target group.

Target

A Target resource. For more information, see Target groups and resources.

subnetId : string

ID of the subnet that targets are connected to. All targets in the target group must be connected to the same subnet within a single availability zone.

address : string

IP address of the target.