summaryrefslogtreecommitdiff
path: root/troveclient
Commit message (Collapse)AuthorAgeFilesLines
* Do not make extra API call for listing instancesvictoria-em5.1.2stable/victoriaLingxian Kong2020-11-131-0/+3
| | | | | | | Story: 2008343 Task: 41245 Change-Id: Id6a0dc82430dc601d4102729b3ac010e137881c6
* Support region in CLI5.1.1Lingxian Kong2020-09-151-1/+2
| | | | Change-Id: Ia0580a599fc2385d54def4e18e0780209b82eff7
* Add support of subnet-id and ip-address for creating instance5.1.0Lingxian Kong2020-08-232-9/+59
| | | | Change-Id: Id88e8100a397b1512c73a0b28f14ab8edb221689
* Fix key error when getting private instanceLingxian Kong2020-08-231-1/+1
| | | | Change-Id: Iff7baea5719f5b94d3e89048d17b37c0682dfdb8
* Fix create instanceLingxian Kong2020-08-122-1/+84
| | | | Change-Id: I750434c7ebc9038b0acf0e657768f57981817e1f
* Support getting and updating instance access infoLingxian Kong2020-08-115-60/+106
| | | | | | | * Added "public" and "allowed_cidrs" fields for getting instance. * Added '--is-public/--is-private' and '--allowed-cidr' for updating. Change-Id: Ifc919667e83573bd6c3b7aff205fe08e82667457
* Support rebuild instance CLILingxian Kong2020-08-063-0/+49
| | | | Change-Id: Ieae9216033d1c9ce0078554c7519bc891f50dc35
* Flavor is optional for creating instance5.0.0Lingxian Kong2020-07-263-18/+19
| | | | | | | When creating replicas, flavor is not needed. Replica has the same server settings as the primary. Change-Id: Ia9b43a464763234b84ba163d8c773b21f53f4ee7
* Support backup strategyLingxian Kong2020-07-168-8/+282
| | | | Change-Id: Ic8c20109b287f2f9220379cb249669d18b52893d
* Merge "Replace assertItemsEqual with assertCountEqual"Zuul2020-06-231-1/+1
|\
| * Replace assertItemsEqual with assertCountEqualJoel Capitao2020-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertItemsEqual was removed from Python's unittest.TestCase in Python 3.3 [1][2]. We have been able to use them since then, because testtools required unittest2, which still included it. With testtools removing Python 2.7 support [3][4], we will lose support for assertItemsEqual, so we should switch to use assertCountEqual. [1] - https://bugs.python.org/issue17866 [2] - https://hg.python.org/cpython/rev/d9921cb6e3cd [3] - https://github.com/testing-cabal/testtools/issues/286 [4] - https://github.com/testing-cabal/testtools/pull/277 Change-Id: I444b5919817b6b5cde2165872293076aff6bf6e9
* | Merge "Use unittest.mock instead of mock"Zuul2020-06-231-2/+3
|\ \
| * | Use unittest.mock instead of mockHervé Beraud2020-06-111-2/+3
| |/ | | | | | | | | | | | | | | 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
* | Use primary instead of master for listing instancesLingxian Kong2020-06-171-1/+1
| | | | | | | | Change-Id: I0e597a64fae27016fc06195e8f3531a26753966f
* | Support to create datastore version4.1.0Lingxian Kong2020-06-112-0/+69
| | | | | | | | Change-Id: Ibc7c191a3dbbe8d03cfbc9d41e30833b47ab429f
* | Remove unnecessary API call for listing instancesLingxian Kong2020-06-113-19/+25
|/ | | | Change-Id: Ibd6a1ce15abc12524f49f4091acb38d6841a8476
* Support role for listing instances4.0.0Lingxian Kong2020-06-034-977/+22
| | | | Change-Id: Ia3e8d5d65bc134f3c7bc62ca9c170018be54660c
* Stop to use the __future__ module.Hervé Beraud2020-06-026-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: I73b532283079d346b75a925e2aee707c4de8fa9e
* Remove flavor APILingxian Kong2020-05-0815-458/+21
| | | | Change-Id: I5a35911b5658fdf6bc08844b31cc1325b749526a
* Support to change parameters for the config groupLingxian Kong2020-05-082-0/+100
| | | | | | | | * openstack database configuration parameter set <config> <values> * openstack database configuration set <config> <values> --name NAME \ --description DESC Change-Id: I5a576309daa1751c76a4a0d33c53a8596c8665e8
* Use unittest.mock instead of third party mockSean McGinnis2020-04-1833-33/+35
| | | | | | | | 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>
* Fix KeyError when deleting datastore versionLingxian Kong2020-04-171-1/+1
| | | | Change-Id: Id744d7da68b6586c4b37ada80472a69a8892dbb1
* Update hacking for Python33.3.1Andreas Jaeger2020-03-316-22/+23
| | | | | | | | | The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found. Change-Id: I5da442bb2f1e634e6b3fe37a6ea3820cea1db96f
* Fix resize flavor for instance3.3.0Lingxian Kong2020-01-212-26/+17
| | | | | | Change-Id: I9192857a690585cb3f365b15707dfa98e521e788 Story: #2007188 Task: #38315
* Support to delete datastoreLingxian Kong2020-01-123-0/+41
| | | | Change-Id: Id0fe73eef95bb57ecee706b9eb9b7aae53236e3b
* Support to delete datastore versionLingxian Kong2020-01-073-13/+44
| | | | | | usage: openstack datastore version delete <datastore_version_id> Change-Id: I4b781e68b81a3888d15d002fcf488a1f765c9f6a
* Support to reboot instanceLingxian Kong2020-01-042-4/+43
| | | | | | openstack database instance reboot <instance> Change-Id: Id5ac985399797356165eaac68dd05bc46ee0124d
* Support to force delete instanceLingxian Kong2020-01-042-1/+20
| | | | Change-Id: I20802f199ef943244f27a842743434e1c84c79e5
* Add IP addresses in instance list outputLingxian Kong2019-12-252-8/+15
| | | | Change-Id: I469fe301f438577ee7c897dcddb28cb672e50c6b
* Support log tail/save for instanceLingxian Kong2019-12-163-21/+114
| | | | | | | | | Support to show log content and save instance log files: openstack database log tail [--lines LINES] <instance> <log_name> openstack database log save [--file FILE] <instance> <log_name> Change-Id: I2a4eecca663f9126f770fae4c4be28b3667f91c4
* Support log actions in osc pluginLingxian Kong2019-12-166-72/+163
| | | | | | | | - openstack database log show <instance_id> <log_name> - openstack database log set <instance_id> <log_name> [OPTIONS] Change-Id: I86f414a53e6f6416f96e0040635bb010aa49cf41
* Fix python-openstackclient plugin doc build3.1.0Eric Fried2019-10-223-4/+4
| | | | | | | | | | | | | | | | | | | | Some plugin command option help strings were using invalid syntax to refer to another option. This looked odd in CLI output --marker <ID> Begin displaying the results for IDs greater than thespecified marker. When used with :option:`--limit,` setthis to the last ID displayed in the previous run. and also caused building autoprogram-cliff from python-openstackclient to break with errors like: <ListDatabaseInstances>:1:unknown option: --limit, This commit reformats the help strings to use double backticks, which render sanely in the CLI help and also build properly from python-openstackclient. Change-Id: Ia3fd6d5ec76e0e6d6aee87d8a8790a1ed2d38a26
* Support to create public instanceLingxian Kong2019-09-114-43/+63
| | | | | | | | | Add two params for creating instance: '--is-public' and '--allowed-cidr' Change-Id: I3bc69e3d56d250b562543f0de2c78c05fcaefead Story: 2006500 Task: 36469
* Support backup filteringLingxian Kong2019-08-254-15/+88
| | | | | | | | | | | | | | 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
* Add Python 3 Train unit testsCorey Bryant2019-08-231-7/+12
| | | | | | | | | | | | | | | This is a mechanically generated patch to ensure unit testing is in place for all of the Tested Runtimes for Train. See the Train python3-updates goal document for details: https://governance.openstack.org/tc/goals/train/python3-updates.html Also fix the CI failure due to: https://docs.python.org/3/whatsnew/3.5.html#pep-479-change-stopiteration-handling-inside-generators Change-Id: Ica582f99730c5019a1212d4f58d7d854ad2996fd Story: #2005924 Task: #34254
* Add unit test for Management indexLingxian Kong2019-06-062-1/+14
| | | | Change-Id: If48449acf7037ffb04e1b5b9d1c4b059ea629055
* Merge "Restore the index method for Management class"2.18.0Zuul2019-06-061-0/+4
|\
| * Restore the index method for Management classLingxian Kong2019-06-061-0/+4
| | | | | | | | Change-Id: Id9c9e6352742c672ae3f2764c42dd984c8202544
* | Support to batch delete database instancesLingxian Kong2019-06-064-22/+97
|/ | | | | | | | Allow users to delete database instances in batch, usage: usage: openstack database instance delete [-h] instance [instance ...] Change-Id: I88a15ba1910f7b3294067b54ae4a7a9b4c4a17a5
* Get all the database instances by adminLingxian Kong2019-05-219-73/+124
| | | | | | | | | | | | | | Currently, there is no way for the admin user to get databases of all the projects, which is very important for auditing or billing purpose. With this change, admin user can get all the database instances by running: $ openstack database instances list --all-projects Change-Id: I318907b1d4a63017f4a6f7967312770f8784c1f4 Story: #2005735 Task: #33393
* Update hacking versionZhijunWei2019-01-026-25/+23
| | | | | | | 1. update hacking version to latest 2. fix pep8 failed Change-Id: I49a6d46466b06bd56bed1f15632c9c80ef539b38
* Add python3 compatibility for guest logs featuresMarcin Piwowarczyk2018-10-301-2/+2
| | | | | | | | | | | | | | During working with python3-first goals, I have notticed the log_generator and log_save methods was non compliance with python3. This is what doesn't appears in integration tests because we execute only trove-functional-mysql job which doesn't covers guest-log tests. In separate change I will extend zull definition by scenario tests to avoid similar issues in future. Change-Id: If85dff57afe110991553d510c6af4468a6781f64 Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>
* Add detailed list for instancesBartosz Zurkowski2018-10-122-2/+15
| | | | | | | | | | | | | | | | | | | Currently, listing instances only allows to get basic information about entities. To get the details, one need to query instance "show" endpoint for each instance separately. This is inefficient and exposes API to a heavier load. There are use cases in which we want to obtain detailed information about all instances. In particular, in services integrating with Trove. For example, Vitrage project requires this information to build vertices and edges in the resource graph for RCA analysis. This change extends Trove client by optional parameter allowing user to specify whether API should include more instance details in the response. Change-Id: Iecea2f711a3e23fd63167beb6cab4cecc63bcabe Signed-off-by: Bartosz Zurkowski <b.zurkowski@samsung.com>
* Fix wrong keyword argumentsYotaro Konishi2018-10-022-2/+16
| | | | | | | | | | | | Currently 'openstack database flavor list' command fails when using '--datastore-type' and '--datastore-version-id' options. This change fixes the issue by correcting keyword arguments. This change also adds a test case of listing flavors with the optional arguments. Change-Id: I37be4911d4dda1529e2550344a912e0aa3c50558 Closes-Bug: #1794663
* Merge "Replace assertRaisesRegexp with assertRaisesRegex"Zuul2018-09-262-13/+13
|\
| * Replace assertRaisesRegexp with assertRaisesRegexChuck Short2018-08-272-13/+13
| | | | | | | | | | | | | | | | This replaces the deprecated (in python 3.2) unittest.TestCase method assertRaisesRegexp() with assertRaisesRegex(). Change-Id: Ib260a6549a7a957fc1b91b89156a676922142b04 Signed-off-by: Chuck Short <chucks@redhat.com>
* | Merge "Fix python3 compatibility issues"Zuul2018-09-093-3/+5
|\ \
| * | Fix python3 compatibility issuesMarcin Piwowarczyk2018-08-313-3/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While executing functional tests in trove project, with baseptyhon python3 in change [1], there appears few incompatibilities in troveclient. All of them are directly related to differences in PY3 version. This change removes these issues and will allow to execute functional tests seamlessly. Change details: * troveclient/compat/base.py - dict.iteritems was removed in PY3 because dict.items now does the thing dict.iteritems did in PY2 * troveclient/compat/client.py - json.loads expects string, and PY3 doesnt convert bytes to string. We have to use explicity call decode() which will decode given bytes to string * troveclient/apiclient/base.py - to avoid infinite recursion exception raised when pickling class attributes [1] I9ee34642c700d1e6ba9c2f3891b7fa1f7f7e1e1d Change-Id: I8989fd4798e80eae27408017e1543819a68b4ab1 Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>
* | Sync two parameters of cluster-create to OSCzhanggang2018-08-213-10/+46
|/ | | | | | | | | | | | | The previous patches have add configuration and extended_properties to "trove cluster-create"[1][2], this commit add the two paramenters to OSC, user can pass configuration and extended_properties during "openstack database cluster create". [1] https://review.openstack.org/#/c/583125/ [2] https://review.openstack.org/#/c/589047/ Change-Id: Ic8e3ba4e92d3b65fa65875675f58eead5827976a Signed-off-by: zhanggang <zhanggang@cmss.chinamobile.com>
* Support configuration groups for clustersMarcin Piwowarczyk2018-08-074-3/+36
| | | | | | | | | | | | | | | | | Handles API part implemented in change: I7c0a22c6a0287128d0c37e100589c78173fd9c1a So far passing configuration group was possible only for single instance deployment. As the trove api now already supports configuration attach and detach for clusters, we are able to handle it in client. Configuration will be applied to each cluster instance. Partially implements: blueprint cluster-configuration-groups Change-Id: Ic0840c995cbc34203c76494d7ba522f3e17141a7 Signed-off-by: Marcin Piwowarczyk <m.piwowarczy@samsung.com>