community.general.scaleway_database_backup module – Scaleway database backups management module
Note
This module is part of the community.general collection (version 4.8.3).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.scaleway_database_backup
.
New in version 1.2.0: of community.general
Synopsis
This module manages database backups on Scaleway account https://developer.scaleway.com.
Parameters
Parameter |
Comments |
---|---|
HTTP timeout to Scaleway API in seconds. Default: 30 |
|
Scaleway OAuth token. |
|
Scaleway API URL. Default: “https://api.scaleway.com” |
|
Name used to identify the database. Required for Ignored when |
|
Expiration datetime of the database backup (ISO 8601 format). Ignored when |
|
UUID used to identify the database backup. Required for |
|
UUID of the instance associated to the database backup. Required for Ignored when |
|
Name used to identify the database backup. Required for Ignored when |
|
List of parameters passed to the query string. Default: {} |
|
Scaleway region to use (for example Choices:
|
|
Indicate desired state of the database backup.
Choices:
|
|
Validate SSL certs of the Scaleway API. Choices:
|
|
Wait for the instance to reach its desired state before returning. Choices:
|
|
Time to wait before every attempt to check the state of the backup. Default: 3 |
|
Time to wait for the backup to reach the expected state. Default: 300 |
Notes
Note
Also see the API documentation on https://developer.scaleway.com/
If
api_token
is not set within the module, the following environment variables can be used in decreasing order of precedenceSCW_TOKEN
,SCW_API_KEY
,SCW_OAUTH_TOKEN
orSCW_API_TOKEN
.If one wants to use a different
api_url
one can also set theSCW_API_URL
environment variable.
Examples
- name: Create a backup
community.general.scaleway_database_backup:
name: 'my_backup'
state: present
region: 'fr-par'
database_name: 'my-database'
instance_id: '50968a80-2909-4e5c-b1af-a2e19860dddb'
- name: Export a backup
community.general.scaleway_database_backup:
id: '6ef1125a-037e-494f-a911-6d9c49a51691'
state: exported
region: 'fr-par'
- name: Restore a backup
community.general.scaleway_database_backup:
id: '6ef1125a-037e-494f-a911-6d9c49a51691'
state: restored
region: 'fr-par'
database_name: 'my-new-database'
instance_id: '50968a80-2909-4e5c-b1af-a2e19860dddb'
- name: Remove a backup
community.general.scaleway_database_backup:
id: '6ef1125a-037e-494f-a911-6d9c49a51691'
state: absent
region: 'fr-par'
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Backup metadata. Returned: when Sample: {“metadata”: {“created_at”: “2020-08-06T12:42:05.631049Z”, “database_name”: “my-database”, “download_url”: null, “download_url_expires_at”: null, “expires_at”: null, “id”: “a15297bd-0c4a-4b4f-8fbb-b36a35b7eb07”, “instance_id”: “617be32e-6497-4ed7-b4c7-0ee5a81edf49”, “instance_name”: “my-instance”, “name”: “backup_name”, “region”: “fr-par”, “size”: 600000, “status”: “ready”, “updated_at”: “2020-08-06T12:42:10.581649Z”}} |
Authors
Guillaume Rodriguez (@guillaume_ro_fr)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication