# Web Cloud › Web Cloud DB › Instances API

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

> 14 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/web-cloud/web-cloud-db/instances/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/web-cloud-db/instances.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/web-cloud-db/instances.json?format=openapi3

## Operations

- `GET /hosting/privateDatabase` — List Web Cloud Databases
- `GET /hosting/privateDatabase/availableOrderCapacities` — Get available order capacities
- `GET /hosting/privateDatabase/{serviceName}` — Get a Web Cloud Database
- `PUT /hosting/privateDatabase/{serviceName}` — Update a Web Cloud Database
- `GET /hosting/privateDatabase/{serviceName}/availableVersions` — List available DBMS versions
- `POST /hosting/privateDatabase/{serviceName}/changeContact` — Change the contacts
- `POST /hosting/privateDatabase/{serviceName}/changeFtpPassword` — Change the FTP password
- `POST /hosting/privateDatabase/{serviceName}/changeVersion` — Change the DBMS version
- `POST /hosting/privateDatabase/{serviceName}/confirmTermination` — Confirm the termination
- `POST /hosting/privateDatabase/{serviceName}/restart` — Restart the service
- `GET /hosting/privateDatabase/{serviceName}/serviceInfos` — Get service information
- `PUT /hosting/privateDatabase/{serviceName}/serviceInfos` — Update service information
- `POST /hosting/privateDatabase/{serviceName}/terminate` — Request the termination
- `GET /hosting/privateDatabase/{serviceName}/webs` — List linked web hostings

## List Web Cloud Databases

`GET /1.0/hosting/privateDatabase`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#get-hosting-privatedatabase

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:get`

Returns the service names of the Web Cloud Databases of the account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

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

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

### Example

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

# 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("/hosting/privateDatabase");

print_r($result);
?>
```

## Get available order capacities

`GET /1.0/hosting/privateDatabase/availableOrderCapacities`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#get-hosting-privatedatabase-availableordercapacities

**Status:** Stable production version  
**IAM actions:** `account:apiovh:webCloudDatabases/availableOrderCapacities/get`

Returns the datacenters, RAM sizes and DBMS versions available for the requested offer.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `offer` | query | hosting.privateDatabase.OfferEnum | yes | Available offers — one of `classic`, `public` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.privateDatabase.availableOrderCapacities | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `datacenter` | hosting.privateDatabase.DatacenterEnum[] | read-only | A list of datacenter available for this offer |
| `offer` | hosting.privateDatabase.OfferEnum | read-only | Offer — one of `classic`, `public` |
| `ram` | hosting.privateDatabase.AvailableRamSizeEnum[] | read-only | A list of ram size available for this offer |
| `version` | hosting.privateDatabase.AvailableVersionEnum[] | read-only | A list of version available for this offer |

```json
{
  "datacenter": [
    "bhs1"
  ],
  "offer": "classic",
  "ram": [
    "1024"
  ],
  "version": [
    "mariadb_10.11"
  ]
}
```

### Example

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

# 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("/hosting/privateDatabase/availableOrderCapacities");

