Skip to content

Databases

All operations require authentication.

5 operationsv1/hosting/privateDatabase
Agent setup

List databasesProduction

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

Returns the names of the databases of the service.

Path parameters

serviceName
required
string

Service name

Response

200string[]successful operation

Example uses serviceName = string

$ curl https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/database \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
[ "string"]

Create a databaseProduction

POST
/1.0/hosting/privateDatabase/{serviceName}/database

Creates an empty database on the service and returns a task to follow the creation. To also create a user with access to it, use the database wizard.

Path parameters

serviceName
required
string

Service name

Request body (required)

databaseName
required
string

Name of your new database

Response

200Tasksuccessful operation
databaseName
read-only
string

Database name on which the task is working

doneDate
read-only
stringdate-time

Completion date

dumpId
read-only
integer

DumpId on which the task is working

function
read-only
FunctionEnum

Function name

ValuesabusechangeFtpPasswordchangeRamchangeVersionconfiguration/updatecreatedatabase/copydatabase/copyRestoredatabase/createdatabase/deletedatabase/dumpdatabase/dump/deletedatabase/extension/createdatabase/extension/deletedatabase/importdatabase/restoredatabase/wizarddeletegrant/creategrant/deletegrant/updateinstalloverquota/inoverquota/outquotaRefreshrefreshreopenrestartstartstopsuspenduser/changePassworduser/createuser/deletewebhostingNetwork/disablewebhostingNetwork/enablewhitelist/createwhitelist/deletewhitelist/update
id
read-only
integer

The id of the task

lastUpdate
read-only
stringdate-time

Last update

startDate
read-only
stringdate-time

Task creation date

status
read-only
StatusEnum

Task status

Valuescancelleddoingdoneerrortodo
userName
read-only
string

User name on which the task is working

Example uses serviceName = string

$ curl https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/database \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "databaseName": "string", "doneDate": "2024-01-01T12:00:00Z", "dumpId": 0, "function": "abuse", "id": 0, "lastUpdate": "2024-01-01T12:00:00Z", "startDate": "2024-01-01T12:00:00Z", "status": "cancelled", "userName": "string"}

Get a databaseProduction

GET
/1.0/hosting/privateDatabase/{serviceName}/database/{databaseName}

Returns the size and creation date of the database, its daily backup time and the users granted on it.

Path parameters

databaseName
required
string

Database name

serviceName
required
string

Service name

Response

200Databasesuccessful operation
backupTime
read-only
time

Time of the next backup (every day)

creationDate
read-only
stringdate-time

Creation date of the database

databaseName
read-only
string

Database name

quotaUsed
read-only
UnitAndValue_long

Space used by the database

users
read-only
User[]

Users granted to this database

Example uses databaseName = string, serviceName = string

$ curl https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/database/{databaseName} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "backupTime": "15:04:05", "creationDate": "2024-01-01T12:00:00Z", "databaseName": "string", "quotaUsed": { "unit": "string", "value": 0 }, "users": [ { "grantId": 0, "grantType": "admin", "userName": "string" } ]}

Delete a databaseProduction

DELETE
/1.0/hosting/privateDatabase/{serviceName}/database/{databaseName}

Deletes the database and returns a task to follow the deletion. Its dumps are kept as orphan dumps.

Path parameters

databaseName
required
string

Database name

serviceName
required
string

Service name

Response

200Tasksuccessful operation
databaseName
read-only
string

Database name on which the task is working

doneDate
read-only
stringdate-time

Completion date

dumpId
read-only
integer

DumpId on which the task is working

function
read-only
FunctionEnum

Function name

ValuesabusechangeFtpPasswordchangeRamchangeVersionconfiguration/updatecreatedatabase/copydatabase/copyRestoredatabase/createdatabase/deletedatabase/dumpdatabase/dump/deletedatabase/extension/createdatabase/extension/deletedatabase/importdatabase/restoredatabase/wizarddeletegrant/creategrant/deletegrant/updateinstalloverquota/inoverquota/outquotaRefreshrefreshreopenrestartstartstopsuspenduser/changePassworduser/createuser/deletewebhostingNetwork/disablewebhostingNetwork/enablewhitelist/createwhitelist/deletewhitelist/update
id
read-only
integer

The id of the task

lastUpdate
read-only
stringdate-time

Last update

startDate
read-only
stringdate-time

Task creation date

status
read-only
StatusEnum

Task status

Valuescancelleddoingdoneerrortodo
userName
read-only
string

User name on which the task is working

Example uses databaseName = string, serviceName = string

$ curl https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/database/{databaseName} \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "databaseName": "string", "doneDate": "2024-01-01T12:00:00Z", "dumpId": 0, "function": "abuse", "id": 0, "lastUpdate": "2024-01-01T12:00:00Z", "startDate": "2024-01-01T12:00:00Z", "status": "cancelled", "userName": "string"}

Create a database with a userProduction

POST
/1.0/hosting/privateDatabase/{serviceName}/databaseWizard

Creates a database and a user in one call, and grants the user the chosen rights on the database. The password must be alphanumeric and at least 8 characters long.

Path parameters

serviceName
required
string

Service name

Request body (required)

databaseName
required
string

Name of your new database

grant
required
GrantEnum

Grant of the user on this database

Valuesadminnoneoverquota_adminoverquota_rwrorw
password
required
stringpassword

Password for the new user (alphanumeric and 8 characters minimum)

userName
required
string

New user name used to connect on your database

Response

200Tasksuccessful operation
databaseName
read-only
string

Database name on which the task is working

doneDate
read-only
stringdate-time

Completion date

dumpId
read-only
integer

DumpId on which the task is working

function
read-only
FunctionEnum

Function name

ValuesabusechangeFtpPasswordchangeRamchangeVersionconfiguration/updatecreatedatabase/copydatabase/copyRestoredatabase/createdatabase/deletedatabase/dumpdatabase/dump/deletedatabase/extension/createdatabase/extension/deletedatabase/importdatabase/restoredatabase/wizarddeletegrant/creategrant/deletegrant/updateinstalloverquota/inoverquota/outquotaRefreshrefreshreopenrestartstartstopsuspenduser/changePassworduser/createuser/deletewebhostingNetwork/disablewebhostingNetwork/enablewhitelist/createwhitelist/deletewhitelist/update
id
read-only
integer

The id of the task

lastUpdate
read-only
stringdate-time

Last update

startDate
read-only
stringdate-time

Task creation date

status
read-only
StatusEnum

Task status

Valuescancelleddoingdoneerrortodo
userName
read-only
string

User name on which the task is working

Example uses serviceName = string

$ curl https://api.eu.ovhcloud.com/1.0/hosting/privateDatabase/{serviceName}/databaseWizard \
  -H "authorization: Bearer $OVH_TOKEN"
ResponseExample
{ "databaseName": "string", "doneDate": "2024-01-01T12:00:00Z", "dumpId": 0, "function": "abuse", "id": 0, "lastUpdate": "2024-01-01T12:00:00Z", "startDate": "2024-01-01T12:00:00Z", "status": "cancelled", "userName": "string"}