# Network › Load Balancer › Quotas 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/quotas/

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

## Operations

- `GET /ipLoadbalancing/{serviceName}/quota` — List quotas per zone
- `GET /ipLoadbalancing/{serviceName}/quota/{zone}` — Get a zone quota
- `PUT /ipLoadbalancing/{serviceName}/quota/{zone}` — Update a zone quota
- `GET /ipLoadbalancing/{serviceName}/quotaHistory` — List quota history per month
- `GET /ipLoadbalancing/{serviceName}/quotaHistory/{id}` — Get a monthly quota history

## List quotas per zone

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

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

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

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string[] | successful operation |

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/quota" \
  -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}/quota")

# 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}/quota");

print_r($result);
?>
```

## Get a zone quota

`GET /1.0/ipLoadbalancing/{serviceName}/quota/{zone}`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/quotas/#get-iploadbalancing-servicename-quota-zone

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

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alert` | integer |  | Quota alert value in bytes. When reached, we will send you an alert. Default : included quota with your offer |
| `included` | integer | read-only | Included quota value with your offer, in bytes |
| `lastUpdateDate` | string (date-time) | read-only | The last time your quota was updated from your Load Balancer instance |
| `resetDate` | string (date-time) | read-only | The last time your quota was resetted (billed) |
| `total` | integer | read-only | Total used quota value in bytes |
| `zone` | string | read-only | Zone of your quota |

```json
{
  "alert": 0,
  "included": 0,
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "resetDate": "2024-01-01T12:00:00Z",
  "total": 0,
  "zone": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/quota/{zone}" \
  -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}/quota/{zone}")

# 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}/quota/{zone}");

print_r($result);
?>
```

## Update a zone quota

`PUT /1.0/ipLoadbalancing/{serviceName}/quota/{zone}`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/quotas/#put-iploadbalancing-servicename-quota-zone

**Status:** Stable production version  
**IAM actions:** `loadbalancer:apiovh:quota/edit`

### Parameters

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

### Request body (required)

Type: `ipLoadbalancing.Quota.Quota`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alert` | integer |  | Quota alert value in bytes. When reached, we will send you an alert. Default : included quota with your offer |
| `included` | integer | read-only | Included quota value with your offer, in bytes |
| `lastUpdateDate` | string (date-time) | read-only | The last time your quota was updated from your Load Balancer instance |
| `resetDate` | string (date-time) | read-only | The last time your quota was resetted (billed) |
| `total` | integer | read-only | Total used quota value in bytes |
| `zone` | string | read-only | Zone of your quota |

```json
{
  "alert": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/quota/{zone}" \
  -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: ipLoadbalancing.Quota.Quota
result = client.put("/ipLoadbalancing/{serviceName}/quota/{zone}",
	alert = None, # Quota alert value in bytes. When reached, we will send you an alert. Default : included quota with your offer (type: integer, 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: ipLoadbalancing.Quota.Quota
$result = $ovh->put("/ipLoadbalancing/{serviceName}/quota/{zone}", array(
	alert => null, // Quota alert value in bytes. When reached, we will send you an alert. Default : included quota with your offer (type: integer, nullable)
));

print_r($result);
?>
```

## List quota history per month

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

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

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

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `historizedDate.from` | query | string (date) |  | Filter the value of historizedDate property (>=) |
| `historizedDate.to` | query | string (date) |  | Filter the value of historizedDate property (<=) |
| `serviceName` | path | string | yes | The internal name of your IP load balancing |
| `zone` | query | string |  | Filter the value of zone property (=) |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | integer[] | successful operation |

```json
[
  0
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/quotaHistory" \
  -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}/quotaHistory")

# 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}/quotaHistory");

print_r($result);
?>
```

## Get a monthly quota history

`GET /1.0/ipLoadbalancing/{serviceName}/quotaHistory/{id}`

Link: https://developers.eu.ovhcloud.com/reference/network/load-balancer/quotas/#get-iploadbalancing-servicename-quotahistory-id

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

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `historizedDate` | string (date) | read-only | Historized date for this quota entry |
| `id` | integer | read-only | Id of your quota |
| `lastUpdateDate` | string (date-time) | read-only | The last time your quota was updated from your Load Balancer instance |
| `resetDate` | string (date-time) | read-only | The last time your quota was resetted (billed) |
| `total` | integer | read-only | Total used quota value in bytes |
| `zone` | string | read-only | Zone of your quota |

```json
{
  "historizedDate": "2024-01-01",
  "id": 0,
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "resetDate": "2024-01-01T12:00:00Z",
  "total": 0,
  "zone": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/ipLoadbalancing/{serviceName}/quotaHistory/{id}" \
  -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}/quotaHistory/{id}")

# 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}/quotaHistory/{id}");

print_r($result);
?>
```
