private_databases
Creates, updates, deletes, gets or lists a private_databases resource.
Overview​
| Name | private_databases |
| Type | Resource |
| Id | ovh.hosting_private_database.private_databases |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
display_name | string | Set the name displayed in customer panel for your private database (max 50 chars) (wire: displayName) |
service_name | string | Service name (wire: serviceName) |
capabilities | array | Private database capabilities |
cpu | integer | Number of cpu on your private database |
datacenter | string | Datacenter where this private database is located (bhs1, gra1, gra2, gra3) |
graph_endpoint | object | Parameters required to query metrics from OpenTSDB (wire: graphEndpoint) |
gui_url | string | URL for the graphical user interface (wire: guiURL) |
hostname | string | Private database hostname |
hostname_ftp | string | Private database ftp hostname (wire: hostnameFtp) |
iam | object | IAM resource metadata |
infrastructure | string | Infrastructure where service was stored (docker) |
ip | string (ipv4) | Private database ip (example: 192.0.2.0) |
is_under_maintenance | boolean | Is the service under maintenance (wire: isUnderMaintenance) |
last_check | string (date-time) | Date of the last data synchronization (wire: lastCheck) |
offer | string | Type of the private database offer (classic, public) |
port | integer | Private database service port |
port_ftp | integer | Private database ftp port (wire: portFtp) |
quota_size | object | Space allowed on your private database (wire: quotaSize) |
quota_used | object | Total space used on your private database (wire: quotaUsed) |
ram | object | Amount of ram on your private database |
server | string | Private database server name |
state | string | Private database state (detached, restartPending, startPending, started, stopPending, stopped) |
tls_ca | string | Return the TLS certificate authority used by the private database (wire: tlsCa) |
type | string | Private database type (mariadb, mysql, postgresql, valkey) |
version | string | Private 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_label | string | Private database version label (wire: versionLabel) |
version_number | number | Private database version number (wire: versionNumber) |
Web Cloud Database
| Name | Datatype | Description |
|---|---|---|
display_name | string | Set the name displayed in customer panel for your private database (max 50 chars) (wire: displayName) |
service_name | string | Service name (wire: serviceName) |
capabilities | array | Private database capabilities |
cpu | integer | Number of cpu on your private database |
datacenter | string | Datacenter where this private database is located (bhs1, gra1, gra2, gra3) |
graph_endpoint | object | Parameters required to query metrics from OpenTSDB (wire: graphEndpoint) |
gui_url | string | URL for the graphical user interface (wire: guiURL) |
hostname | string | Private database hostname |
hostname_ftp | string | Private database ftp hostname (wire: hostnameFtp) |
iam | object | IAM resource metadata |
infrastructure | string | Infrastructure where service was stored (docker) |
ip | string (ipv4) | Private database ip (example: 192.0.2.0) |
is_under_maintenance | boolean | Is the service under maintenance (wire: isUnderMaintenance) |
last_check | string (date-time) | Date of the last data synchronization (wire: lastCheck) |
offer | string | Type of the private database offer (classic, public) |
port | integer | Private database service port |
port_ftp | integer | Private database ftp port (wire: portFtp) |
quota_size | object | Space allowed on your private database (wire: quotaSize) |
quota_used | object | Total space used on your private database (wire: quotaUsed) |
ram | object | Amount of ram on your private database |
server | string | Private database server name |
state | string | Private database state (detached, restartPending, startPending, started, stopPending, stopped) |
tls_ca | string | Return the TLS certificate authority used by the private database (wire: tlsCa) |
type | string | Private database type (mariadb, mysql, postgresql, valkey) |
version | string | Private 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_label | string | Private database version label (wire: versionLabel) |
version_number | number | Private database version number (wire: versionNumber) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | service_name | Returns the service properties, such as offer, DBMS type and version, hostname and ports, RAM, quota and state. | |
list | select | iam_tags, x_pagination_mode | Returns the service names of the Web Cloud Databases of the account. | |
update | update | service_name | Updates the editable properties of the service, such as the display name (50 characters maximum). | |
change_contact | exec | serviceName | 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. | |
change_ftp_password | exec | serviceName, password | Changes the FTP admin password of the service. The password must be alphanumeric and at least 8 characters long. | |
change_version | exec | serviceName, version | Changes the DBMS version of the service to one of the available versions. Returns a task to follow the change. | |
confirm_termination | exec | serviceName, token | Confirms the termination of the service with the token sent by email to the admin contact. | |
database_wizard | exec | serviceName, databaseName, grant, password, userName | 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. | |
generate_temporary_logs_link | exec | serviceName | Returns a temporary URL to access the logs of the service, with its expiration date. | |
log_url | exec | serviceName, kind | Generates a temporary URL to read the logs of one kind. The URL expires. | |
quota_refresh | exec | serviceName | Recalculates the disk space used by the service. Returns a task to follow the refresh. | |
restart | exec | serviceName | Restarts the service, which is unavailable for a few seconds. Returns a task to follow the restart. | |
terminate | exec | serviceName | Starts 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.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The 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"}}) |
serviceName | string | Service name |
service_name | string | Service name (wire: serviceName) |
iam_tags | object | Filter resources on IAM tags (wire: iamTags) |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
Returns the service names of the Web Cloud Databases of the account.
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 iam_tags = '{{ iam_tags }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
UPDATE examples​
- update
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.
- change_contact
- change_ftp_password
- change_version
- confirm_termination
- database_wizard
- generate_temporary_logs_link
- log_url
- quota_refresh
- restart
- terminate
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 }}"
}'
;
Changes the FTP admin password of the service. The password must be alphanumeric and at least 8 characters long.
EXEC ovh.hosting_private_database.private_databases.change_ftp_password
@serviceName='{{ serviceName }}' --required
@@json=
'{
"password": "{{ password }}"
}'
;
Changes the DBMS version of the service to one of the available versions. Returns a task to follow the change.
EXEC ovh.hosting_private_database.private_databases.change_version
@serviceName='{{ serviceName }}' --required
@@json=
'{
"version": "{{ version }}"
}'
;
Confirms the termination of the service with the token sent by email to the admin contact.
EXEC ovh.hosting_private_database.private_databases.confirm_termination
@serviceName='{{ serviceName }}' --required
@@json=
'{
"commentary": "{{ commentary }}",
"commentaryFutureUse": "{{ commentaryFutureUse }}",
"commentaryReason": "{{ commentaryReason }}",
"futureUse": "{{ futureUse }}",
"reason": "{{ reason }}",
"token": "{{ token }}"
}'
;
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.
EXEC ovh.hosting_private_database.private_databases.database_wizard
@serviceName='{{ serviceName }}' --required
@@json=
'{
"databaseName": "{{ databaseName }}",
"grant": "{{ grant }}",
"password": "{{ password }}",
"userName": "{{ userName }}"
}'
;
Returns a temporary URL to access the logs of the service, with its expiration date.
EXEC ovh.hosting_private_database.private_databases.generate_temporary_logs_link
@serviceName='{{ serviceName }}' --required
;
Generates a temporary URL to read the logs of one kind. The URL expires.
EXEC ovh.hosting_private_database.private_databases.log_url
@serviceName='{{ serviceName }}' --required
@@json=
'{
"kind": "{{ kind }}"
}'
;
Recalculates the disk space used by the service. Returns a task to follow the refresh.
EXEC ovh.hosting_private_database.private_databases.quota_refresh
@serviceName='{{ serviceName }}' --required
;
Restarts the service, which is unavailable for a few seconds. Returns a task to follow the restart.
EXEC ovh.hosting_private_database.private_databases.restart
@serviceName='{{ serviceName }}' --required
;
Starts the termination of the service and sends a confirmation token by email to the admin contact. Confirm it with the termination confirmation.
EXEC ovh.hosting_private_database.private_databases.terminate
@serviceName='{{ serviceName }}' --required
;