database_copies
Creates, updates, deletes, gets or lists a database_copies resource.
Overview​
| Name | database_copies |
| Type | Resource |
| Id | ovh.hosting_private_database.database_copies |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Database copy ID |
creation_date | string (date-time) | Creation date of the database copy (wire: creationDate) |
expiration_date | string (date-time) | Expiration date of the database copy (wire: expirationDate) |
last_update | string (date-time) | Last update of the database copy (wire: lastUpdate) |
status | string | Database copy status (doing, done, error, todo) |
Database copy
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Database copy ID |
creation_date | string (date-time) | Creation date of the database copy (wire: creationDate) |
expiration_date | string (date-time) | Expiration date of the database copy (wire: expirationDate) |
last_update | string (date-time) | Last update of the database copy (wire: lastUpdate) |
status | string | Database copy status (doing, done, error, todo) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | database_name, id, service_name | Returns the status, creation date and expiration date of the copy. | |
list | select | database_name, service_name | x_pagination_mode | Returns the IDs of the copies of the database. |
create | insert | database_name, service_name | Creates a copy of the database. The copy expires at the expiration date given in the response. | |
delete | delete | database_name, id, service_name | Deletes 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.
| 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"}}) |
database_name | string | Database name (wire: databaseName) |
id | string (uuid) | Id |
service_name | string | Service name (wire: serviceName) |
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 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
;
Returns the IDs of the copies of the database.
SELECT
id,
creation_date,
expiration_date,
last_update,
status
FROM ovh.hosting_private_database.database_copies
WHERE database_name = '{{ database_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: database_copies
props:
- name: database_name
value: "{{ database_name }}"
description: Required parameter for the database_copies resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the database_copies resource.
DELETE examples​
- delete
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
;