# Network Load Balancer


<style>
  span[class^="pill-"] {
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-right: 12px;
    font-family: sans-serif;
    font-weight: bold;
    display: inline-block;
    line-height: 1;
  }
  span.pill-GET { background-color: #61affe; }
  span.pill-POST { background-color: #49cc90; }
  span.pill-PUT { background-color: #fca130; }
  span.pill-DELETE { background-color: #f93e3e; }
  span.pill-PATCH { background-color: #50e3c2; }
  span[class^="pill-"]:after {
    content: attr(data-label);
    font-size: 0.9rem;
  }
</style>

A Network Load Balancer (NLB) is a Layer 4 (TCP/UDP) load balancer that distributes incoming traffic to Compute instances managed by an Instance Pool.

[Read more](https://community.exoscale.com/documentation/compute/network-load-balancer/)

## <span data-label="POST" class="pill-POST"></span>create-load-balancer

Create a Load Balancer

```
POST /load-balancer
```

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | **yes** | Load Balancer name<br/><br/>Min length: `1`. Max length: `255`. |
| `description` | string | no | Load Balancer description<br/><br/>Max length: `255`. |
| `labels` | object | no | Load balancer labels |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "labels": {},
  "name": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `create-load-balancer`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.CreateLoadBalancer) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.create_load_balancer) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#createLoadBalancer(com.exoscale.sdk.model.CreateLoadBalancerRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api create-load-balancer`

## <span data-label="GET" class="pill-GET"></span>get-load-balancer

Retrieve Load Balancer details

```
GET /load-balancer/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `created-at` | string | Load Balancer creation date<br/><br/>ISO 8601 date-time. |
| `description` | string | Load Balancer description<br/><br/>Max length: `255`. |
| `id` | string | Load Balancer ID<br/><br/>Must be a valid UUID. |
| `ip` | string | Load Balancer public IP<br/><br/>Must be a valid IPv4 address. |
| `labels` | object | Load Balancer Labels |
| `name` | string | Load Balancer name<br/><br/>Min length: `1`. Max length: `255`. |
| `services` | array of [Load Balancer Service](/reference/api/_schemas/load-balancer-service/) | Load Balancer Services |
| `state` | string | Load Balancer state<br/><br/>Allowed values: `creating`, `migrated`, `deleting`, `running`, `migrating`, `error`. |

<details>
<summary>Example output</summary>

```json
{
  "created-at": "2024-01-01T12:00:00Z",
  "description": "string",
  "id": "string",
  "ip": "string",
  "labels": {},
  "name": "string",
  "services": [
    {
      "description": "string",
      "healthcheck": {
        "interval": 0,
        "mode": "tcp",
        "port": 0,
        "retries": 0,
        "timeout": 0,
        "tls-sni": "string",
        "uri": "string"
      },
      "healthcheck-status": [
        {
          "public-ip": "string",
          "status": "failure"
        }
      ],
      "id": "string",
      "instance-pool": {
        "anti-affinity-groups": [
          {
            "id": null
          }
        ],
        "application-consistent-snapshot-enabled": true,
        "deploy-target": {
          "id": "string"
        },
        "description": "string",
        "disk-size": 0,
        "elastic-ips": [
          {
            "id": null
          }
        ],
        "id": "string",
        "instance-prefix": "string",
        "instance-type": {
          "id": "string"
        },
        "instances": [
          {
            "id": null
          }
        ],
        "ipv6-enabled": true,
        "labels": {},
        "manager": {
          "id": "string",
          "type": "sks-nodepool"
        },
        "min-available": 0,
        "name": "string",
        "private-networks": [
          {
            "id": null
          }
        ],
        "public-ip-assignment": "inet4",
        "security-groups": [
          {
            "id": null
          }
        ],
        "size": 0,
        "ssh-key": {
          "name": "string"
        },
        "ssh-keys": [
          {
            "name": null
          }
        ],
        "state": "scaling-up",
        "template": {
          "id": "string"
        },
        "user-data": "string"
      },
      "name": "string",
      "port": 0,
      "protocol": "tcp",
      "state": "creating",
      "strategy": "round-robin",
      "target-port": 0
    }
  ],
  "state": "creating"
}
```
</details>


SDK reference for `get-load-balancer`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetLoadBalancer) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_load_balancer) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getLoadBalancer(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-load-balancer`

## <span data-label="PUT" class="pill-PUT"></span>update-load-balancer

Update a Load Balancer

```
PUT /load-balancer/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string | no | Load Balancer description<br/><br/>Max length: `255`. |
| `labels` | object | no |  |
| `name` | string | no | Load Balancer name<br/><br/>Min length: `1`. Max length: `255`. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "labels": {},
  "name": "string"
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-load-balancer`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateLoadBalancer) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_load_balancer) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateLoadBalancer(java.util.UUID,com.exoscale.sdk.model.UpdateLoadBalancerRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-load-balancer`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-load-balancer

Delete a Load Balancer

```
DELETE /load-balancer/{id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-load-balancer`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteLoadBalancer) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_load_balancer) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteLoadBalancer(java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-load-balancer`

## <span data-label="GET" class="pill-GET"></span>get-load-balancer-service

Retrieve Load Balancer Service details

```
GET /load-balancer/{id}/service/{service-id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |
| `service-id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `description` | string | Load Balancer Service description<br/><br/>Max length: `255`. |
| `healthcheck` | [Load Balancer Service healthcheck](/reference/api/_schemas/load-balancer-service-healthcheck/) | Healthcheck configuration |
| `healthcheck-status` | array of [Load Balancer Service status](/reference/api/_schemas/load-balancer-server-status/) | Healthcheck status per backend server |
| `id` | string | Load Balancer Service ID<br/><br/>Must be a valid UUID. |
| `instance-pool` | [Instance Pool](/reference/api/_schemas/instance-pool/) | Instance Pool to forward network traffic to |
| `name` | string | Load Balancer Service name<br/><br/>Min length: `1`. Max length: `255`. |
| `port` | integer | Port exposed on the Load Balancer's public IP<br/><br/>Min: `0`. |
| `protocol` | string | Network traffic protocol<br/><br/>Allowed values: `tcp`, `udp`. |
| `state` | string | Load Balancer Service state<br/><br/>Allowed values: `creating`, `deleting`, `running`, `updating`, `error`. |
| `strategy` | string | Load balancing strategy<br/><br/>Allowed values: `round-robin`, `maglev-hash`, `source-hash`. |
| `target-port` | integer | Port on which the network traffic will be forwarded to on the receiving instance<br/><br/>Min: `0`. |

<details>
<summary>Example output</summary>

```json
{
  "description": "string",
  "healthcheck": {
    "interval": 0,
    "mode": "tcp",
    "port": 0,
    "retries": 0,
    "timeout": 0,
    "tls-sni": "string",
    "uri": "string"
  },
  "healthcheck-status": [
    {
      "public-ip": "string",
      "status": "failure"
    }
  ],
  "id": "string",
  "instance-pool": {
    "anti-affinity-groups": [
      {
        "id": "string"
      }
    ],
    "application-consistent-snapshot-enabled": true,
    "deploy-target": {
      "id": "string"
    },
    "description": "string",
    "disk-size": 0,
    "elastic-ips": [
      {
        "id": "string"
      }
    ],
    "id": "string",
    "instance-prefix": "string",
    "instance-type": {
      "id": "string"
    },
    "instances": [
      {
        "id": "string"
      }
    ],
    "ipv6-enabled": true,
    "labels": {},
    "manager": {
      "id": "string",
      "type": "sks-nodepool"
    },
    "min-available": 0,
    "name": "string",
    "private-networks": [
      {
        "id": "string"
      }
    ],
    "public-ip-assignment": "inet4",
    "security-groups": [
      {
        "id": "string"
      }
    ],
    "size": 0,
    "ssh-key": {
      "name": "string"
    },
    "ssh-keys": [
      {
        "name": "string"
      }
    ],
    "state": "scaling-up",
    "template": {
      "id": "string"
    },
    "user-data": "string"
  },
  "name": "string",
  "port": 0,
  "protocol": "tcp",
  "state": "creating",
  "strategy": "round-robin",
  "target-port": 0
}
```
</details>


SDK reference for `get-load-balancer-service`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.GetLoadBalancerService) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.get_load_balancer_service) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#getLoadBalancerService(java.util.UUID,java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api get-load-balancer-service`

## <span data-label="PUT" class="pill-PUT"></span>update-load-balancer-service

Update a Load Balancer Service

```
PUT /load-balancer/{id}/service/{service-id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |
| `service-id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string | no | Load Balancer Service description<br/><br/>Max length: `255`. |
| `healthcheck` | [Load Balancer Service healthcheck](/reference/api/_schemas/load-balancer-service-healthcheck/) | no | Healthcheck configuration |
| `name` | string | no | Load Balancer Service name<br/><br/>Max length: `255`. |
| `port` | integer | no | Port exposed on the Load Balancer's public IP<br/><br/>Min: `1`. Max: `65535`. |
| `protocol` | string | no | Network traffic protocol<br/><br/>Allowed values: `tcp`, `udp`. |
| `strategy` | string | no | Load balancing strategy<br/><br/>Allowed values: `round-robin`, `maglev-hash`, `source-hash`. |
| `target-port` | integer | no | Port on which the network traffic will be forwarded to on the receiving instance<br/><br/>Min: `1`. Max: `65535`. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "healthcheck": {
    "interval": 0,
    "mode": "tcp",
    "port": 0,
    "retries": 0,
    "timeout": 0,
    "tls-sni": "string",
    "uri": "string"
  },
  "name": "string",
  "port": 0,
  "protocol": "tcp",
  "strategy": "round-robin",
  "target-port": 0
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `update-load-balancer-service`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.UpdateLoadBalancerService) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.update_load_balancer_service) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#updateLoadBalancerService(java.util.UUID,java.util.UUID,com.exoscale.sdk.model.UpdateLoadBalancerServiceRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api update-load-balancer-service`