print_r($result);
?>
```

## Get a Web Cloud Database

`GET /1.0/hosting/privateDatabase/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#get-hosting-privatedatabase-servicename

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:get`

Returns the service properties, such as offer, DBMS type and version, hostname and ports, RAM, quota and state.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.privateDatabase.ServiceWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `capabilities` | hosting.privateDatabase.Capability[] | read-only | Private database capabilities |
| `capabilities[].create` | boolean | read-only | Can the object be created |
| `capabilities[].delete` | boolean | read-only | Can the object be deleted |
| `capabilities[].object` | string | read-only | Object name |
| `capabilities[].update` | boolean | read-only | Can the object be updated |
| `cpu` | integer | read-only | Number of cpu on your private database |
| `datacenter` | hosting.privateDatabase.DatacenterEnum | read-only | Datacenter where this private database is located — one of `bhs1`, `gra1`, `gra2`, `gra3` |
| `displayName` | string |  | Set the name displayed in customer panel for your private database (max 50 chars) |
| `graphEndpoint` | hosting.privateDatabase.GraphEndpoint | read-only | Parameters required to query metrics from OpenTSDB |
| `graphEndpoint.host` | string | read-only | The OpenTSDB host |
| `graphEndpoint.readToken` | string (password) | read-only | A read-only token |
| `graphEndpoint.readTokenId` | string | read-only | A read-only token ID |
| `guiURL` | string | read-only | URL for the graphical user interface |
| `hostname` | string | read-only | Private database hostname |
| `hostnameFtp` | string | read-only | Private database ftp hostname |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `infrastructure` | hosting.privateDatabase.InfrastructureEnum | read-only | Infrastructure where service was stored — one of `docker` |
| `ip` | ipv4 | read-only | Private database ip |
| `isUnderMaintenance` | boolean | read-only | Is the service under maintenance |
| `lastCheck` | string (date-time) | read-only | Date of the last data synchronization |
| `offer` | hosting.privateDatabase.OfferEnum | read-only | Type of the private database offer — one of `classic`, `public` |
| `port` | integer | read-only | Private database service port |
| `portFtp` | integer | read-only | Private database ftp port |
| `quotaSize` | complexType.UnitAndValue_long | read-only | Space allowed on your private database |
| `quotaSize.unit` | string | read-only | Unit of the value |
| `quotaSize.value` | integer |  |  |
| `quotaUsed` | complexType.UnitAndValue_long | read-only | Total space used on your private database |
| `quotaUsed.unit` | string | read-only | Unit of the value |
| `quotaUsed.value` | integer |  |  |
| `ram` | complexType.UnitAndValue_long | read-only | Amount of ram on your private database |
| `ram.unit` | string | read-only | Unit of the value |
| `ram.value` | integer |  |  |
| `server` | string | read-only | Private database server name |
| `serviceName` | string | read-only | Service name |
| `state` | hosting.privateDatabase.StateEnum | read-only | Private database state — one of `detached`, `restartPending`, `startPending`, `started`, `stopPending`, `stopped` |
| `tlsCa` | string | read-only | Return the TLS certificate authority used by the private database |
| `type` | hosting.privateDatabase.TypeEnum | read-only | Private database type — one of `mariadb`, `mysql`, `postgresql`, `valkey` |
| `version` | hosting.privateDatabase.VersionEnum | read-only | Private database version — one of `mariadb_10.11`, `mariadb_11.4`, `mariadb_11.8`, `mysql_8.0`, `mysql_8.4`, `postgresql_14`, `postgresql_15`, `postgresql_16`, `postgresql_17`, `postgresql_18`, `valkey_7.2`, `valkey_8.1`, … |
| `versionLabel` | string | read-only | Private database version label |
| `versionNumber` | number | read-only | Private database version number |

```json
{
  "capabilities": [
    {
      "create": true,
      "delete": true,
      "object": "string",
      "update": true
    }
  ],
  "cpu": 0,
  "datacenter": "bhs1",
  "displayName": "string",
  "graphEndpoint": {
    "host": "string",
    "readToken": "string",
    "readTokenId": "string"
  },
  "guiURL": "string",
  "hostname": "string",
  "hostnameFtp": "string",
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "infrastructure": "docker",
  "ip": "192.0.2.0",
  "isUnderMaintenance": true,
  "lastCheck": "2024-01-01T12:00:00Z",
  "offer": "classic",
  "port": 0,
  "portFtp": 0,
  "quotaSize": {
    "unit": "string",
    "value": 0
  },
  "quotaUsed": {
    "unit": "string",
    "value": 0
  },
  "ram": {
    "unit": "string",
    "value": 0
  },
  "server": "string",
  "serviceName": "string",
  "state": "detached",
  "tlsCa": "string",
  "type": "mariadb",
  "version": "mariadb_10.11",
  "versionLabel": "string",
  "versionNumber": 0
}
```

### Example

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

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

print_r($result);
?>
```

## Update a Web Cloud Database

`PUT /1.0/hosting/privateDatabase/{serviceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#put-hosting-privatedatabase-servicename

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:put`

Updates the editable properties of the service, such as the display name (50 characters maximum).

### Parameters

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

### Request body (required)

