Method create

Creates a network load balancer in the specified folder using the data specified in the request.

HTTP request

POST https://load-balancer.api.cloud.yandex.net/load-balancer/v1/networkLoadBalancers

Body parameters

{
  "folderId": "string",
  "name": "string",
  "description": "string",
  "labels": "object",
  "regionId": "string",
  "type": "string",
  "listenerSpecs": [
    {
      "name": "string",
      "port": "string",
      "protocol": "string",
      "targetPort": "string",
      "externalAddressSpec": {
        "address": "string",
        "ipVersion": "string"
      }
    }
  ],
  "attachedTargetGroups": [
    {
      "targetGroupId": "string",
      "healthChecks": [
        {
          "name": "string",
          "interval": "string",
          "timeout": "string",
          "unhealthyThreshold": "string",
          "healthyThreshold": "string",

          // `attachedTargetGroups[].healthChecks[]` includes only one of the fields `tcpOptions`, `httpOptions`
          "tcpOptions": {
            "port": "string"
          },
          "httpOptions": {
            "port": "string",
            "path": "string"
          },
          // end of the list of possible fields`attachedTargetGroups[].healthChecks[]`

        }
      ]
    }
  ]
}
Field Description
folderId string

Required. ID of the folder to create a network load balancer in. To get the folder ID, use a list request.

The maximum string length in characters is 50.

name string

Name of the network load balancer. 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 network load balancer.

The maximum string length in characters is 256.

labels object

Resource labels as key:value pairs.

No more than 64 per resource. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z].

regionId string

Required. ID of the region where the network load balancer resides.

The maximum string length in characters is 50.

type string

Required. Type of the network load balancer. Only external network load balancers are currently available.

Type of the load balancer. Only external load balancers are currently available.

  • EXTERNAL: External network load balancer.
listenerSpecs[] object

Listener specification that will be used by a network load balancer.

listenerSpecs[].
name
string

Required. Name of the listener. The name must be unique for each listener on a single load balancer. 3-63 characters long.

Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9].

listenerSpecs[].
port
string (int64)

Port for incoming traffic.

Acceptable values are 1 to 32767, inclusive.

listenerSpecs[].
protocol
string
Required. Protocol for incoming traffic.

Network protocol to use.

listenerSpecs[].
targetPort
string (int64)

Port of a target. Acceptable values are 1 to 32767, inclusive.

listenerSpecs[].
externalAddressSpec
object
External IP address specification.

External address specification that is used by ListenerSpec.

listenerSpecs[].
externalAddressSpec.
address
string

Public IP address for a listener. If you provide a static public IP address for the update method, it will replace the existing listener address.

listenerSpecs[].
externalAddressSpec.
ipVersion
string

IP version.

IP version of the addresses that the load balancer works with. Only IPv4 is currently available.

  • IPV4: IPv4
  • IPV6: IPv6
attachedTargetGroups[] object

An AttachedTargetGroup resource. For more information, see Targets and groups.

attachedTargetGroups[].
targetGroupId
string

Required. ID of the target group.

The maximum string length in characters is 50.

attachedTargetGroups[].
healthChecks[]
object

A HealthCheck resource. For more information, see Health check.

attachedTargetGroups[].
healthChecks[].
name
string

Required. 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.

Value must match the regular expression |[a-z][-a-z0-9]{1,61}[a-z0-9].

attachedTargetGroups[].
healthChecks[].
interval
string

The interval between health checks. The default is 2 seconds.

attachedTargetGroups[].
healthChecks[].
timeout
string

Timeout for a target to return a response for the health check. The default is 1 second.

attachedTargetGroups[].
healthChecks[].
unhealthyThreshold
string (int64)

Number of failed health checks before changing the status to UNHEALTHY. The default is 2.

Acceptable values are 2 to 10, inclusive.

attachedTargetGroups[].
healthChecks[].
healthyThreshold
string (int64)

Number of successful health checks required in order to set the HEALTHY status for the target. The default is 2.

Acceptable values are 2 to 10, inclusive.

attachedTargetGroups[].
healthChecks[].
tcpOptions
object
Options for TCP health check.
attachedTargetGroups[].healthChecks[] includes only one of the fields tcpOptions, httpOptions

Configuration option for a TCP health check.

attachedTargetGroups[].
healthChecks[].
tcpOptions.
port
string (int64)

Port to use for TCP health checks.

Acceptable values are 1 to 32767, inclusive.

attachedTargetGroups[].
healthChecks[].
httpOptions
object
Options for HTTP health check.
attachedTargetGroups[].healthChecks[] includes only one of the fields tcpOptions, httpOptions

Configuration option for an HTTP health check.

attachedTargetGroups[].
healthChecks[].
httpOptions.
port
string (int64)

Port to use for HTTP health checks.

Acceptable values are 1 to 32767, inclusive.

attachedTargetGroups[].
healthChecks[].
httpOptions.
path
string

URL path to set for health checking requests for every target in the target group. For example /ping. The default path is /.

Response

HTTP Code: 200 - OK

{
  "id": "string",
  "description": "string",
  "createdAt": "string",
  "createdBy": "string",
  "modifiedAt": "string",
  "done": true,
  "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 text format.

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 text format.

done boolean (boolean)

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 object

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.

error object
The error result of the operation in case of failure or cancellation.
includes only one of the fields error, response

The error result of the operation in case of failure or cancellation.

error.
code
integer (int32)

Error code. An enum value of google.rpc.Code.

error.
message
string

An error message.

error.
details[]
object

A list of messages that carry the error details.

response object
includes only one of the fields error, response

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.