## <span data-label="DELETE" class="pill-DELETE"></span>delete-load-balancer-service

Delete a Load Balancer Service

```
DELETE /load-balancer/{id}/service/{service-id}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |
| `service-id` | `path` | Must be a valid UUID. |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `delete-load-balancer-service`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.DeleteLoadBalancerService) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.delete_load_balancer_service) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#deleteLoadBalancerService(java.util.UUID,java.util.UUID))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api delete-load-balancer-service`


---

## Other Operations

## <span data-label="DELETE" class="pill-DELETE"></span>reset-load-balancer-field

Reset a Load Balancer field to its default value

```
DELETE /load-balancer/{id}/{field}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |
| `field` | `path` |  |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `reset-load-balancer-field`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ResetLoadBalancerField) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reset_load_balancer_field) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#resetLoadBalancerField(java.util.UUID,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reset-load-balancer-field`

## <span data-label="DELETE" class="pill-DELETE"></span>reset-load-balancer-service-field

Reset a Load Balancer Service field to its default value

```
DELETE /load-balancer/{id}/service/{service-id}/{field}
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |
| `service-id` | `path` | Must be a valid UUID. |
| `field` | `path` |  |

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `reset-load-balancer-service-field`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ResetLoadBalancerServiceField) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.reset_load_balancer_service_field) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#resetLoadBalancerServiceField(java.util.UUID,java.util.UUID,java.lang.String))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api reset-load-balancer-service-field`

