# Network › Load Balancer › Configuration API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Network product's sections: https://developers.eu.ovhcloud.com/reference/network/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 5 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/network/load-balancer/configuration/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/network/load-balancer/configuration.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/network/load-balancer/configuration.json?format=openapi3

## Operations

- `GET /ipLoadbalancing/{serviceName}/pendingChanges` — List pending changes per zone
- `POST /ipLoadbalancing/{serviceName}/refresh` — Apply the configuration
- `GET /ipLoadbalancing/{serviceName}/definedFrontends` — List defined frontends and their type
- `GET /ipLoadbalancing/{serviceName}/definedFarms` — List defined farms and their type
- `GET /ipLoadbalancing/{serviceName}/definedRoutes` — List defined routes and their type

## List pending changes per zone

`GET /1.0/ipLoadbalancing/{serviceName}/pendingChanges`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/configuration/#get-iploadbalancing-servicename-pendingchanges

**Status:** Stable production version  
**IAM actions:** `loadbalancer:apiovh:pendingChanges/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your IP load balancing |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipLoadbalancing.PendingChanges[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `number` | integer |  | The number of changes waiting to be applied |
| `zone` | string |  | The Load Balancer zone with pending changes |

```json
[
  {
    "number": 0,
    "zone": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/pendingChanges" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ipLoadbalancing/{serviceName}/pendingChanges")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ipLoadbalancing/{serviceName}/pendingChanges");

print_r($result);
?>
```

## Apply the configuration

`POST /1.0/ipLoadbalancing/{serviceName}/refresh`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/configuration/#post-iploadbalancing-servicename-refresh

**Status:** Stable production version  
**IAM actions:** `loadbalancer:apiovh:refresh`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your IP load balancing |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `zone` | string |  | The zone(s) of your iplb |

```json
{
  "zone": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipLoadbalancing.Task.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | ipLoadbalancing.TaskActionEnum | read-only | Operation type — one of `deleteIplb`, `deployIplb`, `install`, `installIplb`, `installZone`, `orderFreeCertificate`, `orderPaidCertificate`, `orderSsl`, `refreshIplb`, `releaseIplb`, `releaseIplbZone`, `reopenIplb`, … |
| `creationDate` | string (date-time) | read-only | Creation date of your operation |
| `doneDate` | string (date-time) | read-only | Done date of your operation |
| `id` | integer | read-only | Id of the operation |
| `progress` | integer | read-only | Operation progress percentage |
| `status` | ipLoadbalancing.TaskStatusEnum | read-only | Current status of your operation — one of `blocked`, `cancelled`, `doing`, `done`, `error`, `todo` |
| `zones` | string[] | read-only | Zone of your Load Balancer which are updated by current Task |

```json
{
  "action": "deleteIplb",
  "creationDate": "2024-01-01T12:00:00Z",
  "doneDate": "2024-01-01T12:00:00Z",
  "id": 0,
  "progress": 0,
  "status": "blocked",
  "zones": [
    "string"
  ]
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/refresh" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: string
result = client.post("/ipLoadbalancing/{serviceName}/refresh",
	zone = None, # The zone(s) of your iplb (type: string, nullable)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: string
$result = $ovh->post("/ipLoadbalancing/{serviceName}/refresh", array(
	zone => null, // The zone(s) of your iplb (type: string, nullable)
));

print_r($result);
?>
```

## List defined frontends and their type

`GET /1.0/ipLoadbalancing/{serviceName}/definedFrontends`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/configuration/#get-iploadbalancing-servicename-definedfrontends

**Status:** Stable production version  
**IAM actions:** `loadbalancer:apiovh:definedFrontends/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your IP load balancing |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipLoadbalancing.DefinedFrontend[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer |  |  |
| `type` | string |  |  |

```json
[
  {
    "id": 0,
    "type": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/definedFrontends" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ipLoadbalancing/{serviceName}/definedFrontends")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ipLoadbalancing/{serviceName}/definedFrontends");

print_r($result);
?>
```

## List defined farms and their type

`GET /1.0/ipLoadbalancing/{serviceName}/definedFarms`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/configuration/#get-iploadbalancing-servicename-definedfarms

**Status:** Stable production version  
**IAM actions:** `loadbalancer:apiovh:definedFarms/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your IP load balancing |
| `vrackNetworkId` | query | integer |  | The vrack network id you want to filter on |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipLoadbalancing.DefinedFarm[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer |  |  |
| `type` | string |  |  |

```json
[
  {
    "id": 0,
    "type": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/definedFarms" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ipLoadbalancing/{serviceName}/definedFarms")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ipLoadbalancing/{serviceName}/definedFarms");

print_r($result);
?>
```

## List defined routes and their type

`GET /1.0/ipLoadbalancing/{serviceName}/definedRoutes`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/configuration/#get-iploadbalancing-servicename-definedroutes

**Status:** Stable production version  
**IAM actions:** `loadbalancer:apiovh:definedRoutes/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your IP load balancing |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | ipLoadbalancing.DefinedRoute[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `displayName` | string |  | Human readable name for your route |
| `routeId` | integer |  | Id of your route |
| `type` | string |  | Protocol supported by this route |

```json
[
  {
    "displayName": "string",
    "routeId": 0,
    "type": "string"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/definedRoutes" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/ipLoadbalancing/{serviceName}/definedRoutes")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/ipLoadbalancing/{serviceName}/definedRoutes");

print_r($result);
?>
```