Type: `hosting.privateDatabase.Service`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `capabilities` | hosting.privateDatabase.Capability[] | read-only | Private database capabilities |
| `capabilities[].create` | boolean | read-only | Can the object be created |
| `capabilities[].delete` | boolean | read-only | Can the object be deleted |
| `capabilities[].object` | string | read-only | Object name |
| `capabilities[].update` | boolean | read-only | Can the object be updated |
| `cpu` | integer | read-only | Number of cpu on your private database |
| `datacenter` | hosting.privateDatabase.DatacenterEnum | read-only | Datacenter where this private database is located — one of `bhs1`, `gra1`, `gra2`, `gra3` |
| `displayName` | string |  | Set the name displayed in customer panel for your private database (max 50 chars) |
| `graphEndpoint` | hosting.privateDatabase.GraphEndpoint | read-only | Parameters required to query metrics from OpenTSDB |
| `graphEndpoint.host` | string | read-only | The OpenTSDB host |
| `graphEndpoint.readToken` | string (password) | read-only | A read-only token |
| `graphEndpoint.readTokenId` | string | read-only | A read-only token ID |
| `guiURL` | string | read-only | URL for the graphical user interface |
| `hostname` | string | read-only | Private database hostname |
| `hostnameFtp` | string | read-only | Private database ftp hostname |
| `infrastructure` | hosting.privateDatabase.InfrastructureEnum | read-only | Infrastructure where service was stored — one of `docker` |
| `ip` | ipv4 | read-only | Private database ip |
| `isUnderMaintenance` | boolean | read-only | Is the service under maintenance |
| `lastCheck` | string (date-time) | read-only | Date of the last data synchronization |
| `offer` | hosting.privateDatabase.OfferEnum | read-only | Type of the private database offer — one of `classic`, `public` |
| `port` | integer | read-only | Private database service port |
| `portFtp` | integer | read-only | Private database ftp port |
| `quotaSize` | complexType.UnitAndValue_long | read-only | Space allowed on your private database |
| `quotaSize.unit` | string | read-only | Unit of the value |
| `quotaSize.value` | integer |  |  |
| `quotaUsed` | complexType.UnitAndValue_long | read-only | Total space used on your private database |
| `quotaUsed.unit` | string | read-only | Unit of the value |
| `quotaUsed.value` | integer |  |  |
| `ram` | complexType.UnitAndValue_long | read-only | Amount of ram on your private database |
| `ram.unit` | string | read-only | Unit of the value |
| `ram.value` | integer |  |  |
| `server` | string | read-only | Private database server name |
| `serviceName` | string | read-only | Service name |
| `state` | hosting.privateDatabase.StateEnum | read-only | Private database state — one of `detached`, `restartPending`, `startPending`, `started`, `stopPending`, `stopped` |
| `tlsCa` | string | read-only | Return the TLS certificate authority used by the private database |
| `type` | hosting.privateDatabase.TypeEnum | read-only | Private database type — one of `mariadb`, `mysql`, `postgresql`, `valkey` |
| `version` | hosting.privateDatabase.VersionEnum | read-only | Private database version — one of `mariadb_10.11`, `mariadb_11.4`, `mariadb_11.8`, `mysql_8.0`, `mysql_8.4`, `postgresql_14`, `postgresql_15`, `postgresql_16`, `postgresql_17`, `postgresql_18`, `valkey_7.2`, `valkey_8.1`, … |
| `versionLabel` | string | read-only | Private database version label |
| `versionNumber` | number | read-only | Private database version number |

```json
{
  "displayName": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}" \
  -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: hosting.privateDatabase.Service
result = client.put("/hosting/privateDatabase/{serviceName}",
	displayName = None, # Set the name displayed in customer panel for your private database (max 50 chars) (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: hosting.privateDatabase.Service
$result = $ovh->put("/hosting/privateDatabase/{serviceName}", array(
	displayName => null, // Set the name displayed in customer panel for your private database (max 50 chars) (type: string, nullable)
));

print_r($result);
?>
```

## List available DBMS versions

`GET /1.0/hosting/privateDatabase/{serviceName}/availableVersions`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#get-hosting-privatedatabase-servicename-availableversions

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:availableVersions/get`

Returns the DBMS versions available for the service. Use one of them to change the DBMS version.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.privateDatabase.AvailableVersionEnum[] | successful operation |

```json
[
  "mariadb_10.11"
]
```

### Example

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

# 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("/hosting/privateDatabase/{serviceName}/availableVersions");

print_r($result);
?>
```

## Change the contacts