## <span data-label="GET" class="pill-GET"></span>list-load-balancers

List Load Balancers

```
GET /load-balancer
```

### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `load-balancers` | array of [Load Balancer](/reference/api/_schemas/load-balancer/) |  |

<details>
<summary>Example output</summary>

```json
{
  "load-balancers": [
    {
      "created-at": "2024-01-01T12:00:00Z",
      "description": "string",
      "id": "string",
      "ip": "string",
      "labels": {},
      "name": "string",
      "services": [
        {
          "description": "string",
          "healthcheck": {
            "interval": null,
            "mode": null,
            "port": null,
            "retries": null,
            "timeout": null,
            "tls-sni": null,
            "uri": null
          },
          "healthcheck-status": [
            null
          ],
          "id": "string",
          "instance-pool": {
            "anti-affinity-groups": null,
            "application-consistent-snapshot-enabled": null,
            "deploy-target": null,
            "description": null,
            "disk-size": null,
            "elastic-ips": null,
            "id": null,
            "instance-prefix": null,
            "instance-type": null,
            "instances": null,
            "ipv6-enabled": null,
            "labels": null,
            "manager": null,
            "min-available": null,
            "name": null,
            "private-networks": null,
            "public-ip-assignment": null,
            "security-groups": null,
            "size": null,
            "ssh-key": null,
            "ssh-keys": null,
            "state": null,
            "template": null,
            "user-data": null
          },
          "name": "string",
          "port": 0,
          "protocol": "tcp",
          "state": "creating",
          "strategy": "round-robin",
          "target-port": 0
        }
      ],
      "state": "creating"
    }
  ]
}
```
</details>


