# Web Cloud › Web Hosting › Databases 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

> 35 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-hosting/databases/

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

## Operations

- `GET /hosting/web/{serviceName}/database` — List databases
- `GET /hosting/web/{serviceName}/database/{name}` — Get a database
- `GET /hosting/web/{serviceName}/database/{name}/capabilities` — Get database capabilities
- `GET /hosting/web/{serviceName}/database/{name}/copy` — List database copies
- `GET /hosting/web/{serviceName}/database/{name}/copy/{id}` — Get a database copy
- `GET /hosting/web/{serviceName}/database/{name}/dump` — List database dumps
- `GET /hosting/web/{serviceName}/database/{name}/dump/{id}` — Get a database dump
- `GET /hosting/web/{serviceName}/database/{name}/metricsToken` — Get a database metrics token
- `GET /hosting/web/{serviceName}/database/{name}/statistics` — Get database statistics
- `GET /hosting/web/{serviceName}/databaseAvailableType` — List database types
- `GET /hosting/web/{serviceName}/databaseAvailableVersion` — List database versions
- `GET /hosting/web/{serviceName}/databaseCreationCapabilities` — Get database creation capabilities
- `GET /hosting/web/{serviceName}/dump` — List dumps
- `GET /hosting/web/{serviceName}/dump/{id}` — Get a dump
- `GET /hosting/web/{serviceName}/extraSqlPerso` — List extra SQL options
- `GET /hosting/web/{serviceName}/extraSqlPerso/{id}` — Get an extra SQL option
- `GET /hosting/web/{serviceName}/extraSqlPerso/{id}/databases` — List extra SQL option databases
- `GET /hosting/web/{serviceName}/extraSqlPerso/{id}/serviceInfos` — Get extra SQL option service information
- `GET /hosting/web/{serviceName}/privateDatabaseCreationCapabilities` — Get private database creation capabilities
- `GET /hosting/web/{serviceName}/privateDatabases` — List linked private databases
- `POST /hosting/web/{serviceName}/database` — Create a database
- `POST /hosting/web/{serviceName}/database/{name}/changePassword` — Change the database password
- `POST /hosting/web/{serviceName}/database/{name}/copy` — Create a database copy
- `POST /hosting/web/{serviceName}/database/{name}/copyRestore` — Restore a database copy
- `POST /hosting/web/{serviceName}/database/{name}/dump` — Create a database dump
- `POST /hosting/web/{serviceName}/database/{name}/dump/{id}/restore` — Restore a database dump
- `POST /hosting/web/{serviceName}/database/{name}/import` — Import a dump
- `POST /hosting/web/{serviceName}/database/{name}/request` — Run a database action
- `POST /hosting/web/{serviceName}/database/{name}/restore` — Restore a database backup
- `POST /hosting/web/{serviceName}/extraSqlPerso/{id}/serviceInfosUpdate` — Update extra SQL option renewal
- `POST /hosting/web/{serviceName}/extraSqlPerso/{id}/terminate` — Terminate an extra SQL option
- `DELETE /hosting/web/{serviceName}/database/{name}` — Delete a database
- `DELETE /hosting/web/{serviceName}/database/{name}/copy/{id}` — Delete a database copy
- `DELETE /hosting/web/{serviceName}/database/{name}/dump/{id}` — Delete a database dump
- `DELETE /hosting/web/{serviceName}/dump/{id}` — Delete a dump

## List databases

`GET /1.0/hosting/web/{serviceName}/database`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/get`

List databases. Returns the names of the databases of the hosting. Filter them by mode, name, server, type or user.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `mode` | query | hosting.web.database.ModeEnum |  | Filter the value of mode property (=) — one of `besteffort`, `classic`, `module` |
| `name` | query | string |  | Filter the value of name property (like) |
| `server` | query | string |  | Filter the value of server property (like) |
| `serviceName` | path | string | yes | The internal name of your hosting |
| `type` | query | hosting.web.database.DatabaseTypeEnum |  | Filter the value of type property (=) — one of `mariadb`, `mongodb`, `mysql`, `postgresql`, `redis` |
| `user` | query | string |  | Filter the value of user property (like) |

### Responses

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

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

### Example

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

# 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/web/{serviceName}/database");

print_r($result);
?>
```

## Get a database

`GET /1.0/hosting/web/{serviceName}/database/{name}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/get`