`POST /1.0/hosting/privateDatabase/{serviceName}/changeContact`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#post-hosting-privatedatabase-servicename-changecontact

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:changeContact`

Starts a change procedure for the admin, billing or tech contact of the service. Returns the IDs of the account contact change tasks, which are not listed in the service tasks.

### Parameters

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

### Request body (required)

Type: `services.changeContact`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contactAdmin` | string |  | The contact to set as admin contact |
| `contactBilling` | string |  | The contact to set as billing contact |
| `contactTech` | string |  | The contact to set as tech contact |

```json
{
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string"
}
```

### Responses

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

```json
[
  0
]
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/changeContact" \
  -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: services.changeContact
result = client.post("/hosting/privateDatabase/{serviceName}/changeContact",
	contactAdmin = None, # The contact to set as admin contact (type: string)
	contactBilling = None, # The contact to set as billing contact (type: string)
	contactTech = None, # The contact to set as tech contact (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: services.changeContact
$result = $ovh->post("/hosting/privateDatabase/{serviceName}/changeContact", array(
	contactAdmin => null, // The contact to set as admin contact (type: string)
	contactBilling => null, // The contact to set as billing contact (type: string)
	contactTech => null, // The contact to set as tech contact (type: string)
));

print_r($result);
?>
```

## Change the FTP password

`POST /1.0/hosting/privateDatabase/{serviceName}/changeFtpPassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#post-hosting-privatedatabase-servicename-changeftppassword

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:changeFtpPassword`

Changes the FTP admin password of the service. The password must be alphanumeric and at least 8 characters long.

### Parameters

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

### Request body (required)

Type: `hosting.privateDatabase.ChangeFtpPasswordPayload`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string (password) | yes | New ftp admin password (alphanumeric and 8 characters minimum) |

