Commit Graph

51 Commits

Author SHA1 Message Date
Lingxian Kong 64f3f62368 Fix detach configuration from instance
Change-Id: Id0853dfb207bbd219755d46a9c0d6b4e897bfbeb
2021-07-09 20:47:13 +12:00
Lingxian Kong a57568397e Support datastore version number
- Support "--datastore-version-number" for creating configuration
- Support "--datastore-version-number" for creating instance
- Support "--version-number" for creating datastore version
- Support "--version-name" for updating datastore version
- Support showing version number for datastore version, instance and
  configuration

Story: 2008358
Task: 41264

Change-Id: Ie84b4506736a82a214b0416f7e451d565552f651
2020-11-21 23:44:42 +00:00
Lingxian Kong 61b76377fd Support getting and updating instance access info
* Added "public" and "allowed_cidrs" fields for getting instance.
* Added '--is-public/--is-private' and '--allowed-cidr' for updating.

Change-Id: Ifc919667e83573bd6c3b7aff205fe08e82667457
2020-08-11 17:35:41 +12:00
Lingxian Kong c23da586e9 Flavor is optional for creating instance
When creating replicas, flavor is not needed. Replica has the same
server settings as the primary.

Change-Id: Ia9b43a464763234b84ba163d8c773b21f53f4ee7
2020-07-26 21:57:05 +12:00
Lingxian Kong adde0d0bed Support log tail/save for instance
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
2019-12-16 15:21:25 +13:00
Lingxian Kong f5a57732a9 Support log actions in osc plugin
- openstack database log show <instance_id> <log_name>
- openstack database log set <instance_id> <log_name>
  [OPTIONS]

Change-Id: I86f414a53e6f6416f96e0040635bb010aa49cf41
2019-12-16 13:41:30 +13:00
Lingxian Kong 4d54360691 Support to create public instance
Add two params for creating instance:
'--is-public' and '--allowed-cidr'

Change-Id: I3bc69e3d56d250b562543f0de2c78c05fcaefead
Story: 2006500
Task: 36469
2019-09-11 21:40:06 +12:00
Marcin Piwowarczyk dfba4159b8 Add python3 compatibility for guest logs features
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>
2018-10-30 14:49:50 +00:00
Bartosz Zurkowski d2220578ff Add detailed list for instances
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>
2018-10-12 15:28:37 +02:00
Doug Hellmann e8d306fa2a turn on warning-is-error for documentation builds
Fix a bunch of formatting issues with docstrings to allow us to turn on
the flag that treats warnings as errors to avoid mal-formed
documentation in the future.

Change-Id: Ic6fb73031e37314c49c41e4621dfd92b9c3f59d5
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-07-13 10:39:32 -05:00
Jenkins 5c8f36676a Merge "Fix Swift Authentication for log commands" 2016-12-27 22:21:03 +00:00
jiansong bd8e56f0e1 Time to get rid of slave_of
Now liberty is end of life,so we can get rid of slave_of

Change-Id: I429a95018a58a92576c52e0a9bc6b1b817c408ea
2016-12-23 01:56:26 +00:00
Morgan Jones 7420dbbe3d Fix Swift Authentication for log commands
Updates the swift authentication handling in v1/instances:_get_swift_client
to set auth_version as appropriate.

Change-Id: I39a22eeb4a9c371f333f81a69d4d429805b935f9
Fixes-bug: 1651502
2016-12-20 11:18:33 -05:00
Morgan Jones aed18902d0 Multi-Region Support
This is an initial attempt at supporting multiple regions.  It should
handle the mechanics of deploying an instance/volume to a remote
region.  Additional changes may be required to allow the guest
agent on the instance to connect back to the originating region.

Co-Authored-By: Doug Shelley <doug@tesora.com>
Depends-On: I386efb2d5c147417af7ea25704405977c9b6bbcd
Change-Id: Ib0b35100c0780dc07c60d20622554ba77c4bc850
2016-11-17 01:28:54 +00:00
Jenkins cbf9d92d82 Merge "Add command to delete BUILD instances and clusters" 2016-08-24 23:37:17 +00:00
Ali Adil 39daba1e9d Add command to delete BUILD instances and clusters
Sometimes an instance/cluster can be stuck in BUILD state forever.
Attempting to delete the instance in this state is currently not
allowed. Add force-delete and reset-status command. Reset-status
will reset the status to ERROR, letting the instance/cluster be
deleted. Force-delete will combine functionality of reset-status
and delete.

