# Bare Metal Cloud › Dedicated Servers › vRack 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

> 4 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/dedicated-servers/vrack/

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

## Operations

- `GET /dedicated/server/{serviceName}/vrack` — List vRacks (legacy)
- `GET /dedicated/server/{serviceName}/vrack/{vrack}` — Get a server link (legacy)
- `DELETE /dedicated/server/{serviceName}/vrack/{vrack}` — Detach a server (legacy)
- `GET /dedicated/server/{serviceName}/vrack/{vrack}/mrtg` — Get traffic graph values (deprecated)

## List vRacks (legacy)

`GET /1.0/dedicated/server/{serviceName}/vrack`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/dedicated-servers/vrack/#get-dedicated-server-servicename-vrack

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

List vRacks (legacy). Returns the names of the vRacks the server is attached to as a whole, in the legacy mode. To attach a server, prefer attaching one of its interfaces in the vRack.

### Parameters

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

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Get a server link (legacy)

`GET /1.0/dedicated/server/{serviceName}/vrack/{vrack}`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/dedicated-servers/vrack/#get-dedicated-server-servicename-vrack-vrack

**Status:** Stable production version  
**IAM actions:** `dedicatedServer:apiovh:vrack/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 |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your dedicated server |
| `vrack` | path | string | yes | vrack name |

### 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/dedicated/server/{serviceName}/vrack/{vrack}" \
  -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("/dedicated/server/{serviceName}/vrack/{vrack}")

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

print_r($result);
?>
```

## Detach a server (legacy)

`DELETE /1.0/dedicated/server/{serviceName}/vrack/{vrack}`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/dedicated-servers/vrack/#delete-dedicated-server-servicename-vrack-vrack

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

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 |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your dedicated server |
| `vrack` | path | string | yes | vrack name |

### 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/dedicated/server/{serviceName}/vrack/{vrack}" \
  -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("/dedicated/server/{serviceName}/vrack/{vrack}")

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

print_r($result);
?>
```

## Get traffic graph values (deprecated)

`GET /1.0/dedicated/server/{serviceName}/vrack/{vrack}/mrtg`

Link: https://developers.eu.ovhcloud.com/reference/bare-metal-cloud/dedicated-servers/vrack/#get-dedicated-server-servicename-vrack-vrack-mrtg

**Status:** Deprecated, will be removed  
**Deprecated** since 2017-10-23, removed on 2018-04-23; use `/dedicated/server/{serviceName}/networkInterfaceController` instead.  
**IAM actions:** `dedicatedServer:apiovh:vrack/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 |
| --- | --- | --- | --- | --- |
| `period` | query | dedicated.server.MrtgPeriodEnum | yes | mrtg period — one of `daily`, `hourly`, `monthly`, `weekly`, `yearly` |
| `serviceName` | path | string | yes | The internal name of your dedicated server |
| `type` | query | dedicated.server.MrtgTypeEnum | yes | mrtg type — one of `errors:download`, `errors:upload`, `packets:download`, `packets:upload`, `traffic:download`, `traffic:upload` |
| `vrack` | path | string | yes | vrack name |

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

print_r($result);
?>
```