```json
{
  "password": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.privateDatabase.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `databaseName` | string | read-only | Database name on which the task is working |
| `doneDate` | string (date-time) | read-only | Completion date |
| `dumpId` | integer | read-only | DumpId on which the task is working |
| `function` | hosting.privateDatabase.task.FunctionEnum | read-only | Function name — one of `abuse`, `changeFtpPassword`, `changeRam`, `changeVersion`, `configuration/update`, `create`, `database/copy`, `database/copyRestore`, `database/create`, `database/delete`, `database/dump`, `database/dump/delete`, … |
| `id` | integer | read-only | The id of the task |
| `lastUpdate` | string (date-time) | read-only | Last update |
| `startDate` | string (date-time) | read-only | Task creation date |
| `status` | hosting.privateDatabase.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `userName` | string | read-only | User name on which the task is working |

```json
{
  "databaseName": "string",
  "doneDate": "2024-01-01T12:00:00Z",
  "dumpId": 0,
  "function": "abuse",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled",
  "userName": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/changeFtpPassword" \
  -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: hosting.privateDatabase.ChangeFtpPasswordPayload
result = client.post("/hosting/privateDatabase/{serviceName}/changeFtpPassword",
	password = None, # New ftp admin password (alphanumeric and 8 characters minimum) (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: hosting.privateDatabase.ChangeFtpPasswordPayload
$result = $ovh->post("/hosting/privateDatabase/{serviceName}/changeFtpPassword", array(
	password => null, // New ftp admin password (alphanumeric and 8 characters minimum) (type: string)
));

print_r($result);
?>
```

## Change the DBMS version

`POST /1.0/hosting/privateDatabase/{serviceName}/changeVersion`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#post-hosting-privatedatabase-servicename-changeversion

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:changeVersion`

Changes the DBMS version of the service to one of the available versions. Returns a task to follow the change.

### Parameters

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

### Request body (required)

Type: `hosting.privateDatabase.ChangeVersionPayload`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version` | hosting.privateDatabase.AvailableVersionEnum | yes | Change the private database engine version — one of `mariadb_10.11`, `mariadb_11.4`, `mariadb_11.8`, `mysql_8.0`, `mysql_8.4`, `postgresql_14`, `postgresql_15`, `postgresql_16`, `postgresql_17`, `postgresql_18`, `valkey_7.2`, `valkey_8.1`, … |

```json
{
  "version": "mariadb_10.11"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.privateDatabase.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `databaseName` | string | read-only | Database name on which the task is working |
| `doneDate` | string (date-time) | read-only | Completion date |
| `dumpId` | integer | read-only | DumpId on which the task is working |
| `function` | hosting.privateDatabase.task.FunctionEnum | read-only | Function name — one of `abuse`, `changeFtpPassword`, `changeRam`, `changeVersion`, `configuration/update`, `create`, `database/copy`, `database/copyRestore`, `database/create`, `database/delete`, `database/dump`, `database/dump/delete`, … |
| `id` | integer | read-only | The id of the task |
| `lastUpdate` | string (date-time) | read-only | Last update |
| `startDate` | string (date-time) | read-only | Task creation date |
| `status` | hosting.privateDatabase.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `userName` | string | read-only | User name on which the task is working |

```json
{
  "databaseName": "string",
  "doneDate": "2024-01-01T12:00:00Z",
  "dumpId": 0,
  "function": "abuse",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled",
  "userName": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/changeVersion" \
  -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: hosting.privateDatabase.ChangeVersionPayload
result = client.post("/hosting/privateDatabase/{serviceName}/changeVersion",
	version = None, # Change the private database engine version (type: hosting.privateDatabase.AvailableVersionEnum)
)

# 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: hosting.privateDatabase.ChangeVersionPayload
$result = $ovh->post("/hosting/privateDatabase/{serviceName}/changeVersion", array(
	version => null, // Change the private database engine version (type: hosting.privateDatabase.AvailableVersionEnum)
));

print_r($result);
?>
```

## Confirm the termination

`POST /1.0/hosting/privateDatabase/{serviceName}/confirmTermination`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#post-hosting-privatedatabase-servicename-confirmtermination

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:confirmTermination`

Confirms the termination of the service with the token sent by email to the admin contact.

### Parameters

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

### Request body (required)

Type: `services.confirmTermination`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `commentary` | string |  | Commentary about your termination request |
| `commentaryFutureUse` | string |  | Commentary about your future use |
| `commentaryReason` | string |  | Commentary about your reason for termination request |
| `futureUse` | service.TerminationFutureUseEnum |  | All future uses you can provide for a service termination — one of `NOT_REPLACING_SERVICE`, `OTHER`, `SUBSCRIBE_AN_OTHER_SERVICE`, `SUBSCRIBE_OTHER_KIND_OF_SERVICE_WITH_COMPETITOR`, `SUBSCRIBE_SIMILAR_SERVICE_WITH_COMPETITOR` |
| `reason` | service.TerminationReasonEnum |  | All reasons you can provide for a service termination — one of `FEATURES_DONT_SUIT_ME`, `LACK_OF_PERFORMANCES`, `MIGRATED_TO_ANOTHER_OVH_PRODUCT`, `MIGRATED_TO_COMPETITOR`, `NOT_ENOUGH_RECOGNITION`, `NOT_NEEDED_ANYMORE`, `NOT_RELIABLE`, `NO_ANSWER`, `OTHER`, `PRODUCT_DIMENSION_DONT_SUIT_ME`, `PRODUCT_TOOLS_DONT_SUIT_ME`, `TOO_EXPENSIVE`, … |
| `token` | string | yes | The termination token sent by email to the admin contact |

```json
{
  "commentary": "string",
  "commentaryFutureUse": "string",
  "commentaryReason": "string",
  "futureUse": "NOT_REPLACING_SERVICE",
  "reason": "FEATURES_DONT_SUIT_ME",
  "token": "string"
}
```

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/confirmTermination" \
  -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: services.confirmTermination
result = client.post("/hosting/privateDatabase/{serviceName}/confirmTermination",
	commentary = None, # Commentary about your termination request (type: string)
	commentaryFutureUse = None, # Commentary about your future use (type: string)
	commentaryReason = None, # Commentary about your reason for termination request (type: string)
	futureUse = None, # All future uses you can provide for a service termination (type: service.TerminationFutureUseEnum)
	reason = None, # All reasons you can provide for a service termination (type: service.TerminationReasonEnum)
	token = None, # The termination token sent by email to the admin contact (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: services.confirmTermination
$result = $ovh->post("/hosting/privateDatabase/{serviceName}/confirmTermination", array(
	commentary => null, // Commentary about your termination request (type: string)
	commentaryFutureUse => null, // Commentary about your future use (type: string)
	commentaryReason => null, // Commentary about your reason for termination request (type: string)
	futureUse => null, // All future uses you can provide for a service termination (type: service.TerminationFutureUseEnum)
	reason => null, // All reasons you can provide for a service termination (type: service.TerminationReasonEnum)
	token => null, // The termination token sent by email to the admin contact (type: string)
));

print_r($result);
?>
```

## Restart the service

`POST /1.0/hosting/privateDatabase/{serviceName}/restart`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#post-hosting-privatedatabase-servicename-restart

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:restart`

Restarts the service, which is unavailable for a few seconds. Returns a task to follow the restart.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.privateDatabase.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `databaseName` | string | read-only | Database name on which the task is working |
| `doneDate` | string (date-time) | read-only | Completion date |
| `dumpId` | integer | read-only | DumpId on which the task is working |
| `function` | hosting.privateDatabase.task.FunctionEnum | read-only | Function name — one of `abuse`, `changeFtpPassword`, `changeRam`, `changeVersion`, `configuration/update`, `create`, `database/copy`, `database/copyRestore`, `database/create`, `database/delete`, `database/dump`, `database/dump/delete`, … |
| `id` | integer | read-only | The id of the task |
| `lastUpdate` | string (date-time) | read-only | Last update |
| `startDate` | string (date-time) | read-only | Task creation date |
| `status` | hosting.privateDatabase.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `userName` | string | read-only | User name on which the task is working |

```json
{
  "databaseName": "string",
  "doneDate": "2024-01-01T12:00:00Z",
  "dumpId": 0,
  "function": "abuse",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled",
  "userName": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/restart" \
  -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.post("/hosting/privateDatabase/{serviceName}/restart")

# 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->post("/hosting/privateDatabase/{serviceName}/restart");

print_r($result);
?>
```

## Get service information

`GET /1.0/hosting/privateDatabase/{serviceName}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#get-hosting-privatedatabase-servicename-serviceinfos

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:serviceInfos/get`

Returns the billing information of the service, such as creation and expiration dates, contacts and renewal settings.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | services.Service | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | service.StateEnum — one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "canDeleteAtExpiration": true,
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string",
  "creation": "2024-01-01",
  "domain": "string",
  "engagedUpTo": "2024-01-01",
  "expiration": "2024-01-01",
  "possibleRenewPeriod": [
    0
  ],
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 0
  },
  "renewalType": "automaticForcedProduct",
  "serviceId": 0,
  "status": "autorenewInProgress"
}
```

### Example

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

# 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("/hosting/privateDatabase/{serviceName}/serviceInfos");

print_r($result);
?>
```

## Update service information

`PUT /1.0/hosting/privateDatabase/{serviceName}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#put-hosting-privatedatabase-servicename-serviceinfos

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:serviceInfos/edit`

Updates the editable service information, such as the renewal settings.

### Parameters

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

### Request body (required)

Type: `services.Service`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | service.StateEnum — one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 0
  }
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/serviceInfos" \
  -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: services.Service
result = client.put("/hosting/privateDatabase/{serviceName}/serviceInfos",
	renew = None, # Way of handling the renew (type: service.RenewType, 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: services.Service
$result = $ovh->put("/hosting/privateDatabase/{serviceName}/serviceInfos", array(
	renew => null, // Way of handling the renew (type: service.RenewType, nullable)
));

print_r($result);
?>
```

## Request the termination

`POST /1.0/hosting/privateDatabase/{serviceName}/terminate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#post-hosting-privatedatabase-servicename-terminate

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:terminate`

Starts the termination of the service and sends a confirmation token by email to the admin contact. Confirm it with the termination confirmation.

### 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 POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/terminate" \
  -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.post("/hosting/privateDatabase/{serviceName}/terminate")

# 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->post("/hosting/privateDatabase/{serviceName}/terminate");

print_r($result);
?>
```

## List linked web hostings

`GET /1.0/hosting/privateDatabase/{serviceName}/webs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-cloud-db/instances/#get-hosting-privatedatabase-servicename-webs

**Status:** Stable production version  
**IAM actions:** `webCloudDatabases:apiovh:webs/get`

Returns the service names of the web hostings linked to the service.

### 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/hosting/privateDatabase/{serviceName}/webs" \
  -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("/hosting/privateDatabase/{serviceName}/webs")

# 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("/hosting/privateDatabase/{serviceName}/webs");

print_r($result);
?>
```
