# Bare Metal Cloud › VPS › Network API

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

> 11 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/bare-metal-cloud/vps/network/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/bare-metal-cloud/vps/network.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/bare-metal-cloud/vps/network.json?format=openapi3

## Operations

- `GET /vps/{serviceName}/ips` — List IPs attached to this VPS
- `GET /vps/{serviceName}/ipCountryAvailable` — List the available countries for IP geolocation (GeoIP) on this VPS
- `GET /vps/{serviceName}/secondaryDnsDomains` — List domains configured on secondary DNS for this VPS
- `GET /vps/{serviceName}/ips/{ipAddress}` — Retrieve details about a specific IP attached to this VPS
- `GET /vps/{serviceName}/secondaryDnsDomains/{domain}` — Retrieve the secondary DNS configuration for a specific domain
- `GET /vps/{serviceName}/secondaryDnsDomains/{domain}/dnsServer` — Retrieve the authoritative name server information for this secondary DNS domain
- `GET /vps/{serviceName}/secondaryDnsNameServerAvailable` — Retrieve the secondary DNS name server available for this VPS
- `POST /vps/{serviceName}/secondaryDnsDomains` — Add a domain to the secondary DNS configuration
- `DELETE /vps/{serviceName}/ips/{ipAddress}` — Release an additional IP attached to this VPS
- `DELETE /vps/{serviceName}/secondaryDnsDomains/{domain}` — Remove this domain from the secondary DNS configuration
- `PUT /vps/{serviceName}/ips/{ipAddress}` — Update IP properties for this VPS

## List IPs attached to this VPS

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

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#listVpsIps

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:ips/get`

Returns the IP addresses attached to the VPS.

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

print_r($result);
?>
```

## List the available countries for IP geolocation (GeoIP) on this VPS

`GET /1.0/vps/{serviceName}/ipCountryAvailable`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#getVpsIpCountryAvailable

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:ipCountryAvailable/get`

Returns the countries that can be set for the geolocation of the VPS IPs.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vps.ip.GeolocationEnum[] | successful operation |

```json
[
  "at"
]
```

### Example

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

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

print_r($result);
?>
```

## List domains configured on secondary DNS for this VPS

`GET /1.0/vps/{serviceName}/secondaryDnsDomains`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#listVpsSecondaryDnsDomains

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:secondaryDnsDomains/get`

Returns the domains configured on the secondary DNS of the VPS.

### Parameters

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

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Retrieve details about a specific IP attached to this VPS

`GET /1.0/vps/{serviceName}/ips/{ipAddress}`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#getVpsIp

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:ips/get`

Returns the IP address, its type and version, reverse DNS, geolocation, gateway and MAC address.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vps.Ip | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `gateway` | ip | read-only | IP address (e.g., 192.0.2.0) |
| `geolocation` | vps.ip.GeolocationEnum | read-only | Geolocation of the IP Address — one of `at`, `au`, `be`, `ca`, `ch`, `cz`, `de`, `es`, `fi`, `fr`, `gb`, `ie`, … |
| `ipAddress` | ip | read-only | The effective ip address of the Ip object |
| `macAddress` | string | read-only |  |
| `reverse` | string |  |  |
| `type` | vps.ip.TypeEnum | read-only | Ip types on a VPS — one of `additional`, `primary` |
| `version` | coreTypes.IpVersionEnum | read-only | Ip versions — one of `v4`, `v6` |

```json
{
  "gateway": "192.0.2.0",
  "geolocation": "at",
  "ipAddress": "192.0.2.0",
  "macAddress": "string",
  "reverse": "string",
  "type": "additional",
  "version": "v4"
}
```

### Example

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

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

print_r($result);
?>
```

## Retrieve the secondary DNS configuration for a specific domain

`GET /1.0/vps/{serviceName}/secondaryDnsDomains/{domain}`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#getVpsSecondaryDnsDomain

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:secondaryDnsDomains/get`

Returns the domain, the target IP and the master IP of a secondary DNS domain of the VPS.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | secondaryDns.SecondaryDNS | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only |  |
| `dns` | string | read-only | secondary dns server |
| `domain` | string | read-only | domain on slave server |
| `ipMaster` | ipv4 | read-only | IPv4 address (e.g., 192.0.2.0) |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "dns": "string",
  "domain": "string",
  "ipMaster": "192.0.2.0"
}
```

### Example

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

# 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("/vps/{serviceName}/secondaryDnsDomains/{domain}");

print_r($result);
?>
```

## Retrieve the authoritative name server information for this secondary DNS domain

`GET /1.0/vps/{serviceName}/secondaryDnsDomains/{domain}/dnsServer`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#getVpsSecondaryDnsNameServer

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:secondaryDnsDomains/dnsServer/get`

Returns the name and the IP of the authoritative name server of a secondary DNS domain of the VPS.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | secondaryDns.SecondaryDNSNameServer | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hostname` | string | read-only | the name server |
| `ip` | ipv4 | read-only | IPv4 address (e.g., 192.0.2.0) |
| `ipv6` | ipv6 | read-only | IPv6 address (e.g., 2001:41d0:1:1994::1) |

