# Bare Metal Cloud › Dedicated Servers › Interventions 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/interventions/

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

## Operations

- `GET /dedicated/server/{serviceName}/intervention` — List past interventions
- `GET /dedicated/server/{serviceName}/intervention/{interventionId}` — Get a past intervention
- `GET /dedicated/server/{serviceName}/plannedIntervention` — List planned interventions
- `GET /dedicated/server/{serviceName}/plannedIntervention/{interventionId}` — Get a planned intervention

## List past interventions

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

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

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

List past interventions. Returns the IDs of the technical interventions made on the server. Get an intervention to read its start date and type.

### Parameters

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

### Responses

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

```json
[
  0
]
```

### Example

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

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

print_r($result);
?>
```

## Get a past intervention

`GET /1.0/dedicated/server/{serviceName}/intervention/{interventionId}`

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

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

Get a past intervention. Returns the start date and the type of a technical intervention made on the server.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicated.server.Intervention | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) | read-only | the intervention start date |
| `interventionId` | integer | read-only | The intervention id |
| `type` | string | read-only | the intervention type |

```json
{
  "date": "2024-01-01T12:00:00Z",
  "interventionId": 0,
  "type": "string"
}
```

### Example

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

# 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}/intervention/{interventionId}");

print_r($result);
?>
```

## List planned interventions

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

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

**Status:** Beta version  
**IAM actions:** `dedicatedServer:apiovh:plannedIntervention/get`

List planned interventions. Returns the IDs of the interventions planned on the server. Get a planned intervention to read its type, status and dates.

### Parameters

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

### Responses

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

```json
[
  0
]
```

### Example

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

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

print_r($result);
?>
```

## Get a planned intervention

`GET /1.0/dedicated/server/{serviceName}/plannedIntervention/{interventionId}`

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

**Status:** Beta version  
**IAM actions:** `dedicatedServer:apiovh:plannedIntervention/get`

Get a planned intervention. Returns the type, status, wanted start date and expected end date of an intervention planned on the server. The status is todo, doing or done.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `interventionId` | path | integer | yes | ID of the intervention |
| `serviceName` | path | string | yes | The internal name of your dedicated server |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dedicated.server.PlannedIntervention | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expectedEndDate` | string (date-time) | read-only | Expected end date for this intervention |
| `id` | integer | read-only | ID of the intervention |
| `status` | dedicated.PlannedInterventionStatusEnum | read-only | Status of the intervention — one of `doing`, `done`, `todo` |
| `type` | dedicated.PlannedInterventionTypeEnum | read-only | Operation purpose — one of `HARDWARE_UPGRADE_ON_ACTIVE_SERVER` |
| `wantedStartDate` | string (date-time) | read-only | Wanted start date for this intervention |

```json
{
  "expectedEndDate": "2024-01-01T12:00:00Z",
  "id": 0,
  "status": "doing",
  "type": "HARDWARE_UPGRADE_ON_ACTIVE_SERVER",
  "wantedStartDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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}/plannedIntervention/{interventionId}");

print_r($result);
?>
```
