# Web Cloud › OverTheBox › Service › IP API

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

> 3 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/web-cloud/overthebox/service/ip/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/overthebox/service/ip.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/overthebox/service/ip.json?format=openapi3

## Operations

- `GET /overTheBox/{serviceName}/ips` — List the IPs of an OverTheBox service
- `GET /overTheBox/{serviceName}/ips/{ip}` — Get an IP of an OverTheBox service
- `PUT /overTheBox/{serviceName}/ipv6` — Update the IPv6 status of an OverTheBox service

## List the IPs of an OverTheBox service

`GET /1.0/overTheBox/{serviceName}/ips`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/service/ip/#get-overthebox-servicename-ips

**Status:** Beta version  
**IAM actions:** `overTheBox:apiovh:ips/get`

Returns the IP addresses attached to the OverTheBox service. Get an IP for its version, prefix, status and geolocation.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |

### Responses

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

```json
[
  "192.0.2.0"
]
```

### Example

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

# 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("/overTheBox/{serviceName}/ips");

print_r($result);
?>
```

## Get an IP of an OverTheBox service

`GET /1.0/overTheBox/{serviceName}/ips/{ip}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/service/ip/#get-overthebox-servicename-ips-ip

**Status:** Beta version  
**IAM actions:** `overTheBox:apiovh:ips/get`

Returns an IP address of the OverTheBox service with its version (v4 or v6), CIDR prefix, status and geolocation.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ip` | path | ip | yes | Ip |
| `serviceName` | path | string | yes | Service name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | otb.service.ip | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `geolocation` | otb.service.ip.geolocationEnum | read-only | IP geolocation — one of `fr` |
| `ip` | ip | read-only | IP address |
| `range` | integer | read-only | IP cidr prefix |
| `status` | otb.service.ip.statusEnum | read-only | IP status — one of `active`, `free`, `pendingRelease`, `released`, `reserved` |
| `version` | otb.service.ip.versionEnum | read-only | IP version — one of `v4`, `v6` |

```json
{
  "geolocation": "fr",
  "ip": "192.0.2.0",
  "range": 0,
  "status": "active",
  "version": "v4"
}
```

### Example

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

# 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("/overTheBox/{serviceName}/ips/{ip}");

print_r($result);
?>
```

## Update the IPv6 status of an OverTheBox service

`PUT /1.0/overTheBox/{serviceName}/ipv6`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/overthebox/service/ip/#put-overthebox-servicename-ipv6

**Status:** Beta version  
**IAM actions:** `overTheBox:apiovh:ipv6/edit`

Update the IPv6 status of an OverTheBox service. Enables or disables IPv6 on the service and returns the task that performs the change.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your overTheBox offer |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `enabled` | boolean | yes | Enabled/disabled IPv6 |

```json
{
  "enabled": true
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | read-only | The name of the task |
| `status` | overTheBox.TaskStatusEnum | read-only | The status of the task — one of `doing`, `done`, `error`, `todo` |
| `taskId` | string | read-only | The id of the task |

```json
{
  "name": "string",
  "status": "doing",
  "taskId": "string"
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/overTheBox/{serviceName}/ipv6" \
  -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: boolean
result = client.put("/overTheBox/{serviceName}/ipv6",
	enabled = None, # Enabled/disabled IPv6 (type: boolean)
)

# 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: boolean
$result = $ovh->put("/overTheBox/{serviceName}/ipv6", array(
	enabled => null, // Enabled/disabled IPv6 (type: boolean)
));

print_r($result);
?>
```
