15 Commits

Author SHA1 Message Date
Hervé Beraud
b9f08915f8 Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Change-Id: Ida35e5f79ee17ef8ac6ea2186019ddd4040ec882
2020-06-11 11:55:55 +02:00
Sean McGinnis
2b8282bb1e
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Ib83e626f51e6e01898bb7931c1660a1a548500f3
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:59:46 -05:00
Lingxian Kong
982b3f035a Support backup filtering
To get all the backups of an instance:

    openstack database backup list --instance-id <instance-id>

Admin user gets backups of all the projects:

    openstack database backup list --all-projects

Story: #2006433
Task: #36346
Change-Id: I871d1ffa27805158024e8ecbe1dceae725c4deac
2019-08-25 23:33:26 +12:00
int32bit
457cefa90d Remove extra parameter 'backup' in backup-create
The parameter 'backup' in backup-create is never read by our Trove API[1], so
I guess it's a extra key argument for history reason. In addition, the
'backup-copy' subcommand should be removed as well because it does not
support in current Trove API.

[1] https://github.com/openstack/trove/blob/master/trove/backup/service.py#L61-L77

Change-Id: I33d439e0037efd4573eeae186758fd778ba5c514
2017-08-22 14:41:51 +08:00
Morgan Jones
599171ade4 Implement scheduled backups
Implements Trove client APIs to implement scheduled backups
via Mistral workflow.

Change-Id: I012eb88359e063adbb86979a8fbd2e2a1e83f816
Implements: blueprint scheduled-backups
2016-08-25 16:57:54 -04:00
Ali Adil
2844f453cc Add --incremental flag to backup-create
Added --incremental flag to backup-create and set the default
value to False. When the flag is passed it will create a
backup based on the last good known full/incremental backup.
If there is no previous backup a full backup will be created.

Change-Id: I96498180890b8b1692b1bac3b19988532f6eb077
Partial-Bug: #1607429
2016-08-25 05:31:48 +00:00
Morgan Jones
ea0e472edd Fix troveclient to support Mistral
Mistral gets confused by Trove's (aguably wrong) inclusion
of a member called 'items' in the Pagenated object that
Trove returns as the result of 'list' client methods.

This change changes Pagenated to inherit from the 'list'
class so that the items method is not required (and has
the additional benefit of just generally being a better
implementation of a list type result).

Change-Id: I683120451f69f07f131e6fa422c082f85735b196
Closes-bug: 1585705
Depends-On: Id674ae57bfcdc5e09bde1e323a614b3a03a7cad3
2016-05-26 16:14:37 -04:00
Amrith Kumar
a0e04164b2 Correct order of parameters to assertEqual
The correct order of parameters to assertEqual is (expected,
actual). It makes the assertion message more meaningful when there is
a failure.

Change-Id: I1ab6933d2eee336b41f6ab791e32ad6eaa004a6b
Partial-Bug: #1277104
2015-02-23 12:48:39 -05:00
Doug Shelley
df3afb2abc Add instance name as parameter to CLI
Allow CLI to take instance name as well as instance id for
sub-commands where instance can be specified. This commit
does not include the metadata-* commands as the backend for
that feature isn't merged. The spec will be adjusted to
reflect that they commands will be out of scope.

Affected sub-commands are:
backup-create
backup-list-instance
configuration-attach
configuration-default
configuration-detach
create (just for --replica_of)
database-create
database-delete
database-list
detach-replica
delete
resize-flavor
resize-instance
resize-volume
restart
root-enable
root-show
update
user-create
user-delete
user-grant-access
user-list
user-revoke-access
user-show
user-show-access
user-update-attributes

Unit tests were added to test passing in an instance object
for the affected sub-commands. A new set of unit tests were
added for databases.py (doesn't look like any existed before).

Change-Id: I5554a7d423990ff9cb24437a893d90d212b022b1
blueprint: add-instance-name-to-cli
2014-12-08 14:29:06 -05:00
Jenkins
141d433ceb Merge "Adding command for copying backups" 2014-06-27 12:06:36 +00:00
Steve Leon
fcd19b08a7 Adding command for copying backups
Added sub-command 'backup-copy' that will take a backup ID (could
be from a different region) and copies it to its own region.

Partially implements: blueprint cross-region-backup-availability

Change-Id: Ia9561ead98762fa817e07098a104c39e211315e0
2014-06-03 09:06:42 -07:00
Steve Leon
7170b72ceb Add datastore filter to backup-list
This fix enhances the backup-list command to optionally receive
a datastore name or ID to filter the backup list by. The filter
is sent as a query string.

To attach the query string to the URL and have it still work with
the URL for pagination, i have made some changes in the way url
with query strings are constructed. This includes the pagination
URL.

partially implements: blueprint backup-metadata

Change-Id: I0b9ef3ec7f51ed76517a22f9c0edfdce3694a36f
2014-06-03 09:02:49 -07:00
Sushil Kumar
8bc695bd70 Enabled F821, H306, H402, and H404 flake8 rule
Reasons:
- F821 is disabled.
- H306 is disabled.
- H402 is disabled.
- H404 is disabled.

Changes:
- Updates tox.ini to enable F821, H306, H402 and H404 rules.
- Updates code for F821, H306, H402 and H404 violation.

Change-Id: I772270bb833ac774e080fc63e330d6b333f23de2
2014-05-09 08:54:39 +00:00
Robert Myers
b23b9fbd87 Adding support for incremental backups
* Adds a parent argument to backup-create.
* Adds parent_id to the backup create body if present.

Implements: blueprint incremental-backups

Change-Id: I76f720ae4eadf2a1977c4c2cbf286db4db079b63
2014-01-28 15:24:26 -06:00
Robert Myers
fba4941fd2 Adding pagination support for backups
* add a _pagination method to base Manager
* switched existing paginated list to use the new method
* removed description from backup list and added updated

Implements: blueprint paginate-backup-list

Change-Id: If33c55a35bae8ebd6ed654af5ce6dfd7f9e40096
2013-12-11 10:15:50 -06:00