Change-Id: I957b4be5030e493e0eb8c6b6855d41b942b2823c
Partial-Bug: #1579141
2016-08-17 19:05:07 +00:00
Morgan Jones 4f3ab58687 Implement Instance Upgrade
This change includes a new "trove upgrade" CLI command and
a new "Instances.upgrade" python API method to implement
the new Instance Upgrade feature.

Change-Id: I6ec2ebb78019c014f87ba5d8cbfd284686c64f30
Implements: blueprint image-upgrade
2016-08-16 14:44:29 +00:00
Jenkins 417af237c9 Merge "Locality support for replication" 2016-06-24 20:26:05 +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
Peter Stachowski 358dbf3c80 Locality support for replication
In order to allow replication sets to be all on the same hypervisor
(affinity) or all on different hypervisors (anti-affinity) a new
argument (locality) needed to be added to the Trove create API.

This changeset addresses the Trove client part of this feature.
A --locality flag is now available on the 'create' command and
is passed to the server for processing.

The --replica_count argument was also cleaned up in that it's not
passed on unless it is set. If --replica_of is specified, the
default is set to '1.'

DocImpact: New functionality

Partially implements: blueprint replication-cluster-locality
Change-Id: I18f242983775526a7f1e2644302ebdc0dac025cf
2016-05-02 22:18:53 +00:00
Craig Vyvial c19a63f032 configuration-* cli allow name of configuration group entered
This will allow a user to specify the configuration group name or the
id to use for all the cli commands related to configuration groups.

Change-Id: I6909b9d8305a42de3d7fbe6c7b7539d7068cc497
Closes-Bug: #1505529
2016-04-22 14:18:10 +00:00
Peter Stachowski 457360c69f Client support for instance module feature
This adds support in the python API and Trove CLI
for instance module commands.  These commands include:

    - module-apply
    - module-remove
    - module-query
    - module-retrieve
    - module-list-instance

The parsing of --instance was modified to allow multiple
modules to be specified.  This was extended to 'nics' as well.

Partially Implements: blueprint module-management
Change-Id: If62f5e51d4628cc6a8b10303d5c3893b3bd5057e
2016-03-11 18:10:50 -05:00
Matt Riedemann 3c71e52b40 Revert "Time to get rid of any last vestiges of slave_of"
This reverts commit a5234f0a07

The change broke trove on stable/liberty since it's a backward
incompatible change.

To avoid capping python-troveclient<2.1.0 in
stable/liberty global-requirements, we have to revert this
change, blacklist the 2.1.0 version in g-r master and
stable/liberty, and then release 2.2.0.

And the slave_of code can't be removed until the last
supported stable branch that uses it is end of life, which
is liberty-eol. For now we keep the slave_of argument in
the instance.create method, but emit a deprecation warning
if it's specified, and we never pass it to the trove API
for the create or edit operations since the API removed
slave_of in 0c94a5bae0aacff7fde9a9742b7d526096e51767.

Change-Id: I9b3ec6c101a89f30e61fc683808506c404e5474f
Partial-Bug: #1538506
2016-03-08 20:12:31 -05:00
Peter Stachowski 2502b505f7 Fix for guest_log authentication failure
Now passing in the tenant_name as part of the os_options
and getting all the options from the Trove client instead
of the environment.

Change-Id: I19155463505500d1ca9a22ee9a58c80ff0c23ac2
2016-02-23 20:03:05 +00:00
Alex Tomic fb33d87fef Client Changes for Guest Log File Retrieval
Implements log file retrieval from the guest agent.  The contents
of the log file are pushed up to a swift container as a series of
objects that represent a subset of the lines in the log.

The following trove CLI commands are implemented:

trove log-list <instance>         : lists log files available on guest
trove log-enable <instance> <log> : enables writing to log file
trove log-disable <instance> <log>: disables writing to log file
trove log-publish <instance> <log>: publishes updates to swift container
trove log-discard <instance> <log>: discards published logs
trove log-tail <instance> <log>   : displays last lines of log
trove log-save <instance> <log>   : saves the entire log to a file

