Skip to main content

database_copies

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

Overview​

Namedatabase_copies
TypeResource
Idovh.hosting_private_database.database_copies

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)Database copy ID
creation_datestring (date-time)Creation date of the database copy (wire: creationDate)
expiration_datestring (date-time)Expiration date of the database copy (wire: expirationDate)
last_updatestring (date-time)Last update of the database copy (wire: lastUpdate)
statusstringDatabase copy status (doing, done, error, todo)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdatabase_name, id, service_nameReturns the status, creation date and expiration date of the copy.
listselectdatabase_name, service_namex_pagination_modeReturns the IDs of the copies of the database.
createinsertdatabase_name, service_nameCreates a copy of the database. The copy expires at the expiration date given in the response.
deletedeletedatabase_name, id, service_nameDeletes the copy immediately, before its expiration date. A deleted copy can no longer be restored.

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"}})
database_namestringDatabase name (wire: databaseName)
idstring (uuid)Id
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 status, creation date and expiration date of the copy.

SELECT
id,
creation_date,
expiration_date,
last_update,
status
FROM ovh.hosting_private_database.database_copies
WHERE database_name = '{{ database_name }}' -- required
AND id = '{{ id }}' -- required
AND service_name = '{{ service_name }}' -- required
;

INSERT examples​

Creates a copy of the database. The copy expires at the expiration date given in the response.

INSERT INTO ovh.hosting_private_database.database_copies (
database_name,
service_name
)
SELECT
'{{ database_name }}',
'{{ service_name }}'
RETURNING
id,
creation_date,
expiration_date,
last_update,
status
;

DELETE examples​

Deletes the copy immediately, before its expiration date. A deleted copy can no longer be restored.

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