65 Commits

Author SHA1 Message Date
Jenkins
aa0583eaf4 Merge "Fixes broken v1 and v2 api backup-restore" 2013-10-22 11:13:53 +00:00
Jenkins
03acdc2462 Merge "Add quota-usage command" 2013-10-21 18:14:24 +00:00
Edward Hope-Morley
c4ae3dd7a5 Fixes broken v1 and v2 api backup-restore
Also adds unit tests.

Change-Id: I741889d49cffe46bf9165b266a62f2b328354e01
Fixes: bug 1240151
2013-10-15 19:47:02 +01:00
Chuck Short
68fe7735c0 python3: iteration order of dict is unpredictable
In Python 3.3, hash randomization is enabled by default. It causes the
iteration order of dicts and sets to be unpredictable and differ
across Python runs.

Sort the metadata.keys() in reverse order to keep the test cases as is.

Change-Id: I233ada4dae4e9c0bc97bf8fd7d912a0eff9dd5b8
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-10-13 21:15:31 -04:00
Chuck Short
b0b8afaf55 python3: Refactor dict for python2/python3 compat
Python3 changed the behavior of dict.keys such that it is now
returns a dict_keys object, which is iterable but not indexable.
You can get the python2 result back with an explicit call to list.

Refactor list(*.keys()) so that it just uses list().

Change-Id: Ib2e9646ac967e9bd7cc4f47e2099f5d1358808a9
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-10-11 09:04:49 -04:00
Jenkins
edffce38e7 Merge "Error if arguments are not supplied for rename commands" 2013-10-03 23:35:23 +00:00
Jenkins
5e925f8fd3 Merge "Fix find volume for migrate command" 2013-10-03 23:25:32 +00:00
Jenkins
5e41e7e09f Merge "Implement qos support" 2013-10-03 23:21:50 +00:00
Seif Lotfy
6437166e1e Add quota-usage command
Added a new command quota-usage to allow querying the usage of the
quota for a given tenant

Change-Id: I720e6df94f9fedbb8b6385bd1707600542aaea08
2013-10-03 17:43:20 +00:00
Jenkins
10a3c0fc84 Merge "Use v2 endpoint with v2 shell for migration" 2013-10-03 11:13:06 +00:00
Zhiteng Huang
87628cc485 Implement qos support
This patch enables Cinder v1/v2 QoS API support, adding following
subcommands to cinder client:
 * create QoS Specs
  cinder qos-create <name> <key=value> [<key=value> ...]
 * delete QoS Specs
  cinder qos-delete [--force <True|False>] <qos_specs>
  'force' is a flag indicates whether to delete a 'in-use' qos specs,
  which is still associated with other entities (e.g. volume types).
 * update QoS Specs
  - add new key/value pairs or update existing key/value
   cinder qos-key <qos_specs_id> set key=value [key=value ...]
  - delete key/value pairs
   cinder qos-key <qos_specs id> unset key [key ...]
 * associate QoS Specs with specified volume type
   cinder qos-associate <qos_specs_id> <volume_type_id>
 * disassociate QoS Specs from specified volume type
   cinder qos-disassociate <qos_specs_id> <volume_type_id>
 * disassociate QoS Specs from all associated volume types
   cinder qos-disassociate-all <qos_specs>
 * query entities that are associated with specified QoS Specs
   cinder qos-get-associations <qos_specs_id>
 * list all QoS Specs
   cinder qos-list

DocImpact

Change-Id: Ie1ddd29fede8660b475bac14c4fc35496d5fe0bc
2013-10-02 13:42:03 -06:00
Avishay Traeger
7b93e66bf0 Fix find volume for migrate command
Recently _find_volume was removed, but not fixed for migrate.

