database_copies
Creates, updates, deletes, gets or lists a database_copies resource.
Overview​
| Name | database_copies |
| Type | Resource |
| Id | ovh.hosting_web.database_copies |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Copy id |
creation_date | string (date-time) | Creation date (wire: creationDate) |
expiration_date | string (date-time) | Expiration date (wire: expirationDate) |
last_update | string (date-time) | Last update date (wire: lastUpdate) |
status | string | Copy status (doing, done, error, todo) |
Copy
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Copy id |
creation_date | string (date-time) | Creation date (wire: creationDate) |
expiration_date | string (date-time) | Expiration date (wire: expirationDate) |
last_update | string (date-time) | Last update date (wire: lastUpdate) |
status | string | 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 | id, name, service_name | Get a database copy. Returns the status, creation date and expiration date of the copy. Restore it into the database with copyRestore. | |
list | select | name, service_name | x_pagination_mode | List database copies. Returns the IDs of the copies of the database. Each copy is kept until its expiration date. |
create | insert | name, service_name | Create a database copy. Creates a copy of the database, kept until its expiration date. Restore it later with copyRestore. | |
delete | delete | id, name, service_name | Delete a database copy. Deletes the database copy before its expiration date. The database itself is not changed. |
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"}}) |
id | string (uuid) | Copy id |
name | string | Database name (like mydb.mysql.db or mydb.postgres.db) |
service_name | string | The internal name of your hosting (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
Get a database copy. Returns the status, creation date and expiration date of the copy. Restore it into the database with copyRestore.
SELECT
id,
creation_date,
expiration_date,
last_update,
status
FROM ovh.hosting_web.database_copies
WHERE id = '{{ id }}' -- required
AND name = '{{ name }}' -- required
AND service_name = '{{ service_name }}' -- required
;
List database copies. Returns the IDs of the copies of the database. Each copy is kept until its expiration date.
SELECT
id,
creation_date,
expiration_date,
last_update,
status
FROM ovh.hosting_web.database_copies
WHERE name = '{{ name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a database copy. Creates a copy of the database, kept until its expiration date. Restore it later with copyRestore.
INSERT INTO ovh.hosting_web.database_copies (
name,
service_name
)
SELECT
'{{ name }}',
'{{ service_name }}'
RETURNING
id,
creation_date,
expiration_date,
last_update,
status
;
# Description fields are for documentation purposes
- name: database_copies
props:
- name: name
value: "{{ 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
Delete a database copy. Deletes the database copy before its expiration date. The database itself is not changed.
DELETE FROM ovh.hosting_web.database_copies
WHERE id = '{{ id }}' --required
AND name = '{{ name }}' --required
AND service_name = '{{ service_name }}' --required
;