v1

latestSwagger 2.02026-08-04232286653.5 KB
Load Balancers

Creates an external load balancer in the project and returns the async operation.

This endpoint creates a new external load balancer in the specified project. The request must include the VPC ID, name, location, and at least one listen port with its associated backends.

post/projects/{project_id}/networking/load-balancers

Path parameters

project_idstring required

The project ID to which the external load balancer belongs.

Request body

locationstring required

Location of the External Load Balancer.

namestring required

Name of the External Load Balancer.

protocolstring required

The protocol of the External Load Balancer.

vpc_idstring required

ID of the VPC network this External Load Balancer belongs to.

Example request

{
  "health_check_options": {
    "failure_count": 3,
    "interval": 10,
    "success_count": 2,
    "timeout": 5
  },
  "listen_ports_and_backends": [
    {
      "backends": [
        {
          "ip": "192.168.1.2",
          "port": 8080,
          "status": "ONLINE"
        }
      ],
      "listen_port": 80
    }
  ],
  "location": "us-east1",
  "name": "my-external-load-balancer",
  "protocol": "LOAD_BALANCER_PROTOCOL_TCP",
  "vpc_id": "ab4a6b00-aa5f-408e-a9fb-ac6de5eb45ab"
}

Response

Example response

{
  "operation": {
    "completed_at": "2021-12-03T19:59:34Z",
    "metadata": "{}",
    "operation_id": "F6EF489C-086E-458D-B812-7962964A28C9",
    "result": "{}",
    "started_at": "2021-12-03T19:58:34Z",
    "state": "IN_PROGRESS"
  }
}