Get a database. Returns the type, version, server, port, user, quota and status of the database, and the URL of its management tool.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `databaseServiceDeprecated` | boolean | read-only | Whether service database is deprecated |
| `databaseType` | hosting.web.database.DatabaseServiceTypeEnum | read-only | Database service type — one of `extra`, `included`, `optional` |
| `dumps` | integer | read-only | The number of available dumps associated to this database |
| `guiURL` | string | read-only | URL for the graphical user interface |
| `lastCheck` | string (date-time) | read-only | Date of the last check quota |
| `mode` | hosting.web.database.ModeEnum | read-only | Mode of your database — one of `besteffort`, `classic`, `module` |
| `name` | string | read-only | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `port` | integer | read-only | The port on where to contact this database |
| `quotaSize` | complexType.UnitAndValue_double | read-only | Space allowed |
| `quotaSize.unit` | string |  |  |
| `quotaSize.value` | number |  |  |
| `quotaUsed` | complexType.UnitAndValue_double | read-only | Space used |
| `quotaUsed.unit` | string |  |  |
| `quotaUsed.value` | number |  |  |
| `server` | string | read-only | Your database server name |
| `sqlpersoId` | integer | read-only | Which SQLPerso this database is linked to (if any) |
| `state` | hosting.web.database.StateEnum | read-only | Database state — one of `close`, `ok`, `readonly` |
| `status` | hosting.web.database.StatusEnum | read-only | The database status — one of `checking`, `created`, `creating`, `deleting`, `dumping`, `importing`, `locked`, `optimizing`, `restoring`, `updating` |
| `taskId` | integer | read-only | The task ID working on this database |
| `type` | hosting.web.database.DatabaseTypeEnum | read-only | Type of your database — one of `mariadb`, `mongodb`, `mysql`, `postgresql`, `redis` |
| `user` | string | read-only | Database user name |
| `version` | hosting.web.database.VersionEnum | read-only | Database version following the database type — one of `10`, `10.1`, `10.11`, `10.2`, `10.3`, `10.4`, `10.5`, `10.6`, `11`, `12`, `13`, `15`, … |
| `versionSupport` | hosting.web.database.SupportedVersionEnum | read-only | Indicates the current support state of your database version — one of `beta`, `deprecated`, `stable` |

```json
{
  "databaseServiceDeprecated": true,
  "databaseType": "extra",
  "dumps": 0,
  "guiURL": "string",
  "lastCheck": "2024-01-01T12:00:00Z",
  "mode": "besteffort",
  "name": "string",
  "port": 0,
  "quotaSize": {
    "unit": "string",
    "value": 0
  },
  "quotaUsed": {
    "unit": "string",
    "value": 0
  },
  "server": "string",
  "sqlpersoId": 0,
  "state": "close",
  "status": "checking",
  "taskId": 0,
  "type": "mariadb",
  "user": "string",
  "version": "10",
  "versionSupport": "beta"
}
```

### Example

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

# 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/web/{serviceName}/database/{name}");

print_r($result);
?>
```

## Get database capabilities

`GET /1.0/hosting/web/{serviceName}/database/{name}/capabilities`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name-capabilities

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/capabilities/get`

Get database capabilities. Returns the functions available on the database, such as dump, restore or password change, and the URL of its management tool.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.DatabaseCapabilities | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `changePassword` | boolean |  | Availability of the changePassword function |
| `changeRight` | boolean |  | Availability of the changeRight function |
| `delete` | boolean |  | Availability of the delete function |
| `dump` | boolean |  | Availability of the dump function |
| `getQuota` | boolean |  | Availability of the getQuota function |
| `getRight` | boolean |  | Availability of the getQuota function |
| `guiURL` | string |  | URL of the database management tool |
| `optimize` | boolean |  | Availability of the optimize function |
| `restore` | boolean |  | Availability of the restore function |

```json
{
  "changePassword": true,
  "changeRight": true,
  "delete": true,
  "dump": true,
  "getQuota": true,
  "getRight": true,
  "guiURL": "string",
  "optimize": true,
  "restore": true
}
```

### Example

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

# 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/web/{serviceName}/database/{name}/capabilities");

print_r($result);
?>
```

## List database copies

`GET /1.0/hosting/web/{serviceName}/database/{name}/copy`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name-copy

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/copy/get`

List database copies. Returns the IDs of the copies of the database. Each copy is kept until its expiration date.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string (uuid)[] | successful operation |

```json
[
  "00000000-0000-0000-0000-000000000000"
]
```

### Example

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

# 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/web/{serviceName}/database/{name}/copy");

print_r($result);
?>
```

## Get a database copy

`GET /1.0/hosting/web/{serviceName}/database/{name}/copy/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name-copy-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/copy/get`

Get a database copy. Returns the status, creation date and expiration date of the copy. Restore it into the database with copyRestore.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | Copy id |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.copy | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `expirationDate` | string (date-time) | read-only | Expiration date |
| `id` | string (uuid) | read-only | Copy id |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `status` | hosting.web.database.copy.StatusEnum | read-only | Copy status — one of `doing`, `done`, `error`, `todo` |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "expirationDate": "2024-01-01T12:00:00Z",
  "id": "00000000-0000-0000-0000-000000000000",
  "lastUpdate": "2024-01-01T12:00:00Z",
  "status": "doing"
}
```