SDK reference for `list-load-balancers`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.ListLoadBalancers) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.list_load_balancers) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#listLoadBalancers())

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api list-load-balancers`

## <span data-label="POST" class="pill-POST"></span>add-service-to-load-balancer

Add a Load Balancer Service

```
POST /load-balancer/{id}/service
```

### Path parameters

| Name | In | Description |
| --- | --- | --- |
| `id` | `path` | Must be a valid UUID. |

### Request body

Content-Type: `application/json`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `healthcheck` | [Load Balancer Service healthcheck](/reference/api/_schemas/load-balancer-service-healthcheck/) | **yes** | Healthcheck configuration |
| `instance-pool` | [Instance Pool](/reference/api/_schemas/instance-pool/) | **yes** | Instance Pool to forward traffic to |
| `name` | string | **yes** | Load Balancer Service name<br/><br/>Min length: `1`. Max length: `255`. |
| `port` | integer | **yes** | Port exposed on the Load Balancer's public IP<br/><br/>Min: `1`. Max: `65535`. |
| `protocol` | string | **yes** | Network traffic protocol<br/><br/>Allowed values: `tcp`, `udp`. |
| `strategy` | string | **yes** | Load balancing strategy<br/><br/>Allowed values: `round-robin`, `maglev-hash`, `source-hash`. |
| `target-port` | integer | **yes** | Port on which the network traffic will be forwarded to on the receiving instance<br/><br/>Min: `1`. Max: `65535`. |
| `description` | string | no | Load Balancer Service description<br/><br/>Max length: `255`. |

<details>
<summary>Example</summary>

```json
{
  "description": "string",
  "healthcheck": {
    "interval": 0,
    "mode": "tcp",
    "port": 0,
    "retries": 0,
    "timeout": 0,
    "tls-sni": "string",
    "uri": "string"
  },
  "instance-pool": {
    "anti-affinity-groups": [
      {
        "id": "string"
      }
    ],
    "application-consistent-snapshot-enabled": true,
    "deploy-target": {
      "id": "string"
    },
    "description": "string",
    "disk-size": 0,
    "elastic-ips": [
      {
        "id": "string"
      }
    ],
    "id": "string",
    "instance-prefix": "string",
    "instance-type": {
      "id": "string"
    },
    "instances": [
      {
        "id": "string"
      }
    ],
    "ipv6-enabled": true,
    "labels": {},
    "manager": {
      "id": "string",
      "type": "sks-nodepool"
    },
    "min-available": 0,
    "name": "string",
    "private-networks": [
      {
        "id": "string"
      }
    ],
    "public-ip-assignment": "inet4",
    "security-groups": [
      {
        "id": "string"
      }
    ],
    "size": 0,
    "ssh-key": {
      "name": "string"
    },
    "ssh-keys": [
      {
        "name": "string"
      }
    ],
    "state": "scaling-up",
    "template": {
      "id": "string"
    },
    "user-data": "string"
  },
  "name": "string",
  "port": 0,
  "protocol": "tcp",
  "strategy": "round-robin",
  "target-port": 0
}
```
</details>


### Responses

Status: `200` - 200

Content-Type: `application/json`

| Property | Type | Description |
| --- | --- | --- |
| `id` | string | Operation ID<br/><br/>Must be a valid UUID. |
| `message` | string | Operation message |
| `reason` | string | Operation failure reason<br/><br/>Allowed values: `incorrect`, `unknown`, `unavailable`, `forbidden`, `busy`, `fault`, `partial`, `not-found`, `interrupted`, `unsupported`, `conflict`. |
| `reference` | [Reference](/reference/api/_schemas/operation/#reference) | Related resource reference |
| `state` | string | Operation status<br/><br/>Allowed values: `failure`, `pending`, `success`, `timeout`. |

<details>
<summary>Example output</summary>

```json
{
  "id": "string",
  "message": "string",
  "reason": "incorrect",
  "reference": {
    "command": "string",
    "id": "string",
    "link": "string"
  },
  "state": "failure"
}
```
</details>


SDK reference for `add-service-to-load-balancer`: [golang](https://pkg.go.dev/github.com/exoscale/egoscale/v3#Client.AddServiceToLoadBalancer) | [Python](https://exoscale.github.io/python-exoscale/v2.html#exoscale.api.v2.Client.add_service_to_load_balancer) | [Java](https://exoscale.github.io/exoscale-sdk-java/com/exoscale/sdk/api/ExoscaleApi.html#addServiceToLoadBalancer(java.util.UUID,com.exoscale.sdk.model.AddServiceToLoadBalancerRequest))

[CLI](https://community.exoscale.com/tools/command-line-interface/): `exo api add-service-to-load-balancer`


