# Network › vRack › Attached services › Dedicated servers 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

> 10 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/vrack/attached-services/dedicated-servers/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/network/vrack/attached-services/dedicated-servers.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/network/vrack/attached-services/dedicated-servers.json?format=openapi3

## Operations

- `GET /vrack/{serviceName}/dedicatedServerInterface` — List server interfaces. Returns the dedicated server network interfaces attached to the vRack.
- `GET /vrack/{serviceName}/dedicatedServerInterface/{dedicatedServerInterface}` — Get a server interface. Returns the attached interface and its vRack.
- `POST /vrack/{serviceName}/dedicatedServerInterface` — Attach a server interface
- `DELETE /vrack/{serviceName}/dedicatedServerInterface/{dedicatedServerInterface}` — Detach a server interface. Detaches the interface from the vRack. Returns the task that performs it.
- `GET /vrack/{serviceName}/dedicatedServerInterfaceDetails` — List server interface details. Returns the attached interfaces with the server each one belongs to.
- `GET /vrack/{serviceName}/dedicatedServer` — List servers (legacy)
- `GET /vrack/{serviceName}/dedicatedServer/{dedicatedServer}` — Get a server link (legacy)
- `POST /vrack/{serviceName}/dedicatedServer` — Attach a server (legacy)
- `DELETE /vrack/{serviceName}/dedicatedServer/{dedicatedServer}` — Detach a server (legacy)
- `GET /vrack/{serviceName}/dedicatedServer/{dedicatedServer}/mrtg` — Get traffic graph values (deprecated)

## List server interfaces. Returns the dedicated server network interfaces attached to the vRack.

`GET /1.0/vrack/{serviceName}/dedicatedServerInterface`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#get-vrack-servicename-dedicatedserverinterface

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServerInterface/get`

### Parameters

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

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Get a server interface. Returns the attached interface and its vRack.

`GET /1.0/vrack/{serviceName}/dedicatedServerInterface/{dedicatedServerInterface}`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#get-vrack-servicename-dedicatedserverinterface-dedicatedserverinterface

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServerInterface/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `dedicatedServerInterface` | path | string | yes | Dedicated Server Interface |
| `serviceName` | path | string | yes | The internal name of your vrack |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vrack.dedicatedServerInterface | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dedicatedServerInterface` | string | read-only | Dedicated Server Interface |
| `vrack` | string | read-only | vrack name |

```json
{
  "dedicatedServerInterface": "string",
  "vrack": "string"
}
```

### Example

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

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

print_r($result);
?>
```

## Attach a server interface

`POST /1.0/vrack/{serviceName}/dedicatedServerInterface`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#post-vrack-servicename-dedicatedserverinterface

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServerInterface/attach`, `dedicatedServer:apiovh:vrack/attach`