### Example

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

# 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/web/{serviceName}/database/{name}/copy/{id}");

print_r($result);
?>
```

## List database dumps

`GET /1.0/hosting/web/{serviceName}/database/{name}/dump`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name-dump

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/dump/get`

List database dumps. Returns the IDs of the dumps of the database. Filter them by creation or deletion date.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `creationDate.from` | query | string (date-time) |  | Filter the value of creationDate property (>=) |
| `creationDate.to` | query | string (date-time) |  | Filter the value of creationDate property (<=) |
| `deletionDate.from` | query | string (date-time) |  | Filter the value of deletionDate property (>=) |
| `deletionDate.to` | query | string (date-time) |  | Filter the value of deletionDate property (<=) |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |
| `type` | query | hosting.web.database.dump.DateEnum |  | Filter the value of type property (=) — one of `daily.1`, `now`, `weekly.1` |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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/web/{serviceName}/database/{name}/dump");

print_r($result);
?>
```

## Get a database dump

`GET /1.0/hosting/web/{serviceName}/database/{name}/dump/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name-dump-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/dump/get`

Get a database dump. Returns the status, type, download URL and automatic deletion date of the dump. The type tells whether it comes from the current database or from a daily or weekly backup.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Dump id |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.dump | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date of the dump |
| `deletionDate` | string (date-time) | read-only | Automatic deletion date of the dump |
| `id` | integer | read-only | Dump id |
| `status` | hosting.web.database.dump.StatusEnum | read-only | The dump status — one of `created`, `creating`, `deleting` |
| `taskId` | integer | read-only | The task ID working on this dump |
| `type` | hosting.web.database.dump.DateEnum | read-only | Dump type — one of `daily.1`, `now`, `weekly.1` |
| `url` | string | read-only | Dump url access |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "deletionDate": "2024-01-01T12:00:00Z",
  "id": 0,
  "status": "created",
  "taskId": 0,
  "type": "daily.1",
  "url": "string"
}
```

### Example

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

# 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/web/{serviceName}/database/{name}/dump/{id}");

print_r($result);
?>
```

## Get a database metrics token

`GET /1.0/hosting/web/{serviceName}/database/{name}/metricsToken`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name-metricstoken

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/metricsToken/get`

Get a database metrics token. Generates a token to read the database metrics and returns it with the endpoint to query.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.MetricsToken | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `endpoint` | string |  | The url of the endpoint |
| `token` | string (password) |  | The token value |

```json
{
  "endpoint": "string",
  "token": "string"
}
```

### Example

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

# 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/web/{serviceName}/database/{name}/metricsToken");

print_r($result);
?>
```

## Get database statistics

`GET /1.0/hosting/web/{serviceName}/database/{name}/statistics`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-database-name-statistics

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/statistics/get`

