# Bare Metal Cloud › VPS › Catalog 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

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

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

## Operations

- `GET /vps/datacenter` — List all VPS datacenters available for the given country
- `GET /vps/order/rule/datacenter` — List datacenters with priority and stock status for a VPS order
- `GET /vps/order/rule/datacenter/aggregated` — List datacenters with priority and stock status for every VPS model and storage option

## List all VPS datacenters available for the given country

`GET /1.0/vps/datacenter`

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

**Status:** Stable production version  
**Authentication:** none (public operation)

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `country` | query | nichandle.CountryEnum |  | Country targeted — one of `AC`, `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AO`, `AQ`, `AR`, `AS`, … |

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## List datacenters with priority and stock status for a VPS order

`GET /1.0/vps/order/rule/datacenter`

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

**Status:** Stable production version  
**Authentication:** none (public operation)

Returns the datacenters available for a VPS order, with their priority and stock status.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `os` | query | string |  | VPS OS selection in order api |
| `ovhSubsidiary` | query | nichandle.OvhSubsidiaryEnum | yes | Subsidiary to sort datacenters — one of `CZ`, `DE`, `ES`, `EU`, `FI`, `FR`, `GB`, `IE`, `IT`, `LT`, `MA`, `NL`, … |
| `planCode` | query | string | yes | VPS plan code from order api |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vps.order.rule.Datacenters | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `datacenters` | vps.order.rule.Datacenter[] | read-only |  |
| `datacenters[].code` | string | read-only |  |
| `datacenters[].datacenter` | string | read-only |  |
| `datacenters[].daysBeforeDelivery` | integer | read-only |  |
| `datacenters[].linuxStatus` | vps.order.rule.DatacenterStatusEnum | read-only | Possible values for datacenter status — one of `available`, `out-of-stock`, `out-of-stock-preorder-allowed` |
| `datacenters[].status` | vps.order.rule.DatacenterStatusEnum | read-only | Possible values for datacenter status — one of `available`, `out-of-stock`, `out-of-stock-preorder-allowed` |
| `datacenters[].windowsStatus` | vps.order.rule.DatacenterStatusEnum | read-only | Possible values for datacenter status — one of `available`, `out-of-stock`, `out-of-stock-preorder-allowed` |

```json
{
  "datacenters": [
    {
      "code": "string",
      "datacenter": "string",
      "daysBeforeDelivery": 0,
      "linuxStatus": "available",
      "status": "available",
      "windowsStatus": "available"
    }
  ]
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/vps/order/rule/datacenter" \
  -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/order/rule/datacenter")

# 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/order/rule/datacenter");

print_r($result);
?>
```

## List datacenters with priority and stock status for every VPS model and storage option

`GET /1.0/vps/order/rule/datacenter/aggregated`

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

**Status:** Stable production version  
**Authentication:** none (public operation)

Returns, for every VPS model, the datacenters available for an order with their priority and stock status.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ovhSubsidiary` | query | nichandle.OvhSubsidiaryEnum | yes | Subsidiary to sort datacenters — one of `CZ`, `DE`, `ES`, `EU`, `FI`, `FR`, `GB`, `IE`, `IT`, `LT`, `MA`, `NL`, … |
| `planCodes` | query | string | yes | Comma separated VPS plan codes from order api to answer for |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | vps.order.rule.AggregatedDatacenters | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `models` | vps.order.rule.ModelDatacenters[] | read-only | Datacenters rules of every requested VPS model |
| `models[].datacenters` | vps.order.rule.ModelDatacenter[] | read-only | Datacenters rules of the model, one entry per datacenter and way of delivering it |
| `models[].datacenters[].code` | string | read-only | Datacenter code to give to order api |
| `models[].datacenters[].datacenter` | string | read-only | Name of the datacenter |
| `models[].datacenters[].daysBeforeDelivery` | integer | read-only | Number of days before delivery, for a preorder |
| `models[].datacenters[].linuxStatus` | vps.order.rule.DatacenterStatusEnum | read-only | Stock status of the datacenter for a Linux delivery — one of `available`, `out-of-stock`, `out-of-stock-preorder-allowed` |
| `models[].datacenters[].remoteStorage` | boolean | read-only | Whether these rules apply to the model delivered with remote storage |
| `models[].datacenters[].status` | vps.order.rule.DatacenterStatusEnum | read-only | Stock status of the datacenter for any distribution — one of `available`, `out-of-stock`, `out-of-stock-preorder-allowed` |
| `models[].datacenters[].windowsStatus` | vps.order.rule.DatacenterStatusEnum | read-only | Stock status of the datacenter for a Windows delivery — one of `available`, `out-of-stock`, `out-of-stock-preorder-allowed` |
| `models[].planCode` | string | read-only | VPS plan code from order api these rules apply to |

```json
{
  "models": [
    {
      "datacenters": [
        {
          "code": "string",
          "datacenter": "string",
          "daysBeforeDelivery": 0,
          "linuxStatus": "available",
          "remoteStorage": true,
          "status": "available",
          "windowsStatus": "available"
        }
      ],
      "planCode": "string"
    }
  ]
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/vps/order/rule/datacenter/aggregated" \
  -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/order/rule/datacenter/aggregated")

# 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/order/rule/datacenter/aggregated");

print_r($result);
?>
```
