Skip to main content

private_databases

Creates, updates, deletes, gets or lists a private_databases resource.

Overview​

Nameprivate_databases
TypeResource
Idovh.hosting_private_database.private_databases

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
display_namestringSet the name displayed in customer panel for your private database (max 50 chars) (wire: displayName)
service_namestringService name (wire: serviceName)
capabilitiesarrayPrivate database capabilities
cpuintegerNumber of cpu on your private database
datacenterstringDatacenter where this private database is located (bhs1, gra1, gra2, gra3)
graph_endpointobjectParameters required to query metrics from OpenTSDB (wire: graphEndpoint)
gui_urlstringURL for the graphical user interface (wire: guiURL)
hostnamestringPrivate database hostname
hostname_ftpstringPrivate database ftp hostname (wire: hostnameFtp)
iamobjectIAM resource metadata
infrastructurestringInfrastructure where service was stored (docker)
ipstring (ipv4)Private database ip (example: 192.0.2.0)
is_under_maintenancebooleanIs the service under maintenance (wire: isUnderMaintenance)
last_checkstring (date-time)Date of the last data synchronization (wire: lastCheck)
offerstringType of the private database offer (classic, public)
portintegerPrivate database service port
port_ftpintegerPrivate database ftp port (wire: portFtp)
quota_sizeobjectSpace allowed on your private database (wire: quotaSize)
quota_usedobjectTotal space used on your private database (wire: quotaUsed)
ramobjectAmount of ram on your private database
serverstringPrivate database server name
statestringPrivate database state (detached, restartPending, startPending, started, stopPending, stopped)
tls_castringReturn the TLS certificate authority used by the private database (wire: tlsCa)
typestringPrivate database type (mariadb, mysql, postgresql, valkey)
versionstringPrivate database version (mariadb_10.11, mariadb_11.4, mariadb_11.8, mysql_8.0, mysql_8.4, postgresql_14, postgresql_15, postgresql_16, postgresql_17, postgresql_18, valkey_7.2, valkey_8.1, valkey_9.1)
version_labelstringPrivate database version label (wire: versionLabel)
version_numbernumberPrivate database version number (wire: versionNumber)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectservice_nameReturns the service properties, such as offer, DBMS type and version, hostname and ports, RAM, quota and state.
listselectiam_tags, x_pagination_modeReturns the service names of the Web Cloud Databases of the account.
updateupdateservice_nameUpdates the editable properties of the service, such as the display name (50 characters maximum).
change_contactexecserviceNameStarts a change procedure for the admin, billing or tech contact of the service. Returns the IDs of the account contact change tasks, which are not listed in the service tasks.
change_ftp_passwordexecserviceName, passwordChanges the FTP admin password of the service. The password must be alphanumeric and at least 8 characters long.
change_versionexecserviceName, versionChanges the DBMS version of the service to one of the available versions. Returns a task to follow the change.
confirm_terminationexecserviceName, tokenConfirms the termination of the service with the token sent by email to the admin contact.
database_wizardexecserviceName, databaseName, grant, password, userNameCreates 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.
generate_temporary_logs_linkexecserviceNameReturns a temporary URL to access the logs of the service, with its expiration date.
log_urlexecserviceName, kindGenerates a temporary URL to read the logs of one kind. The URL expires.
quota_refreshexecserviceNameRecalculates the disk space used by the service. Returns a task to follow the refresh.
restartexecserviceNameRestarts the service, which is unavailable for a few seconds. Returns a task to follow the restart.
terminateexecserviceNameStarts the termination of the service and sends a confirmation token by email to the admin contact. Confirm it with the termination confirmation.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
serviceNamestringService name
service_namestringService name (wire: serviceName)
iam_tagsobjectFilter resources on IAM tags (wire: iamTags)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

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

SELECT
display_name,
service_name,
capabilities,
cpu,
datacenter,
graph_endpoint,
gui_url,
hostname,
hostname_ftp,
iam,
infrastructure,
ip,
is_under_maintenance,
last_check,
offer,
port,
port_ftp,
quota_size,
quota_used,
ram,
server,
state,
tls_ca,
type,
version,
version_label,
version_number
FROM ovh.hosting_private_database.private_databases
WHERE service_name = '{{ service_name }}' -- required
;

UPDATE examples​

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

UPDATE ovh.hosting_private_database.private_databases
SET
display_name = '{{ display_name }}'
WHERE
service_name = '{{ service_name }}' --required;

Lifecycle Methods​

EXEC variables use wire (API) names.

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

EXEC ovh.hosting_private_database.private_databases.change_contact
@serviceName='{{ serviceName }}' --required
@@json=
'{
"contactAdmin": "{{ contactAdmin }}",
"contactBilling": "{{ contactBilling }}",
"contactTech": "{{ contactTech }}"
}'
;