Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Intertech Services AG
Yandex Network Load Balancer
  • Getting started
  • Step-by-step instructions
  • Concepts
  • Best practices for using the service
  • Access management
  • Pricing policy
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • NetworkLoadBalancerService
      • TargetGroupService
      • OperationService
    • REST
  • Questions and answers
  1. API reference
  2. gRPC
  3. TargetGroupService

Network Load Balancer API, gRPC: TargetGroupService

Written by
Yandex Cloud
  • Calls TargetGroupService
  • Get
    • GetTargetGroupRequest
    • TargetGroup
    • Target
  • List
    • ListTargetGroupsRequest
    • ListTargetGroupsResponse
    • TargetGroup
    • Target
  • Create
    • CreateTargetGroupRequest
    • Target
    • Operation
    • CreateTargetGroupMetadata
    • TargetGroup
  • Update
    • UpdateTargetGroupRequest
    • Target
    • Operation
    • UpdateTargetGroupMetadata
    • TargetGroup
  • Delete
    • DeleteTargetGroupRequest
    • Operation
    • DeleteTargetGroupMetadata
  • AddTargets
    • AddTargetsRequest
    • Target
    • Operation
    • AddTargetsMetadata
    • TargetGroup
  • RemoveTargets
    • RemoveTargetsRequest
    • Target
    • Operation
    • RemoveTargetsMetadata
    • TargetGroup
  • ListOperations
    • ListTargetGroupOperationsRequest
    • ListTargetGroupOperationsResponse
    • Operation

A set of methods for managing TargetGroup resources.

Call Description
Get Returns the specified TargetGroup resource.
List Retrieves the list of TargetGroup resources in the specified folder.
Create Creates a target group in the specified folder and adds the specified targets to it.
Update Updates the specified target group.
Delete Deletes the specified target group.
AddTargets Adds targets to the target group.
RemoveTargets Removes targets from the target group.
ListOperations Lists operations for the specified target group.

Calls TargetGroupService

Get

Returns the specified TargetGroup resource.

rpc Get (GetTargetGroupRequest) returns (TargetGroup)

GetTargetGroupRequest

Field Description
target_group_id string
Required. ID of the TargetGroup resource to return. To get the target group ID, use a TargetGroupService.List request. The maximum string length in characters is 50.

TargetGroup

Field Description
id string
Output only. ID of the target group.
folder_id string
ID of the folder that the target group belongs to.
created_at 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 map<string,string>
Resource labels as key:value pairs. Maximum of 64 per resource.
region_id string
ID of the region where the target group resides.
targets[] Target
A list of targets in the target group.

Target

Field Description
subnet_id 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. The maximum string length in characters is 50.
address string
IP address of the target.

List

Retrieves the list of TargetGroup resources in the specified folder.

rpc List (ListTargetGroupsRequest) returns (ListTargetGroupsResponse)

ListTargetGroupsRequest

