Skip to main content

database_dumps

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

Overview​

Namedatabase_dumps
TypeResource
Idovh.hosting_private_database.database_dumps

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idintegerDump id
database_namestringDump of this database name (wire: databaseName)
creation_datestring (date-time)Creation date of the dump (wire: creationDate)
deletion_datestring (date-time)Automatic deletion date of the dump (wire: deletionDate)
urlstringDump URL access

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdatabase_name, id, service_nameReturns the creation date, automatic deletion date and download URL of the dump.
listselectdatabase_name, service_namex_pagination_modeReturns the IDs of the dumps of the database. To include dumps of deleted databases, list the dumps of the service.
createinsertdatabase_name, service_nameCreates a dump of the database and returns a task to follow it. The download link is valid for 30 days and is sent by email only when requested.
deletedeletedatabase_name, id, service_nameDeletes the dump before its automatic deletion date.
restoreexecdatabaseName, id, serviceNameRestores the dump into the database it was taken from. By default, the database is flushed before the restore.

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"}})
databaseNamestringDatabase name
database_namestringDatabase name (wire: databaseName)
idintegerId
serviceNamestringService name
service_namestringService name (wire: serviceName)
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 creation date, automatic deletion date and download URL of the dump.

SELECT
id,
database_name,
creation_date,
deletion_date,
url
FROM ovh.hosting_private_database.database_dumps
WHERE database_name = '{{ database_name }}' -- required
AND id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Creates a dump of the database and returns a task to follow it. The download link is valid for 30 days and is sent by email only when requested.

INSERT INTO ovh.hosting_private_database.database_dumps (
send_email,
database_name,
service_name
)
SELECT
{{ send_email }},
'{{ database_name }}',
'{{ service_name }}'
RETURNING
id,
dump_id,
database_name,
user_name,
done_date,
function,
last_update,
start_date,
status
;

DELETE examples​

Deletes the dump before its automatic deletion date.

DELETE FROM ovh.hosting_private_database.database_dumps
WHERE database_name = '{{ database_name }}' --required
AND id = '{{ id }}' --required
AND service_name = '{{ service_name }}' --required
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Restores the dump into the database it was taken from. By default, the database is flushed before the restore.

EXEC ovh.hosting_private_database.database_dumps.restore
@databaseName='{{ databaseName }}' --required,
@id='{{ id }}' --required,
@serviceName='{{ serviceName }}' --required
@@json=
'{
"flushDatabase": {{ flushDatabase }}
}'
;