Change-Id: I72b1b169bc67f89de10b7e729fc461b9114d3789
Closes-Bug: #1231117
2013-09-29 12:16:19 +03:00
ZhiQiang Fan
5ad95e9fd2 Replace OpenStack LLC with OpenStack Foundation
NOTE:
* openstack/common/* should be synced from oslo, so i leave them
untouched.
* add (c) symbol for related lines, leave others untouched.

Change-Id: I46a87c7f248d3468b1fdf5661411962faf2fb875
Fixes-Bug: #1214176
2013-09-28 23:13:54 +08:00
Eric Harney
876bff6398 Error if arguments are not supplied for rename commands
This changes behavior from:
$ cinder rename volume1
$

to

$ cinder rename volume1
ERROR: Must supply either display-name or display-description.

for both 'rename' and 'snapshot-rename'.

Change-Id: I675a3b1428a7fe10653394c80e4a5a473e14c740
2013-09-26 14:38:23 -04:00
Jenkins
665abd9acc Merge "Add volume name arguments" 2013-09-25 07:56:03 +00:00
Avishay Traeger
327b397f63 Use v2 endpoint with v2 shell for migration
Change the volume migration shell to use the v2 endpoint for v2.

Change-Id: I0a902aa5e3f86c0d9562eb75677b11a364f9d371
Closes-Bug: #1230124
2013-09-25 10:30:17 +03:00
Jenkins
37b57ea0de Merge "Fix help messages for name arguments" 2013-09-25 04:07:06 +00:00
Ken'ichi Ohmichi
405702c8c0 Add volume name arguments
This patch adds volume name arguments to the following subcommands:
 * snapshot-create
 * backup-create
 * backup-restore
 * transfer-create

Fixes bug #1220590

Change-Id: Ib0ff6e62d45abb14fa8c7313511ef6f72befe0d5
2013-09-18 16:44:51 +09:00
Avishay Traeger
d7796ef737 Implement ability to migrate volume
Implements ability to call migrate_volume and migrate_volume_completion
APIs. The former includes shell code while the latter is called by Nova
and should not be invoked via shell.

Change-Id: I6e81d7a6321f367a356f0a0dee385221363a4227
2013-09-15 11:41:11 +03:00
Ken'ichi Ohmichi
2ac8f3a337 Fix help messages for name arguments
Users can specify the name of an instance as the argument, which are
passed through find_resource(), instead of the id.
This patch changes some help messages for explaining this behavior.

Related-Bug: #1220590

Change-Id: I9af1259af4319b82b94d7b28536def3107ec5dd5
2013-09-13 01:21:46 +09:00
Jenkins
8ea9fa31e6 Merge "Add volume encryption metadata to cinderclient" 2013-09-01 13:34:12 +00:00
Peter Hamilton
109415c26d Add volume encryption metadata to cinderclient
This modification adds support for volume type encryption to
python-cinderclient, supporting two Cinder API extensions.

The first support set provides accessors to python-cinderclient for
retrieving volume encryption metadata from Cinder. These changes
provide other services (e.g., Nova) access to encryption
metadata (e.g., encryption key UUIDs). See the volume encryption
key API extension in Cinder for more information.

The second support set creates a new python-cinderclient resource
manager, along with matching shell commands, that provides creation
and accessor operations for encryption type information. These
operations allow users and services to define encryption information
(e.g., cipher, key size, encryption provider) for a pre-existing
volume type. See the volume type encryption API extension in Cinder
for more information.

blueprint encrypt-cinder-volumes

Change-Id: Id4b2425d699678eb1997863362ddb9bf5ba6f033
2013-08-21 14:20:41 -04:00
Jenkins
43827f4a56 Merge "Add print for "backup-create" command" 2013-08-14 14:49:23 +00:00
Seif Lotfy
b7297f3052 Add commandline option --metadata for cinder list
Fixes bug: 1203471

Change-Id: I8d0bd839ea467f8995e1588ec51a5590c8b80d69
2013-08-10 22:31:36 +00:00
Seif Lotfy
219798536d Add print for "backup-create" command
For convenience reasons backup-create should print out metadata

Fixes bug: 1210874

Change-Id: I327aaadb3b82c2073cec5807aa429c4ffac6ee0f
2013-08-10 22:00:01 +00:00
Mike Perez
34c7c8c2e2 Add support for multiple cinder endpoints
Before v1 and v2 were set to the same service_type, so you could only
have one set at a time. This assumes the catalog is setup for v1
service_type 'volume' and v2 service_type 'volumev2'.

For backwards compatibility, we will allow v2 to be setup with
service_type 'volume' for existing installations.

Change-Id: Ife6d2cdb12d894b84ea3b276767fb93d487355d5
2013-08-08 11:07:36 -07:00
Jenkins
55b2161c8f Merge "Remove locals() from cinder client code base" 2013-08-03 17:58:02 +00:00
Jenkins
3ad0b81bed Merge "Revert "Add evaluation of --force parameter when creating snapshots"" 2013-08-03 01:23:48 +00:00
John Griffith
aeab4e4335 Revert "Add evaluation of --force parameter when creating snapshots"
This reverts commit 854740c4c793444c955180e7c0c96977e3e06c56

What we should've caught here is that the args actually passes in a Bool, which then fails the .lower().

Also, if we want to do things like check for strings representing bools we should use the utils.bool_from_str() method rather than write it inline like this.
2013-08-03 00:09:23 +00:00
Mike Perez
6193f2ba96 Remove locals() from cinder client code base
Hacking file now disallows locals() usage.

Change-Id: I5049c718c2706d606c12913ae0b33a0fb3263542
2013-07-31 16:03:17 -07:00
Jenkins
53a0344608 Merge "Changes for volume type quotas." 2013-07-31 02:03:46 +00:00
Jenkins
1329e0b94f Merge "Add evaluation of --force parameter when creating snapshots" 2013-07-31 01:58:54 +00:00
Jenkins
3a3801635c Merge "Add availability-zone-list command" 2013-07-29 16:05:16 +00:00
Seif Lotfy
854740c4c7 Add evaluation of --force parameter when creating snapshots
Raise BadRequest Exception if value of --force parameter in
snapshot-create is invalid

Fixes: bug #1014689

Change-Id: If4858dc17cedf027112defb935016137727681cc
2013-07-28 16:18:27 +00:00
Dean Troyer
474c9ee58b Add availability-zone-list command
This is client-side support for the os-availability-zone extension added in
https://review.openstack.org/34813.  As /os-availability-zone/detail is not
yet implemented, adjustments were made to accomodate the lack of hosts
in the returned zone list.

Added for both v1 and v2, basically a copy of the equivalent novaclient command.

Change-Id: Iae806a2b5ea3a2d3c984a138d9c27e169160766e
2013-07-25 14:52:08 -05:00
Jenkins
878098d612 Merge "Add print to the upload-to-image command" 2013-07-25 01:08:23 +00:00
Jenkins
eaad8b0bd0 Merge "Revert "Use exceptions from oslo"" 2013-07-17 17:54:03 +00:00
John Griffith
3d30126e93 Revert "Use exceptions from oslo"
This reverts commit a7cce08eab5e2e42275b84bd56127bd09b00f5bf

Change-Id: I6c0047adbc33d0d6b5890f11853974578c36c78c
2013-07-15 10:30:05 -06:00
Cory Stone
784f53f0a0 Changes for volume type quotas.
blueprint quotas-limits-by-voltype

Change-Id: I1bb676689c79fe1b14a14a81b21105a02ec117ef
2013-07-15 10:48:21 -05:00
Seif Lotfy
fdbbb1076e Add print to the upload-to-image command
Change-Id: I4f7fa6f943fce8151ebd609f35c4717f868a5dfb
2013-07-15 00:02:25 +00:00
Qiu Yu
627b616227 Add os-services extension support
Implement client bindings for Cinder os-services API extension, so
client would be able to list services, enable or disable particular
services.

Usage:
cinder service-list [--host <hostname>] [--binary <binary>]
cinder service-enable <hostname> <binary>
cinder service-disable <hostname> <binary>

This change is depended on following change at Cinder side
I7f3fa889294ca6caebdf46b8689345bcac1cdf54

Implements blueprint os-services-extension

Change-Id: I4a53fd545ed3b446441302d00a429168a996a34a
2013-07-14 23:18:22 +08:00
Mathieu Gagné
1a15caff94 Fix wrong method call for extend subcommand
Ensure extend is called instead of extend_volume
as the latter doesn't exist.

Change-Id: I5a4ce5904dc73586a124f7bddebc8ffd30841980
2013-07-08 19:27:46 -04:00
Jenkins
a3985eeb63 Merge "Enable ability to reset state on snapshots." 2013-07-05 16:45:06 +00:00
Jenkins
a7a48b8fee Merge "Implement ability to extend volume." 2013-07-05 16:37:03 +00:00
John Griffith
ee9f0354ec Enable ability to reset state on snapshots.
Implement the ability to reset-state on snapshots,
exposes os-reset_status from snapshot actions.

Change-Id: I605f41e39fde46ccfe6a53222b798f32c14bc1f8
2013-07-04 09:32:36 -06:00
Jenkins
14108c1e78 Merge "Use exceptions from oslo" 2013-07-03 07:53:47 +00:00
John Griffith
10df5beb39 Implement ability to extend volume.
Implements ability to call extend volume in Version 2 API.

This change includes the needed support in cinderlcient to
utilize/access changes made in the volume-resize change.

Change-Id: Ifc7e2969b885a60e8105b5f3908ac452d0a61fa7
2013-07-02 08:04:37 -06:00
Alessio Ababilov
a7cce08eab Use exceptions from oslo
These exceptions can be used in novaclient, keystoneclient,
glanceclient, and other client projects.

Partially implements: blueprint common-client-library

Change-Id: I43918316622b1c1d722872fe30199db6a3a7bb76
2013-07-01 11:55:31 +03:00
Avishay Traeger
8e7cc89d05 Fix volume info display error on create with v2.
Error due to popping 'links' when it does not exist.

Change-Id: I3f25b97f16699373ef12d9ac47905900b4b631f8
Fixes: bug 1190853
2013-06-26 14:13:41 +03:00
Jenkins
273a829671 Merge "Implement reset-state (os-reset_status) action" 2013-06-25 20:36:00 +00:00