Field Description
folder_id string
Required. ID of the folder to list target groups in. To get the folder ID, use a TargetGroupService.List request. The maximum string length in characters is 50.
page_size int64
The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListTargetGroupsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100. The maximum value is 1000.
page_token string
Page token. To get the next page of results, set page_token to the ListTargetGroupsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100.
filter string
A filter expression that filters resources listed in the response. The expression must specify:
  1. The field name. Currently you can only filter by the TargetGroup.name field.
  2. An = operator.
  3. The value in double quotes ("). Must be 3-63 characters long and match the regular expression [a-z][-a-z0-9]{1,61}[a-z0-9].
The maximum string length in characters is 1000.

ListTargetGroupsResponse

Field Description
target_groups[] TargetGroup
List of TargetGroup resources.
next_page_token string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListTargetGroupsRequest.page_size, use the next_page_token as the value for the ListTargetGroupsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

TargetGroup

Field Description
id string
Output only. ID of the target group.
folder_id string
ID of the folder that the target group belongs to.
created_at 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 map<string,string>
Resource labels as key:value pairs. Maximum of 64 per resource.
region_id string
ID of the region where the target group resides.
targets[] Target
A list of targets in the target group.

Target

Field Description
subnet_id 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. The maximum string length in characters is 50.
address string
IP address of the target.

Create

Creates a target group in the specified folder and adds the specified targets to it.

rpc Create (CreateTargetGroupRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:CreateTargetGroupMetadata

    Operation.response:TargetGroup

CreateTargetGroupRequest

Field Description
folder_id string
Required. ID of the folder to list target groups in. To get the folder ID, use a TargetGroupService.List request. The maximum string length in characters is 50.
name string
Name of the target group. The name must be unique within the folder. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9].
description string
Description of the target group. The maximum string length in characters is 256.
labels map<string,string>
Resource labels as key:value pairs. No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*.
region_id string
ID of the availability zone where the target group resides. The maximum string length in characters is 50.
targets[] Target
List of targets within the target group.

Target

Field Description
subnet_id 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. The maximum string length in characters is 50.
address string
IP address of the target.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<CreateTargetGroupMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<TargetGroup>
if operation finished successfully.

CreateTargetGroupMetadata

Field Description
target_group_id string
ID of the target group that is being created.

TargetGroup

Field Description
id string
Output only. ID of the target group.
folder_id string
ID of the folder that the target group belongs to.
created_at 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 map<string,string>
Resource labels as key:value pairs. Maximum of 64 per resource.
region_id string
ID of the region where the target group resides.
targets[] Target
A list of targets in the target group.

Update

Updates the specified target group.

rpc Update (UpdateTargetGroupRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:UpdateTargetGroupMetadata

    Operation.response:TargetGroup

UpdateTargetGroupRequest

Field Description
target_group_id string
Required. ID of the TargetGroup resource to update. To get the target group ID, use a TargetGroupService.List request. The maximum string length in characters is 50.
update_mask google.protobuf.FieldMask
Field mask that specifies which fields of the TargetGroup resource are going to be updated.
name string
Name of the target group. The name must be unique within the folder. Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9].
description string
Description of the target group. The maximum string length in characters is 256.
labels map<string,string>
Resource labels as key:value pairs.
The existing set of labels is completely replaced with the provided set. No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*.
targets[] Target
A new list of targets for this target group.

Target

Field Description
subnet_id 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. The maximum string length in characters is 50.
address string
IP address of the target.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<UpdateTargetGroupMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<TargetGroup>
if operation finished successfully.

UpdateTargetGroupMetadata

Field Description
target_group_id string
ID of the target group that is being updated.

TargetGroup

Field Description
id string
Output only. ID of the target group.
folder_id string
ID of the folder that the target group belongs to.
created_at 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 map<string,string>
Resource labels as key:value pairs. Maximum of 64 per resource.
region_id string
ID of the region where the target group resides.
targets[] Target
A list of targets in the target group.

Delete

Deletes the specified target group.

rpc Delete (DeleteTargetGroupRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:DeleteTargetGroupMetadata

    Operation.response:google.protobuf.Empty

DeleteTargetGroupRequest

Field Description
target_group_id string
Required. ID of the target group to delete. To get the target group ID, use a TargetGroupService.List request. The maximum string length in characters is 50.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<DeleteTargetGroupMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<google.protobuf.Empty>
if operation finished successfully.

DeleteTargetGroupMetadata

Field Description
target_group_id string
ID of the target group that is being deleted.

AddTargets

Adds targets to the target group.

rpc AddTargets (AddTargetsRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:AddTargetsMetadata

    Operation.response:TargetGroup

AddTargetsRequest

Field Description
target_group_id string
Required. ID of the TargetGroup resource to add targets to. To get the target group ID, use a TargetGroupService.List request. The maximum string length in characters is 50.
targets[] Target
List of targets to add to the target group. The minimum number of elements is 1.

Target

Field Description
subnet_id 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. The maximum string length in characters is 50.
address string
IP address of the target.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<AddTargetsMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<TargetGroup>
if operation finished successfully.

AddTargetsMetadata

Field Description
target_group_id string
ID of the target group that targets are being added to.

TargetGroup

Field Description
id string
Output only. ID of the target group.
folder_id string
ID of the folder that the target group belongs to.
created_at 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 map<string,string>
Resource labels as key:value pairs. Maximum of 64 per resource.
region_id string
ID of the region where the target group resides.
targets[] Target
A list of targets in the target group.

RemoveTargets

Removes targets from the target group.

rpc RemoveTargets (RemoveTargetsRequest) returns (operation.Operation)

Metadata and response of Operation:

    Operation.metadata:RemoveTargetsMetadata

    Operation.response:TargetGroup

RemoveTargetsRequest

Field Description
target_group_id string
Required. ID of the target group to remove targets from. To get the target group ID, use a TargetGroupService.List request. The maximum string length in characters is 50.
targets[] Target
List of targets to remove from the target group. The minimum number of elements is 1.

Target

Field Description
subnet_id 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. The maximum string length in characters is 50.
address string
IP address of the target.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any<RemoveTargetsMetadata>
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any<TargetGroup>
if operation finished successfully.

RemoveTargetsMetadata

Field Description
target_group_id string
ID of the target group that targets are being removed from.

TargetGroup

Field Description
id string
Output only. ID of the target group.
folder_id string
ID of the folder that the target group belongs to.
created_at 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 map<string,string>
Resource labels as key:value pairs. Maximum of 64 per resource.
region_id string
ID of the region where the target group resides.
targets[] Target
A list of targets in the target group.

ListOperations

Lists operations for the specified target group.

rpc ListOperations (ListTargetGroupOperationsRequest) returns (ListTargetGroupOperationsResponse)

ListTargetGroupOperationsRequest

Field Description
target_group_id string
Required. ID of the TargetGroup resource to update. To get the target group ID, use a TargetGroupService.List request. The maximum string length in characters is 50.
page_size int64
The maximum number of results per page that should be returned. If the number of available results is larger than page_size, the service returns a ListTargetGroupOperationsResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100. The maximum value is 1000.
page_token string
Page token. To get the next page of results, set page_token to the ListTargetGroupOperationsResponse.next_page_token returned by a previous list request. The maximum string length in characters is 100.

ListTargetGroupOperationsResponse

Field Description
operations[] operation.Operation
List of operations for the specified target group.
next_page_token string
This token allows you to get the next page of results for list requests. If the number of results is larger than ListTargetGroupOperationsRequest.page_size, use the next_page_token as the value for the ListTargetGroupOperationsRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

Operation

Field Description
id string
ID of the operation.
description string
Description of the operation. 0-256 characters long.
created_at google.protobuf.Timestamp
Creation timestamp.
created_by string
ID of the user or service account who initiated the operation.
modified_at google.protobuf.Timestamp
The time when the Operation resource was last modified.
done bool
If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
metadata google.protobuf.Any
Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.
result oneof: error or response
The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.
  error google.rpc.Status
The error result of the operation in case of failure or cancellation.
  response google.protobuf.Any
The normal response of the operation in case of success. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.

Was the article helpful?

Language / Region
Yandex project
© 2023 Intertech Services AG
In this article:
  • Calls TargetGroupService
  • Get
  • GetTargetGroupRequest
  • TargetGroup
  • Target
  • List
  • ListTargetGroupsRequest
  • ListTargetGroupsResponse
  • TargetGroup
  • Target
  • Create
  • CreateTargetGroupRequest
  • Target
  • Operation
  • CreateTargetGroupMetadata
  • TargetGroup
  • Update
  • UpdateTargetGroupRequest
  • Target
  • Operation
  • UpdateTargetGroupMetadata
  • TargetGroup
  • Delete
  • DeleteTargetGroupRequest
  • Operation
  • DeleteTargetGroupMetadata
  • AddTargets
  • AddTargetsRequest
  • Target
  • Operation
  • AddTargetsMetadata
  • TargetGroup
  • RemoveTargets
  • RemoveTargetsRequest
  • Target
  • Operation
  • RemoveTargetsMetadata
  • TargetGroup
  • ListOperations
  • ListTargetGroupOperationsRequest
  • ListTargetGroupOperationsResponse
  • Operation