Change-Id: Ic15c455747b9f1966d83d7034c9b748ca5e2cce9
Co-Authored-By: Morgan Jones <morgan@tesora.com>
Co-Authored-By: Alex Tomic <atomic@tesora.com>
Co-Authored-By: Peter Stachowski <peter@tesora.com>
2016-01-27 14:41:15 -05:00
Amrith Kumar a5234f0a07 Time to get rid of any last vestiges of slave_of
The controller (apischema and instance controller) have long
understood that slave_of is going away and has supported
replica_of. Getting rid of the slave_of in the client is now one part
of this final 'cleansing'. Look for a corresponding commit on the
controller side which will clean up the rest of it. That commit is
I87c8a14c06fa5df60ea3ed6b09412dc32fafcec7 and the URL for that review
is https://review.openstack.org/#/c/245845/

Change-Id: I9b905716b704ea9ec9332b48b05c49cccbd04c8b
Partial-Bug: #1461196
Depends-On: I87c8a14c06fa5df60ea3ed6b09412dc32fafcec7
2015-11-16 10:49:51 -05:00
Morgan Jones a36ebe539c Replication V2
The V2 implentation of replication, including:
  - promote-to-replica-source
  - eject-replica-source

Implements: blueprint replication-v2

Change-Id: I9075365a8fae754e29d27d6e371a1d8c8980e26b
Authored-By: Morgan Jones <morgan@parelastic.com>
Co-Authored-By: Peter Stachowski <peter@tesora.com>
2015-03-13 15:51:53 -04:00
Peter Stachowski 9d37dbb716 Fixed typo in exception message
The word 'simultaneously' was incorrectly spelled. This has been fixed.

Change-Id: Id231404b09b1d26274ec9be114d0f304aab02192
2015-01-19 14:34:07 -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
Greg Lucas b287f672ac Use 'replica' instead of 'slave'
Replace the mysql-specific term 'slave' with the more general term
'replica'.

In order to merge properly the client currently handles both 'slave' and
'replica' in certain cases. The 'slave' support will be removed completely
once the trove runtime is updated to be in sync.

Change-Id: Id22d18a84a4ac104ff8af09959e8eb2ae0102e97
Co-Authored-By: Nikhil Manchanda <SlickNik@gmail.com>
Partial-Bug: 1360310
2014-09-05 11:13:37 -04:00
amcrn 6852bdcefc Clusters troveclient Implementation
adds clusters support to the troveclient.

Co-Authored-By: Ranjitha Vemula <rvemula@ebaysf.com>
Co-Authored-By: Michael Yu <michayu@ebaysf.com>
Co-Authored-By: Mat Lowery <mlowery@ebaysf.com>

Partially implements: blueprint clustering

Change-Id: I6ed2c4c79a17fcf8f14c587cab6a8ec3acaf319f
2014-09-02 16:38:56 -07:00
ridhi.j.shah@gmail.com 33c76fab16 Add a drop config-grp command in update instance
As per the current code in the client, there is no option to detach
the configuration group of the instance. This change gives a user the
option to explicitly drop the config group of the instance as part of
the instance update call.

Change-Id: I7defd110549df87afd267d3ebe998904ff6b7483
Closes-Bug: 1359359
2014-09-01 11:45:18 -07:00
Greg Lucas 837569d96b Add new command: detach-replica
Add new command to detach a replica from its replication
source.

Partially Implements: blueprint replication-v1
Co-Authored-By: Nikhil Manchanda <SlickNik@gmail.com>
Change-Id: Ieca67f042c6bcb33f2a4de1acbb330d3eefc0600
2014-08-26 15:17:09 -04:00
Greg Lucas 258b47b2a0 Add 'slave_of' option for enabling replication
Add a new create option (--slave_of) that can be used to enable
replication and configure the newly created instance as a slave of the
specified existing instance.

DocImpact Introduces new option when creating an instance.

partially Implements: blueprint replication-v1
Change-Id: Idf22d3d9e676138969cbdf3afd4903b8e475c313
2014-06-10 08:38:42 -04:00
Simon Chang 0462bad1d8 Rename resize-flavor subcommand to resize-instance
The trove resize-flavor <instance> <flavor_id> subcommand actually
changes the flavor of an instance, not the size of the flavor itself.

To improve clarity, the resize-flavor subcommand was renamed as
resize-instance.

To avoid backward compatibility issues, marked deprecated the
resize-flavor subcommand while we introduce the new resize-instance
subcommand.

DocImpact: This potentially affects any user scripts that may
exist.  Any instructions like:
'trove resize-flavor <instance> <flavor_id>'
should be changed to:
'trove resize-instance <instance> <flavor_id>'

