Network Load Balancer API, REST: NetworkLoadBalancer.AttachTargetGroup
Attaches a target group to the specified network load balancer.
HTTP request
POST https://load-balancer.api.cloud.yandex.net/load-balancer/v1/networkLoadBalancers/{networkLoadBalancerId}:attachTargetGroup
Path parameters
|
Field |
Description |
|
networkLoadBalancerId |
string Required field. ID of the network load balancer to attach the target group to. |
Body parameters
{
"attachedTargetGroup": {
"targetGroupId": "string",
"healthChecks": [
{
"name": "string",
"interval": "string",
"timeout": "string",
"unhealthyThreshold": "string",
"healthyThreshold": "string",
// Includes only one of the fields `tcpOptions`, `httpOptions`
"tcpOptions": {
"port": "string"
},
"httpOptions": {
"port": "string",
"path": "string"
}
// end of the list of possible fields
}
]
}
}
|
Field |
Description |
|
attachedTargetGroup |
ID of the attached target group to attach to the network load balancer. |
AttachedTargetGroup
An AttachedTargetGroup resource. For more information, see Targets and groups.
|
Field |
Description |
|
targetGroupId |
string ID of the target group. |
|
healthChecks[] |
A health check to perform on the target group. |
HealthCheck
A HealthCheck resource. For more information, see Health check.
|
Field |
Description |
|
name |
string Name of the health check. The name must be unique for each target group that attached to a single load balancer. 3-63 characters long. |
|
interval |
string (duration) The interval between health checks. The default is 2 seconds. |
|
timeout |
string (duration) Timeout for a target to return a response for the health check. The default is 1 second. |
|
unhealthyThreshold |
string (int64) Number of failed health checks before changing the status to |
|
healthyThreshold |
string (int64) Number of successful health checks required in order to set the |
|
tcpOptions |
Options for TCP health check. Includes only one of the fields Protocol to use for the health check. Either TCP or HTTP. |
|
httpOptions |
Options for HTTP health check. Includes only one of the fields Protocol to use for the health check. Either TCP or HTTP. |
TcpOptions
Configuration option for a TCP health check.
|
Field |
Description |
|
port |
string (int64) Port to use for TCP health checks. |
HttpOptions
Configuration option for an HTTP health check.
|
Field |
Description |
|
port |
string (int64) Port to use for HTTP health checks. |
|
path |
string URL path to set for health checking requests for every target in the target group. |
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": "object",
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": "object"
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
|
Field |
Description |
|
id |
string ID of the operation. |
|
description |
string Description of the operation. 0-256 characters long. |
|
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
|
createdBy |
string ID of the user or service account who initiated the operation. |
|
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
|
done |
boolean If the value is |
|
metadata |
object Service-specific metadata associated with the operation. |
|
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
|
response |
object The normal response of the operation in case of success. Includes only one of the fields The operation result. |
Status
The error result of the operation in case of failure or cancellation.
|
Field |
Description |
|
code |
integer (int32) Error code. An enum value of google.rpc.Code |
|
message |
string An error message. |
|
details[] |
object A list of messages that carry the error details. |