Attach a server interface. Attaches a dedicated server network interface to the vRack. Returns the task that performs it.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dedicatedServerInterface` | string | yes | Dedicated server interface to add |

```json
{
  "dedicatedServerInterface": "string"
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `function` | string | read-only |  |
| `id` | integer | read-only |  |
| `lastUpdate` | string (date-time) | read-only |  |
| `orderId` | integer | read-only |  |
| `serviceName` | string | read-only |  |
| `status` | vrack.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `init`, `todo` |
| `targetDomain` | string | read-only |  |
| `todoDate` | string (date-time) | read-only |  |

```json
{
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "orderId": 0,
  "serviceName": "string",
  "status": "cancelled",
  "targetDomain": "string",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/vrack/{serviceName}/dedicatedServerInterface" \
  -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("/vrack/{serviceName}/dedicatedServerInterface",
	dedicatedServerInterface = None, # Dedicated server interface to add  (type: string)
)

# 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("/vrack/{serviceName}/dedicatedServerInterface", array(
	dedicatedServerInterface => null, // Dedicated server interface to add  (type: string)
));

print_r($result);
?>
```

## Detach a server interface. Detaches the interface from the vRack. Returns the task that performs it.

`DELETE /1.0/vrack/{serviceName}/dedicatedServerInterface/{dedicatedServerInterface}`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#delete-vrack-servicename-dedicatedserverinterface-dedicatedserverinterface

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServerInterface/detach`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `dedicatedServerInterface` | path | string | yes | Dedicated Server Interface |
| `serviceName` | path | string | yes | The internal name of your vrack |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `function` | string | read-only |  |
| `id` | integer | read-only |  |
| `lastUpdate` | string (date-time) | read-only |  |
| `orderId` | integer | read-only |  |
| `serviceName` | string | read-only |  |
| `status` | vrack.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `init`, `todo` |
| `targetDomain` | string | read-only |  |
| `todoDate` | string (date-time) | read-only |  |

```json
{
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "orderId": 0,
  "serviceName": "string",
  "status": "cancelled",
  "targetDomain": "string",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

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

print_r($result);
?>
```

## List server interface details. Returns the attached interfaces with the server each one belongs to.

`GET /1.0/vrack/{serviceName}/dedicatedServerInterfaceDetails`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#get-vrack-servicename-dedicatedserverinterfacedetails

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServerInterfaceDetails/get`

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vrack.AllowedDedicatedServerInterfaces[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dedicatedServer` | string |  | the name of dedicatedServer |
| `dedicatedServerInterface` | string |  | the unique identifier of dedicatedServerInterface |
| `name` | string |  | the name of dedicatedServerInterface |

```json
[
  {
    "dedicatedServer": "string",
    "dedicatedServerInterface": "string",
    "name": "string"
  }
]
```

### Example

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

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

print_r($result);
?>
```

## List servers (legacy)

`GET /1.0/vrack/{serviceName}/dedicatedServer`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#get-vrack-servicename-dedicatedserver

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServer/get`

List servers (legacy). Returns the dedicated servers attached as a whole to the vRack, in the legacy mode. Attaching by interface replaces it.

### Parameters

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

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Get a server link (legacy)

`GET /1.0/vrack/{serviceName}/dedicatedServer/{dedicatedServer}`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#get-vrack-servicename-dedicatedserver-dedicatedserver

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServer/get`

Get a server link (legacy). Returns the attached server and its vRack. This is the legacy whole-server link, not an interface link.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `dedicatedServer` | path | string | yes | Dedicated Server |
| `serviceName` | path | string | yes | The internal name of your vrack |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vrack.dedicatedServer | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dedicatedServer` | string | read-only | Dedicated Server |
| `vrack` | string | read-only | vrack name |

```json
{
  "dedicatedServer": "string",
  "vrack": "string"
}
```

### Example

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

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

print_r($result);
?>
```

## Attach a server (legacy)

`POST /1.0/vrack/{serviceName}/dedicatedServer`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#post-vrack-servicename-dedicatedserver

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServer/attach`, `dedicatedServer:apiovh:vrack/attach`

Attach a server (legacy). Attaches a whole dedicated server to the vRack, in the legacy mode. Prefer attaching one of its interfaces. Returns the task that performs it.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `dedicatedServer` | string | yes | Dedicated server to add |

```json
{
  "dedicatedServer": "string"
}
```

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `function` | string | read-only |  |
| `id` | integer | read-only |  |
| `lastUpdate` | string (date-time) | read-only |  |
| `orderId` | integer | read-only |  |
| `serviceName` | string | read-only |  |
| `status` | vrack.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `init`, `todo` |
| `targetDomain` | string | read-only |  |
| `todoDate` | string (date-time) | read-only |  |

```json
{
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "orderId": 0,
  "serviceName": "string",
  "status": "cancelled",
  "targetDomain": "string",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/vrack/{serviceName}/dedicatedServer" \
  -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("/vrack/{serviceName}/dedicatedServer",
	dedicatedServer = None, # Dedicated server to add  (type: string)
)

# 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("/vrack/{serviceName}/dedicatedServer", array(
	dedicatedServer => null, // Dedicated server to add  (type: string)
));

print_r($result);
?>
```

## Detach a server (legacy)

`DELETE /1.0/vrack/{serviceName}/dedicatedServer/{dedicatedServer}`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#delete-vrack-servicename-dedicatedserver-dedicatedserver

**Status:** Stable production version  
**IAM actions:** `vrack:apiovh:dedicatedServer/detach`

Detach a server (legacy). Detaches a whole dedicated server from the vRack, in the legacy mode. Returns the task that performs it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `dedicatedServer` | path | string | yes | Dedicated Server |
| `serviceName` | path | string | yes | The internal name of your vrack |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `function` | string | read-only |  |
| `id` | integer | read-only |  |
| `lastUpdate` | string (date-time) | read-only |  |
| `orderId` | integer | read-only |  |
| `serviceName` | string | read-only |  |
| `status` | vrack.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `init`, `todo` |
| `targetDomain` | string | read-only |  |
| `todoDate` | string (date-time) | read-only |  |

```json
{
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "orderId": 0,
  "serviceName": "string",
  "status": "cancelled",
  "targetDomain": "string",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

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

print_r($result);
?>
```

## Get traffic graph values (deprecated)

`GET /1.0/vrack/{serviceName}/dedicatedServer/{dedicatedServer}/mrtg`

Link: https://developers.eu.ovhcloud.com/reference/network/vrack/attached-services/dedicated-servers/#get-vrack-servicename-dedicatedserver-dedicatedserver-mrtg

**Status:** Deprecated, will be removed  
**Deprecated** since 2017-10-23, removed on 2018-04-23; use `/dedicated/server/{serviceName}/networkInterfaceController` instead.  
**IAM actions:** `vrack:apiovh:dedicatedServer/mrtg/get`

Get traffic graph values (deprecated). Returns the traffic, packets or errors measured on the vRack port of the server, for a period from hourly to yearly. Deprecated: use the dedicated server statistics instead.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `dedicatedServer` | path | string | yes | Dedicated Server |
| `period` | query | dedicated.server.MrtgPeriodEnum | yes | mrtg period — one of `daily`, `hourly`, `monthly`, `weekly`, `yearly` |
| `serviceName` | path | string | yes | The internal name of your vrack |
| `type` | query | dedicated.server.MrtgTypeEnum | yes | mrtg type — one of `errors:download`, `errors:upload`, `packets:download`, `packets:upload`, `traffic:download`, `traffic:upload` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicated.server.MrtgTimestampValue[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `timestamp` | integer |  |  |
| `value` | complexType.UnitAndValue_double |  | A numeric value tagged with its unit |
| `value.unit` | string |  |  |
| `value.value` | number |  |  |

```json
[
  {
    "timestamp": 0,
    "value": {
      "unit": "string",
      "value": 0
    }
  }
]
```

### Example

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

# 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("/vrack/{serviceName}/dedicatedServer/{dedicatedServer}/mrtg");

print_r($result);
?>
```