Get database statistics. Returns the number of statements or their mean execution time over a period.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `period` | query | hosting.web.StatisticsPeriodEnum | yes | Available periods for statistics — one of `daily`, `monthly`, `weekly`, `yearly` |
| `serviceName` | path | string | yes | The internal name of your hosting |
| `type` | query | hosting.web.database.StatisticsTypeEnum | yes | Types of statistics available for the database — one of `statement`, `statementMeanTime` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | complexType.ChartSerie_complexType.ChartTimestampValue[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `serieName` | string |  |  |
| `unit` | string |  |  |
| `values` | complexType.ChartTimestampValue[] |  |  |
| `values[].timestamp` | integer |  |  |
| `values[].value` | number |  |  |

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

### Example

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

# 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/web/{serviceName}/database/{name}/statistics");

print_r($result);
?>
```

## List database types

`GET /1.0/hosting/web/{serviceName}/databaseAvailableType`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-databaseavailabletype

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:databaseAvailableType/get`

List database types. Returns the database types that can be created on the hosting: MariaDB, MongoDB, MySQL, PostgreSQL or Redis, depending on the offer.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.DatabaseTypeEnum[] | successful operation |

```json
[
  "mariadb"
]
```

### Example

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

# 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/web/{serviceName}/databaseAvailableType");

print_r($result);
?>
```

## List database versions

`GET /1.0/hosting/web/{serviceName}/databaseAvailableVersion`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-databaseavailableversion

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:databaseAvailableVersion/get`

List database versions. Returns the available versions of a database type, and the version used when a database is created without one.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your hosting |
| `type` | query | hosting.web.database.DatabaseTypeEnum | yes | Type of the database — one of `mariadb`, `mongodb`, `mysql`, `postgresql`, `redis` |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.AvailableVersionStruct | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `default` | hosting.web.database.VersionEnum |  | Database default version — one of `10`, `10.1`, `10.11`, `10.2`, `10.3`, `10.4`, `10.5`, `10.6`, `11`, `12`, `13`, `15`, … |
| `list` | hosting.web.database.VersionEnum[] |  | Database available version |

```json
{
  "default": "10",
  "list": [
    "10"
  ]
}
```

### Example

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

# 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/web/{serviceName}/databaseAvailableVersion");

print_r($result);
?>
```

## Get database creation capabilities

`GET /1.0/hosting/web/{serviceName}/databaseCreationCapabilities`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-databasecreationcapabilities

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:databaseCreationCapabilities/get`

Get database creation capabilities. Returns, for each database offer of the hosting, the engines, the quota and the number of databases left to create.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.CreationDatabaseCapabilities[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `available` | integer |  | Number of database left for creation |
| `engines` | hosting.web.database.DatabaseTypeEnum[] |  | Database software available on this platform |
| `isolation` | hosting.web.database.DatabaseIsolationEnum |  | Technology use to isolate differents webhosting accounts — one of `dedicated`, `local`, `shared` |
| `quota` | complexType.UnitAndValue_long |  | Size of data can be used |
| `quota.unit` | string |  |  |
| `quota.value` | integer |  |  |
| `type` | hosting.web.database.DatabaseCapabilitiesTypeEnum |  | Database offer name — one of `extraSqlPerso`, `local`, `privateDatabase`, `sqlLocal`, `sqlPerso`, `sqlPro` |

```json
[
  {
    "available": 0,
    "engines": [
      "mariadb"
    ],
    "isolation": "dedicated",
    "quota": {
      "unit": "string",
      "value": 0
    },
    "type": "extraSqlPerso"
  }
]
```

### Example

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

# 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/web/{serviceName}/databaseCreationCapabilities");

print_r($result);
?>
```

## List dumps

`GET /1.0/hosting/web/{serviceName}/dump`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-dump

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:dump/get`

List dumps. Returns the IDs of the database dumps of the hosting, including those of deleted databases. Filter them by database, date or orphan.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `creationDate.from` | query | string (date-time) |  | Filter the value of creationDate property (>=) |
| `creationDate.to` | query | string (date-time) |  | Filter the value of creationDate property (<=) |
| `databaseName` | query | string |  | Filter the value of databaseName property (=) |
| `deletionDate.from` | query | string (date-time) |  | Filter the value of deletionDate property (>=) |
| `deletionDate.to` | query | string (date-time) |  | Filter the value of deletionDate property (<=) |
| `orphan` | query | boolean |  | Filter the value of orphan property (=) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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/web/{serviceName}/dump");

print_r($result);
?>
```

## Get a dump

`GET /1.0/hosting/web/{serviceName}/dump/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-dump-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:dump/get`

Get a dump. Returns the source database, status, type, download URL and automatic deletion date of the dump.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Dump id |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.dump | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date of the dump |
| `databaseName` | string | read-only | Source database name |
| `deletionDate` | string (date-time) | read-only | Automatic deletion date of the dump |
| `id` | integer | read-only | Dump id |
| `orphan` | boolean | read-only | If source database was deleted |
| `status` | hosting.web.database.dump.StatusEnum | read-only | The dump status — one of `created`, `creating`, `deleting` |
| `taskId` | integer | read-only | The task ID working on this dump |
| `type` | hosting.web.database.dump.DateEnum | read-only | Dump type — one of `daily.1`, `now`, `weekly.1` |
| `url` | string | read-only | Dump url access |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "databaseName": "string",
  "deletionDate": "2024-01-01T12:00:00Z",
  "id": 0,
  "orphan": true,
  "status": "created",
  "taskId": 0,
  "type": "daily.1",
  "url": "string"
}
```

### Example

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

# 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/web/{serviceName}/dump/{id}");

print_r($result);
?>
```

## List extra SQL options

`GET /1.0/hosting/web/{serviceName}/extraSqlPerso`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-extrasqlperso

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:extraSqlPerso/get`

List extra SQL options. Returns the IDs of the additional SQL options of the hosting. Each option adds databases, each with its own quota.

### Parameters

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

### Responses

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

```json
[
  0
]
```

### Example

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

# 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/web/{serviceName}/extraSqlPerso");

print_r($result);
?>
```

## Get an extra SQL option

`GET /1.0/hosting/web/{serviceName}/extraSqlPerso/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-extrasqlperso-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:extraSqlPerso/get`

Get an extra SQL option. Returns the number of databases allowed, the quota per database, the linked databases and the status of the option.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Identifier of the (additional) SQL slot |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.extrasqlperso | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `database` | integer | read-only | Number of database allowed by this option |
| `id` | integer | read-only | Identifier of the (additional) SQL slot |
| `name` | string | read-only | The extraSqlPerso option name |
| `serviceName` | string | read-only | Billing name of the matching subscription (or internal naming otherwise) |
| `size` | complexType.UnitAndValue_double | read-only | Quota size allowed per each database by this option |
| `size.unit` | string |  |  |
| `size.value` | number |  |  |
| `status` | string | read-only | The extraSqlPerso option status |
| `taskId` | integer | read-only | The task ID working on this extraSqlPerso |
| `usage` | string[] | read-only | Linked databases |

```json
{
  "database": 0,
  "id": 0,
  "name": "string",
  "serviceName": "string",
  "size": {
    "unit": "string",
    "value": 0
  },
  "status": "string",
  "taskId": 0,
  "usage": [
    "string"
  ]
}
```

### Example

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

# 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/web/{serviceName}/extraSqlPerso/{id}");

print_r($result);
?>
```

## List extra SQL option databases

`GET /1.0/hosting/web/{serviceName}/extraSqlPerso/{id}/databases`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-extrasqlperso-id-databases

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:extraSqlPerso/databases/get`

List extra SQL option databases. Returns the names of the databases linked to the additional SQL option, within its number of allowed databases.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Identifier of the (additional) SQL slot |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

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

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

### Example

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

# 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/web/{serviceName}/extraSqlPerso/{id}/databases");

print_r($result);
?>
```

## Get extra SQL option service information

`GET /1.0/hosting/web/{serviceName}/extraSqlPerso/{id}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-extrasqlperso-id-serviceinfos

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

Get extra SQL option service information. Returns the billing information of the option: creation and expiration dates, renewal settings and contacts.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Identifier of the (additional) SQL slot |
| `serviceName` | path | string | yes | The internal name of your hosting |

### 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`, `automaticV2024`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | 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/web/{serviceName}/extraSqlPerso/{id}/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/web/{serviceName}/extraSqlPerso/{id}/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/web/{serviceName}/extraSqlPerso/{id}/serviceInfos");

print_r($result);
?>
```

## Get private database creation capabilities

`GET /1.0/hosting/web/{serviceName}/privateDatabaseCreationCapabilities`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-privatedatabasecreationcapabilities

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:privateDatabaseCreationCapabilities/get`

Get private database creation capabilities. Returns, for each private database offer, the engines, the quota and the number of databases left to create.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.CreationDatabaseCapabilities[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `available` | integer |  | Number of database left for creation |
| `engines` | hosting.web.database.DatabaseTypeEnum[] |  | Database software available on this platform |
| `isolation` | hosting.web.database.DatabaseIsolationEnum |  | Technology use to isolate differents webhosting accounts — one of `dedicated`, `local`, `shared` |
| `quota` | complexType.UnitAndValue_long |  | Size of data can be used |
| `quota.unit` | string |  |  |
| `quota.value` | integer |  |  |
| `type` | hosting.web.database.DatabaseCapabilitiesTypeEnum |  | Database offer name — one of `extraSqlPerso`, `local`, `privateDatabase`, `sqlLocal`, `sqlPerso`, `sqlPro` |

```json
[
  {
    "available": 0,
    "engines": [
      "mariadb"
    ],
    "isolation": "dedicated",
    "quota": {
      "unit": "string",
      "value": 0
    },
    "type": "extraSqlPerso"
  }
]
```

### Example

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

# 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/web/{serviceName}/privateDatabaseCreationCapabilities");

print_r($result);
?>
```

## List linked private databases

`GET /1.0/hosting/web/{serviceName}/privateDatabases`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#get-hosting-web-servicename-privatedatabases

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:privateDatabases/get`

List linked private databases. Returns the service names of the private databases linked to the hosting.

### Parameters

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

### Responses

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

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

### Example

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

# 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/web/{serviceName}/privateDatabases");

print_r($result);
?>
```

## Create a database

`POST /1.0/hosting/web/{serviceName}/database`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/create`

Create a database. Creates a MariaDB, MySQL, PostgreSQL or Redis database with its user, and returns the task. The quota applies only to extraSqlPerso databases.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `capabilitie` | hosting.web.database.DatabaseCapabilitiesTypeEnum | yes | Type of your database — one of `extraSqlPerso`, `local`, `privateDatabase`, `sqlLocal`, `sqlPerso`, `sqlPro` |
| `password` | string (password) |  | Database password |
| `quota` | hosting.web.database.ExtraSqlQuotaEnum |  | Quota assign to your database. Only for extraSql — one of `25`, `100`, `200`, `256`, `400`, `512`, `800`, `1024` |
| `type` | hosting.web.database.DatabaseCreationTypeEnum | yes | Type you want for your database — one of `mariadb`, `mysql`, `postgresql`, `redis` |
| `user` | string | yes | Database user name. Must begin with your hosting login and must be in lower case |
| `version` | hosting.web.database.VersionEnum |  | Version you want for your database following the type — one of `10`, `10.1`, `10.11`, `10.2`, `10.3`, `10.4`, `10.5`, `10.6`, `11`, `12`, `13`, `15`, … |

```json
{
  "capabilitie": "extraSqlPerso",
  "password": "string",
  "quota": 25,
  "type": "mariadb",
  "user": "string",
  "version": "10"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

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

result = client.post("/hosting/web/{serviceName}/database",
	capabilitie = None, # Type of your database (type: hosting.web.database.DatabaseCapabilitiesTypeEnum)
	password = None, # Database password (type: password, nullable)
	quota = None, # Quota assign to your database. Only for extraSql (type: hosting.web.database.ExtraSqlQuotaEnum, nullable)
	type = None, # Type you want for your database (type: hosting.web.database.DatabaseCreationTypeEnum)
	user = None, # Database user name. Must begin with your hosting login and must be in lower case (type: string)
	version = None, # Version you want for your database following the type (type: hosting.web.database.VersionEnum, 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

$result = $ovh->post("/hosting/web/{serviceName}/database", array(
	capabilitie => null, // Type of your database (type: hosting.web.database.DatabaseCapabilitiesTypeEnum)
	password => null, // Database password (type: password, nullable)
	quota => null, // Quota assign to your database. Only for extraSql (type: hosting.web.database.ExtraSqlQuotaEnum, nullable)
	type => null, // Type you want for your database (type: hosting.web.database.DatabaseCreationTypeEnum)
	user => null, // Database user name. Must begin with your hosting login and must be in lower case (type: string)
	version => null, // Version you want for your database following the type (type: hosting.web.database.VersionEnum, nullable)
));

print_r($result);
?>
```

## Change the database password

`POST /1.0/hosting/web/{serviceName}/database/{name}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-changepassword

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/changePassword`

Change the database password. Changes the password of the database user and returns the task. Available when changePassword is true in the database capabilities.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string (password) | yes | The new database password |

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/changePassword" \
  -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: password
result = client.post("/hosting/web/{serviceName}/database/{name}/changePassword",
	password = None, # The new database password (type: password)
)

# 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: password
$result = $ovh->post("/hosting/web/{serviceName}/database/{name}/changePassword", array(
	password => null, // The new database password (type: password)
));

print_r($result);
?>
```

## Create a database copy

`POST /1.0/hosting/web/{serviceName}/database/{name}/copy`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-copy

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/copy/create`

Create a database copy. Creates a copy of the database, kept until its expiration date. Restore it later with copyRestore.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.database.copy | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `expirationDate` | string (date-time) | read-only | Expiration date |
| `id` | string (uuid) | read-only | Copy id |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `status` | hosting.web.database.copy.StatusEnum | read-only | Copy status — one of `doing`, `done`, `error`, `todo` |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "expirationDate": "2024-01-01T12:00:00Z",
  "id": "00000000-0000-0000-0000-000000000000",
  "lastUpdate": "2024-01-01T12:00:00Z",
  "status": "doing"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/copy" \
  -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/web/{serviceName}/database/{name}/copy")

# 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/web/{serviceName}/database/{name}/copy");

print_r($result);
?>
```

## Restore a database copy

`POST /1.0/hosting/web/{serviceName}/database/{name}/copyRestore`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-copyrestore

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/copyRestore`

Restore a database copy. Restores a copy into the database and returns the task. Set flushDatabase to true to empty the database first.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `copyId` | string (uuid) | yes | UUID of the copy to restore |
| `flushDatabase` | boolean |  | If database will be flushed before importing the dump. Default: false |

```json
{
  "copyId": "00000000-0000-0000-0000-000000000000",
  "flushDatabase": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/copyRestore" \
  -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
)

result = client.post("/hosting/web/{serviceName}/database/{name}/copyRestore",
	copyId = None, # UUID of the copy to restore (type: uuid)
	flushDatabase = None, # If database will be flushed before importing the dump. Default: false (type: boolean, 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

$result = $ovh->post("/hosting/web/{serviceName}/database/{name}/copyRestore", array(
	copyId => null, // UUID of the copy to restore (type: uuid)
	flushDatabase => null, // If database will be flushed before importing the dump. Default: false (type: boolean, nullable)
));

print_r($result);
?>
```

## Create a database dump

`POST /1.0/hosting/web/{serviceName}/database/{name}/dump`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-dump

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/dump/create`

Create a database dump. Creates a dump of the current database or of a daily or weekly backup, and returns the task. An email is sent when the dump is ready, unless sendEmail is false.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | hosting.web.database.dump.DateEnum | yes | The date you want to dump — one of `daily.1`, `now`, `weekly.1` |
| `sendEmail` | boolean |  | Send an email when dump will be available? Default: true |

```json
{
  "date": "daily.1",
  "sendEmail": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/dump" \
  -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
)

result = client.post("/hosting/web/{serviceName}/database/{name}/dump",
	date = None, # The date you want to dump (type: hosting.web.database.dump.DateEnum)
	sendEmail = None, # Send an email when dump will be available? Default: true (type: boolean, 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

$result = $ovh->post("/hosting/web/{serviceName}/database/{name}/dump", array(
	date => null, // The date you want to dump (type: hosting.web.database.dump.DateEnum)
	sendEmail => null, // Send an email when dump will be available? Default: true (type: boolean, nullable)
));

print_r($result);
?>
```

## Restore a database dump

`POST /1.0/hosting/web/{serviceName}/database/{name}/dump/{id}/restore`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-dump-id-restore

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/dump/restore`

Restore a database dump. Restores the dump into the database and returns the task. The current content of the database is replaced by the dump.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Dump id |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/dump/{id}/restore" \
  -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/web/{serviceName}/database/{name}/dump/{id}/restore")

# 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/web/{serviceName}/database/{name}/dump/{id}/restore");

print_r($result);
?>
```

## Import a dump

`POST /1.0/hosting/web/{serviceName}/database/{name}/import`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-import

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/import`

Import a dump. Imports a dump file uploaded with /me/documents into the database, and returns the task. Set flushDatabase to true to empty the database first.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `documentId` | string | yes | Documents ID of the dump from /me/documents |
| `flushDatabase` | boolean |  | If database will be flushed before importing the dump. Default: false |
| `sendEmail` | boolean |  | Send an email when the import will be done? Default: false |

```json
{
  "documentId": "string",
  "flushDatabase": true,
  "sendEmail": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/import" \
  -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: boolean
result = client.post("/hosting/web/{serviceName}/database/{name}/import",
	documentId = None, # Documents ID of the dump from /me/documents (type: string)
	flushDatabase = None, # If database will be flushed before importing the dump. Default: false (type: boolean, nullable)
	sendEmail = None, # Send an email when the import will be done? Default: false (type: boolean, 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: boolean
$result = $ovh->post("/hosting/web/{serviceName}/database/{name}/import", array(
	documentId => null, // Documents ID of the dump from /me/documents (type: string)
	flushDatabase => null, // If database will be flushed before importing the dump. Default: false (type: boolean, nullable)
	sendEmail => null, // Send an email when the import will be done? Default: false (type: boolean, nullable)
));

print_r($result);
?>
```

## Run a database action

`POST /1.0/hosting/web/{serviceName}/database/{name}/request`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-request

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/request/create`

Run a database action. Runs an action on the database and returns the task. CHECK_QUOTA refreshes the space used by the database.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | hosting.web.database.RequestActionEnum | yes | Action you want to request — one of `CHECK_QUOTA` |

```json
{
  "action": "CHECK_QUOTA"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/request" \
  -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.web.database.RequestActionEnum
result = client.post("/hosting/web/{serviceName}/database/{name}/request",
	action = None, # Action you want to request (type: hosting.web.database.RequestActionEnum)
)

# 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.web.database.RequestActionEnum
$result = $ovh->post("/hosting/web/{serviceName}/database/{name}/request", array(
	action => null, // Action you want to request (type: hosting.web.database.RequestActionEnum)
));

print_r($result);
?>
```

## Restore a database backup

`POST /1.0/hosting/web/{serviceName}/database/{name}/restore`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-database-name-restore

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/restore`

Restore a database backup. Restores the database from a daily or weekly backup and returns the task. Set sendEmail to true to receive an email when it is done.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | hosting.web.database.dump.DateEnum | yes | The date you want to dump — one of `daily.1`, `now`, `weekly.1` |
| `sendEmail` | boolean |  | Send an email when the restore will be done? Default: false |

```json
{
  "date": "daily.1",
  "sendEmail": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/restore" \
  -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
)

result = client.post("/hosting/web/{serviceName}/database/{name}/restore",
	date = None, # The date you want to dump (type: hosting.web.database.dump.DateEnum)
	sendEmail = None, # Send an email when the restore will be done? Default: false (type: boolean, 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

$result = $ovh->post("/hosting/web/{serviceName}/database/{name}/restore", array(
	date => null, // The date you want to dump (type: hosting.web.database.dump.DateEnum)
	sendEmail => null, // Send an email when the restore will be done? Default: false (type: boolean, nullable)
));

print_r($result);
?>
```

## Update extra SQL option renewal

`POST /1.0/hosting/web/{serviceName}/extraSqlPerso/{id}/serviceInfosUpdate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-extrasqlperso-id-serviceinfosupdate

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:extraSqlPerso/serviceInfosUpdate/create`

Update extra SQL option renewal. Updates the renewal settings of the additional SQL option: automatic renewal, renewal period and deletion at expiration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Identifier of the (additional) SQL slot |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `renew` | service.RenewType | yes | Renew type |
| `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 |

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

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/extraSqlPerso/{id}/serviceInfosUpdate" \
  -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: service.RenewType
result = client.post("/hosting/web/{serviceName}/extraSqlPerso/{id}/serviceInfosUpdate",
	renew = None, # Renew type (type: service.RenewType)
)

# 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: service.RenewType
$result = $ovh->post("/hosting/web/{serviceName}/extraSqlPerso/{id}/serviceInfosUpdate", array(
	renew => null, // Renew type (type: service.RenewType)
));

print_r($result);
?>
```

## Terminate an extra SQL option

`POST /1.0/hosting/web/{serviceName}/extraSqlPerso/{id}/terminate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#post-hosting-web-servicename-extrasqlperso-id-terminate

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:extraSqlPerso/terminate`

Terminate an extra SQL option. Requests the termination of the additional SQL option. A link to confirm it is sent by email to the administrator contact.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Identifier of the (additional) SQL slot |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/extraSqlPerso/{id}/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/web/{serviceName}/extraSqlPerso/{id}/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/web/{serviceName}/extraSqlPerso/{id}/terminate");

print_r($result);
?>
```

## Delete a database

`DELETE /1.0/hosting/web/{serviceName}/database/{name}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#delete-hosting-web-servicename-database-name

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/delete`

Delete a database. Deletes the database and returns the task. Its dumps are kept until their automatic deletion date.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

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

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

print_r($result);
?>
```

## Delete a database copy

`DELETE /1.0/hosting/web/{serviceName}/database/{name}/copy/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#delete-hosting-web-servicename-database-name-copy-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/copy/delete`

Delete a database copy. Deletes the database copy before its expiration date. The database itself is not changed.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | Copy id |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/copy/{id}" \
  -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("/hosting/web/{serviceName}/database/{name}/copy/{id}")

# 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("/hosting/web/{serviceName}/database/{name}/copy/{id}");

print_r($result);
?>
```

## Delete a database dump

`DELETE /1.0/hosting/web/{serviceName}/database/{name}/dump/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#delete-hosting-web-servicename-database-name-dump-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:database/dump/delete`

Delete a database dump. Deletes the dump before its automatic deletion date and returns the task. Otherwise, the dump is deleted on that date.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Dump id |
| `name` | path | string | yes | Database name (like mydb.mysql.db or mydb.postgres.db) |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/hosting/web/{serviceName}/database/{name}/dump/{id}" \
  -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("/hosting/web/{serviceName}/database/{name}/dump/{id}")

# 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("/hosting/web/{serviceName}/database/{name}/dump/{id}");

print_r($result);
?>
```

## Delete a dump

`DELETE /1.0/hosting/web/{serviceName}/dump/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/web-hosting/databases/#delete-hosting-web-servicename-dump-id

**Status:** Stable production version  
**IAM actions:** `webHosting:apiovh:dump/delete`

Delete a dump. Deletes the dump before its automatic deletion date and returns the task. This also applies to dumps of deleted databases.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Dump id |
| `serviceName` | path | string | yes | The internal name of your hosting |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | hosting.web.task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `doneDate` | string (date-time) | read-only | Completion date |
| `function` | string | read-only | Function name |
| `id` | integer | read-only | the id of the task |
| `lastUpdate` | string (date-time) | read-only | last update |
| `objectId` | string | read-only | Task related object ID |
| `objectType` | hosting.web.task.ObjectTypeEnum | read-only | Task object type — one of `Abuse`, `AttachedDomain`, `BlockedIp`, `Cdn`, `Cron`, `Database`, `Dump`, `EnvVar`, `Filerz`, `Hostedssl`, `Hosting`, `Indy`, … |
| `startDate` | string (date-time) | read-only | Task Creation date |
| `status` | hosting.web.task.StatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `init`, `todo` |

```json
{
  "doneDate": "2024-01-01T12:00:00Z",
  "function": "string",
  "id": 0,
  "lastUpdate": "2024-01-01T12:00:00Z",
  "objectId": "string",
  "objectType": "Abuse",
  "startDate": "2024-01-01T12:00:00Z",
  "status": "cancelled"
}
```

### Example

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

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

print_r($result);
?>
```