```json
{
  "hostname": "string",
  "ip": "192.0.2.0",
  "ipv6": "2001:41d0:1:1994::1"
}
```

### Example

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

# 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("/vps/{serviceName}/secondaryDnsDomains/{domain}/dnsServer");

print_r($result);
?>
```

## Retrieve the secondary DNS name server available for this VPS

`GET /1.0/vps/{serviceName}/secondaryDnsNameServerAvailable`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#getVpsSecondaryDnsNameServerAvailable

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:secondaryDnsNameServerAvailable/get`

Returns the name and the IP of the secondary DNS name server available for the VPS.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | secondaryDns.SecondaryDNSNameServer | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hostname` | string | read-only | the name server |
| `ip` | ipv4 | read-only | IPv4 address (e.g., 192.0.2.0) |
| `ipv6` | ipv6 | read-only | IPv6 address (e.g., 2001:41d0:1:1994::1) |

```json
{
  "hostname": "string",
  "ip": "192.0.2.0",
  "ipv6": "2001:41d0:1:1994::1"
}
```

### Example

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

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

print_r($result);
?>
```

## Add a domain to the secondary DNS configuration

`POST /1.0/vps/{serviceName}/secondaryDnsDomains`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#createVpsSecondaryDnsDomain

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:secondaryDnsDomains/create`

Adds a domain to the secondary DNS of the VPS.

### Parameters

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

### Request body (required)

Type: `vps.secondaryDnsDomains.post`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes | The domain to add |
| `ip` | ipv4 |  | IPv4 address (e.g., 192.0.2.0) |

```json
{
  "domain": "string",
  "ip": "192.0.2.0"
}
```

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/vps/{serviceName}/secondaryDnsDomains" \
  -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: vps.secondaryDnsDomains.post
result = client.post("/vps/{serviceName}/secondaryDnsDomains",
	domain = None, # The domain to add (type: string)
	ip = None, # IPv4 address (e.g., 192.0.2.0) (type: ipv4)
)

# 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: vps.secondaryDnsDomains.post
$result = $ovh->post("/vps/{serviceName}/secondaryDnsDomains", array(
	domain => null, // The domain to add (type: string)
	ip => null, // IPv4 address (e.g., 192.0.2.0) (type: ipv4)
));

print_r($result);
?>
```

## Release an additional IP attached to this VPS

`DELETE /1.0/vps/{serviceName}/ips/{ipAddress}`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#deleteVpsIp

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:ips/delete`

Releases an additional IP from the VPS.

### Parameters

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

### Responses

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

### Example

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

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

print_r($result);
?>
```

## Remove this domain from the secondary DNS configuration

`DELETE /1.0/vps/{serviceName}/secondaryDnsDomains/{domain}`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#deleteVpsSecondaryDnsDomain

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:secondaryDnsDomains/delete`

Removes a domain from the secondary DNS of the VPS.

### Parameters

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

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/vps/{serviceName}/secondaryDnsDomains/{domain}" \
  -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.delete("/vps/{serviceName}/secondaryDnsDomains/{domain}")

# 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->delete("/vps/{serviceName}/secondaryDnsDomains/{domain}");

print_r($result);
?>
```

## Update IP properties for this VPS

`PUT /1.0/vps/{serviceName}/ips/{ipAddress}`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/vps/network/#editVpsIp

**Status:** Stable production version  
**IAM actions:** `vps:apiovh:ips/edit`

Updates the reverse DNS of an IP of the VPS.

### Parameters

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

### Request body (required)

Type: `vps.Ip`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `gateway` | ip | read-only | IP address (e.g., 192.0.2.0) |
| `geolocation` | vps.ip.GeolocationEnum | read-only | Geolocation of the IP Address — one of `at`, `au`, `be`, `ca`, `ch`, `cz`, `de`, `es`, `fi`, `fr`, `gb`, `ie`, … |
| `ipAddress` | ip | read-only | The effective ip address of the Ip object |
| `macAddress` | string | read-only |  |
| `reverse` | string |  |  |
| `type` | vps.ip.TypeEnum | read-only | Ip types on a VPS — one of `additional`, `primary` |
| `version` | coreTypes.IpVersionEnum | read-only | Ip versions — one of `v4`, `v6` |

```json
{
  "reverse": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/vps/{serviceName}/ips/{ipAddress}" \
  -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: vps.Ip
result = client.put("/vps/{serviceName}/ips/{ipAddress}",
	reverse = None, #  (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: vps.Ip
$result = $ovh->put("/vps/{serviceName}/ips/{ipAddress}", array(
	reverse => null, //  (type: string, nullable)
));

print_r($result);
?>
```
