database_dumps
Creates, updates, deletes, gets or lists a database_dumps resource.
Overview​
| Name | database_dumps |
| Type | Resource |
| Id | ovh.hosting_web.database_dumps |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | integer | Dump id |
task_id | integer | The task ID working on this dump (wire: taskId) |
creation_date | string (date-time) | Creation date of the dump (wire: creationDate) |
deletion_date | string (date-time) | Automatic deletion date of the dump (wire: deletionDate) |
status | string | The dump status (created, creating, deleting) |
type | string | Dump type (daily.1, now, weekly.1) |
url | string | Dump url access |
Dump
| Name | Datatype | Description |
|---|---|---|
id | integer | Dump id |
task_id | integer | The task ID working on this dump (wire: taskId) |
creation_date | string (date-time) | Creation date of the dump (wire: creationDate) |
deletion_date | string (date-time) | Automatic deletion date of the dump (wire: deletionDate) |
status | string | The dump status (created, creating, deleting) |
type | string | Dump type (daily.1, now, weekly.1) |
url | string | Dump url access |
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 dump. Returns the status, type, download URL and automatic deletion date of the dump. The type tells whether it comes from the current database or from a daily or weekly backup. | |
list | select | name, service_name | creation_date.from, creation_date.to, deletion_date.from, deletion_date.to, type, x_pagination_mode | List database dumps. Returns the IDs of the dumps of the database. Filter them by creation or deletion date. |
create | insert | name, service_name, date | Create a database dump. Creates a dump of the current database or of a daily or weekly backup, and returns the task. An email is sent when the dump is ready, unless sendEmail is false. | |
delete | delete | id, name, service_name | Delete a database dump. Deletes the dump before its automatic deletion date and returns the task. Otherwise, the dump is deleted on that date. | |
restore | exec | id, name, serviceName | Restore a database dump. Restores the dump into the database and returns the task. The current content of the database is replaced by the dump. |
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 | integer | Dump id |
name | string | Database name (like mydb.mysql.db or mydb.postgres.db) |
serviceName | string | The internal name of your hosting |
service_name | string | The internal name of your hosting (wire: serviceName) |
creation_date.from | string (date-time) | Filter the value of creationDate property (>=) (wire: creationDate.from) |
creation_date.to | string (date-time) | Filter the value of creationDate property (<=) (wire: creationDate.to) |
deletion_date.from | string (date-time) | Filter the value of deletionDate property (>=) (wire: deletionDate.from) |
deletion_date.to | string (date-time) | Filter the value of deletionDate property (<=) (wire: deletionDate.to) |
type | string | Filter the value of type property (=) |
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 dump. Returns the status, type, download URL and automatic deletion date of the dump. The type tells whether it comes from the current database or from a daily or weekly backup.
SELECT
id,
task_id,
creation_date,
deletion_date,
status,
type,
url
FROM ovh.hosting_web.database_dumps
WHERE id = '{{ id }}' -- required
AND name = '{{ name }}' -- required
AND service_name = '{{ service_name }}' -- required
;
List database dumps. Returns the IDs of the dumps of the database. Filter them by creation or deletion date.
SELECT
id,
task_id,
creation_date,
deletion_date,
status,
type,
url
FROM ovh.hosting_web.database_dumps
WHERE name = '{{ name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND creation_date.from = '{{ creation_date.from }}'
AND creation_date.to = '{{ creation_date.to }}'
AND deletion_date.from = '{{ deletion_date.from }}'
AND deletion_date.to = '{{ deletion_date.to }}'
AND type = '{{ type }}'
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
Create a database dump. Creates a dump of the current database or of a daily or weekly backup, and returns the task. An email is sent when the dump is ready, unless sendEmail is false.
INSERT INTO ovh.hosting_web.database_dumps (
date,
send_email,
name,
service_name
)
SELECT
'{{ date }}' /* required */,
{{ send_email }},
'{{ name }}',
'{{ service_name }}'
RETURNING
id,
object_id,
done_date,
function,
last_update,
object_type,
start_date,
status
;
# Description fields are for documentation purposes
- name: database_dumps
props:
- name: name
value: "{{ name }}"
description: Required parameter for the database_dumps resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the database_dumps resource.
- name: date
value: "{{ date }}"
description: |
List of dump types
valid_values: ['daily.1', 'now', 'weekly.1']
- name: send_email
value: {{ send_email }}
description: |
Send an email when dump will be available? Default: true
DELETE examples​
- delete
Delete a database dump. Deletes the dump before its automatic deletion date and returns the task. Otherwise, the dump is deleted on that date.
DELETE FROM ovh.hosting_web.database_dumps
WHERE id = '{{ id }}' --required
AND name = '{{ name }}' --required
AND service_name = '{{ service_name }}' --required
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- restore
Restore a database dump. Restores the dump into the database and returns the task. The current content of the database is replaced by the dump.
EXEC ovh.hosting_web.database_dumps.restore
@id='{{ id }}' --required,
@name='{{ name }}' --required,
@serviceName='{{ serviceName }}' --required
;