Change-Id: Ie801d5632383b67c3f777487f4b6bc608b4a69e8
Closes-Bug: #1324719
2014-06-02 17:22:12 -04:00
Jenkins 21646a49dc Merge "Allow users the ability to update the instance name" 2014-05-27 11:28:01 +00: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
Iccha Sethi 84de6ee1a0 Allow users the ability to update the instance name
Implements: blueprint update-instance-name

This review provides the user the ability to update the instance
name or/and configuration using the trove client.

Change-Id: If404d4d47c83ca36d7a08ed2a8f1f8dddb7ed677
2014-05-08 11:08:48 -05:00
He Yongli 59ec2bb433 Remove vim header
No need to set tabstop tons of times, this can be set in your vimrc
file instead.

More disucssion:
http://openstack.10931.n7.nabble.com/Remove-vim-modelines-td21780.html

Change-Id: I45766d91f0c0b3622bbdc7dc5517497c87ebee8c
Closes-Bug: #1229324
2014-02-16 13:08:07 +08:00
Craig Vyvial 8bc981aba5 adds support for configurations management
Reason:
Adding configuration group support for the python-troveclient

Changes:
adding configuration api calls
adding the compat client for tests and xml
added the shell cmds for the configurations in the client
made the path to datastore/version/parameters
added unit tests

partially implements blueprint configuration-management

Change-Id: Ifc0b4077c93a805898b4cd157e33172f64e85b55
2014-02-05 16:34:27 -06:00
Andrey Shestakov b62c7da0a9 Add Neutron support
Currently create instance doesnt work in OS installation with Neutron.
To get it work, additional parameter 'nics' should be specified
in Nova 'create' call.
This change allows user to pass 'nics' parameter when create instance.

Syntax to specify '--nic' parameter is same as in novaclient.
--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,port-id=port-uuid>
This parameter can be specified multiple times, to attach multiple
network interfaces to instance.

Closes-Bug: #1257838

Change-Id: I76fb0d99512b1ee70441c924835a900ba0b7acd1
2014-01-29 19:42:39 +02:00
Sushil Kumar a35d358240 Updates common.check_for_exceptions and its calls
Reasons:
- exceptions.from_response has 3 arguments but is being called with
  one argument less, which is url.

Changes:
- Updated common.check_for_exceptions to support urls as needed by
  troveclient.openstack.common.apiclient.exceptions.from_response.
- Adds url to exceptions.from_response calls in troveclient.

Closes-Bug: #1266239

Change-Id: Ie18c90349479f740369f63c48a8d9b463641f84d
2014-01-23 08:43:16 +00: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
Denis Makogon 69c865695f Ignore fewer PEP8/flake8 rules
Reasons:
- code should be pythonicaly clean,
  that is why number of ignored rules should reduced

Changes:
- E125, F811, H102, H103, F201, H23,
  H302, F841, H301, H702, H703 rules are now enabled

Change-Id: Ibf4025162244d3c2f1278b49a76ec1527a729042
2013-12-10 18:49:20 +02:00
Andrey Shestakov 8e4bfa723d Support datastore types
implements blueprint db-type-version

Change-Id: I5dec99c44393c04d86c1a8e19c0b3ca59329fd87
2013-10-31 00:02:02 +02:00
Jenkins ec6062b44d Merge "Import urlutils module from openstack-common" 2013-10-23 15:37:16 +00:00
Jenkins 3ad0b6dae4 Merge "Import exceptions module from openstack-common" 2013-10-23 15:37:15 +00:00
Kui Shi b60095f92f Import urlutils module from openstack-common
urlutils defines a series of urllib/urlparse modules for Python 2&3
compatability.

Partial implements: blueprint py33-support

Change-Id: I55c2c5d479d2f7a86d3a0c207dc40794006d951c
2013-10-23 06:34:33 +08:00
Kui Shi 4ff4fa0661 Import exceptions module from openstack-common
Partial implements: blueprint py33-support

Change-Id: I5ee3e85e1adf76779831beeb0a91591d342c798d
2013-10-23 06:28:27 +08:00
Michael Basnight af4d4ed4f7 Fixing copyright and license headers
* Added HP copyrights as appropriate

Change-Id: If4f30b0caf03b16f5fb4f54185ba80d9fa41d0b0
2013-10-22 11:21:33 -07:00