95 Commits

Author SHA1 Message Date
Eric Harney
811af8f374 Remove "OPTIONAL:" from optional argument help text
All arguments starting with '--' are optional and listed
under the 'Optional arguments:' header by argparse.  Remove
the extra note shown for each argument.

Change-Id: Ic361a3bdbd1f1669458e16b99995f0f108400699
2014-05-22 15:43:31 -04:00
Diane Fleming
0d2bf657ae Update help strings for cinder client
Make text consistent and clear.
Add periods to end of sentences.
Adjust test suite for change

Closes-Bug: #1275881

Change-Id: I1dfde51636e8dc4b42e4c4810c27c1c4ac513d82
2014-04-23 09:06:21 -05:00
Jenkins
71daa36023 Merge "Accept deleting multiple snapshots in one shot" 2014-04-17 19:21:42 +00:00
Jenkins
fc2c916ce4 Merge "CLI for disable service reason" 2014-04-04 07:16:50 +00:00
Xavier Queralt
5a080b4d47 Accept deleting multiple snapshots in one shot
In bug 1241941 the delete and force-delete commands were updated to
accept multiple volumes for deleting in the same call. This patch adds
the same behaviour to the snapshot-delete command.

Closes-Bug: #1284540
Change-Id: I5e4bf8641d7fd261fa24b03832bad08007e43c12
2014-04-03 10:21:23 +02:00
Sergio Cazzolato
5278bdb0c5 Add quota-delete command to cinder client
Add the command quota-delete <tenant_id> to the client.

This change depends on the cinder change:
Ia040a20abb831c311eb13624ddecbbf0f12fdd9f

DocImpact

Implements blueprint quota-delete
Change-Id: I1e5c98154dc3c6de168747eb912b45265cd1b9db
2014-04-01 12:58:41 +00:00
Jay Lau
8a59f2ca57 CLI for disable service reason
Adds cli option to allow users to give reason
for service-disable. Also adds disabled reason
as a column in service list, so any disabled service
can be seen with reason.

A recent cinder change that allows disable-log-reason
allows users to provide reason for disabling service.
This just adds the cli option for the method.

Implements bp record-reason-for-disabling-service

Change-Id: I90f4566764790eeb0c047c4a0fd0108050ab6ad9
2014-03-16 09:34:09 +08:00
Jenkins
bd98d3264b Merge "Import access module from keystoneclient to handle V3 endpoints" 2014-03-13 23:05:32 +00:00
Jenkins
de4f9c42cd Merge "Client support for export and import backup service metadata" 2014-03-12 02:13:16 +00:00
Ronen Kat
c48e41b8b7 Client support for export and import backup service metadata
Add client code to a new admin API for backup-export and
backup-import allowing an admin to copy the backup metadata
details.

client code for https://review.openstack.org/#/c/69351/

blueprint cinder-backup-recover-api
DocImpact new admin API calls backup-import and backup-export

Change-Id: Id306fc9cf562a87bb6a36eae692852eefc592b74
2014-03-04 17:18:40 +02:00
Shao Kai Li
1b0ea8768c Import access module from keystoneclient to handle V3 endpoints
* service_catalog.py will be used only by nova(cinder.py), it will be removed if nova
uses access instead of service_catalog. Then service_catalog.py and
test_service_catalog.py will be removed from cinderclient if necessary.

* Some unit tests are modified.

* Because of JSON format's modification, functions that process cinder
credentials and cinder endpoints are changed.

* Add dependency for keystoneclient in requirements.txt.

Change-Id: Icf7badfdddcf5f55536d95db7242aff58aa34b6e
Closes-Bug: #1263876
bp: service-catalog
2014-03-03 01:16:26 -05:00
Peter Hamilton
3ec28c3309 Fix type-delete to allow deletion by name and ID
This change addresses bug #1286314, fixing type deletion to allow
deletion by either volume type name or ID. The former implementation
only accepted the volume type ID. Help documentation is also updated
to reflect this change.

Change-Id: I0fc66b54a7bcfa4e00a4d136ac513fa40e628dd2
Closes-Bug: #1286314
DocImpact
2014-02-28 15:48:23 -05:00
Mike Perez
7b176c6705 Set v2 commands available for v2 service_type
These commands originally were only available for v1, but this makes
them available for both v1 and v2 service_type.

Change-Id: I26e3f1997aebafa1eb784273c892397522dbbfe2
Closes-Bug: #1284321
2014-02-24 16:17:32 -08:00
Peter Hamilton
6fd8d8e12e Require ctrl_location for encryption-type-create
This bug fix addresses bug #1267168, adding a default value to the
optional control_location parameter for the encryption-type-create
command. Prior to this fix, any invocation of encryption-type-create
that omitted the control_location parameter would fail. The failure
arose from the expectations of the cinder volume encryption type
API extension, which expects to always receive a value for the
control_location on encryption type creation.

control_location indicates which service will conduct the volume
encryption for the encryption-type under consideration; valid options
are 'front-end' (i.e., nova) and 'back-end' (i.e., cinder). The new
default value is 'front-end' and is used whenever control_location
is omitted from encryption-type-create invocation. For prior
discussion and information, see the abandoned patch below:

https://review.openstack.org/#/c/58303/

blueprint encrypt-cinder-volumes
https://blueprints.launchpad.net/nova/+spec/encrypt-cinder-volumes

Change-Id: I8db80929adbf5a3d818b9d3a8115067ae8e7d9e2
Closes-Bug: #1267168
DocImpact
2014-02-12 21:38:41 +02:00
Mike Perez
e31e057ccc Revert "Update cinderclient to skip the additional GET during create"
This reverts commit 47014971b09f0334e5cc3b414bef31784f88a37d.

Conflicts:
	doc/source/index.rst

Change-Id: Ica1e526b2c181d1ce72183b7293d21119371c822
2014-02-04 14:14:22 -07:00
Andrew Kerr
019f43f63f Fixed image_name from image-name in upload-to-image
This fix addresses an issue where the variable name for image_name
was incorrect, causing the image_name parameter to be sent as null
when using "cinder upload-to-image" from cli with v2 of the API

Change-Id: I62f8bbb4397526fb291a46777d9025318da8e5b3
Closes-Bug: 1274552
2014-01-31 18:39:04 -05:00
Avishay Traeger
58d8a00a57 Add volume retype command
Add volume retype to Cinder client.
Cinder code: https://review.openstack.org/#/c/44881/

Change-Id: Ied4902da531386f744403962e4a8ddfb7587c4ef
2014-01-25 15:55:23 -07:00
Jenkins
36a92e1286 Merge "disable/enable a service has no output" 2014-01-25 14:23:20 +00:00
Jenkins
e2642796b8 Merge "Add encryption-type-delete to cinderclient" 2014-01-24 11:39:12 +00:00
Jay Lau
c2ef5eaf49 disable/enable a service has no output
When disable/enable a cinder service, there is no output, this
caused end user does not know if the service was disabled/enabled
successfully.

It is better add some output for the command just like nova to tell
end user the service status.

Change-Id: I9d440ab7437c268b17627e255f152db0b3bf4f53
Closes-Bug: #1261120
2014-01-21 22:57:23 +08:00
Swapnil Kulkarni
47014971b0 Update cinderclient to skip the additional GET during create
With change https://review.openstack.org/64945 cinder V2 API now
returns volume details. Updated do_create in cinderclient
to remove additional GET call.

Change-Id: I2a36f2fa865b52f228bad44e0a9c67d49228321e
Partial-Bug: #1265893
2014-01-08 13:37:41 +05:30
Jenkins
b6f9364f54 Merge "Fix broken argument name in v2 volume extend routine" 2013-12-12 19:47:05 +00:00
Jon Bernard
c6a85e0c1c Fix broken argument name in v2 volume extend routine
The new_size attribute was misspelled, causing the volume extend
operation to fail with:

    ERROR: 'Namespace' object has no attribute 'new_size'

This happens only with the v2 API, v1 works fine.

Change-Id: Icb6b5008dad229f21e7906d9b5342d41f5e760cd
Closes-Bug: #1259552
2013-12-10 08:46:27 -05:00
Eric Harney
0e2bd33265 Reset-state and snapshot-reset-state for multiple objects
This allows a user to call reset-state or snapshot-reset-state on a
list of objects.  The behavior is modeled after a similar change to
delete multiple volumes.

$ cinder reset-state good_volume good_volume_2
<no output>

Error behavior is as follows:

One success/one failure:
$ cinder reset-state good_volume asdf
Reset state for volume asdf failed: No volume with a name or ID of 'asdf' exists.

One failure:
$ cinder reset-state asdf
ERROR: Reset state for volume asdf failed: No volume with a name or ID of 'asdf' exists.

Two failures:
$ cinder reset-state asdf qwert
Reset state for volume asdf failed: No volume with a name or ID of 'asdf' exists.
Reset state for volume qwert failed: No volume with a name or ID of 'qwert' exists.
ERROR: Unable to reset the state for any of the specified volumes.

Related-Bug: 1241941
Closes-Bug: 1256069
Change-Id: Id0a36fb7de0d69be0dac98ea04e4708775250b7a
2013-12-04 08:58:19 -05:00
Peter Hamilton
38388f892b Add encryption-type-delete to cinderclient
This modification adds support for deleting volume encryption types.
The encryption-type-delete command accepts a single argument, the
name or ID of the volume type whose associated encryption type should
be deleted. The encryption type may only be deleted if the associated
volume type is unused.

blueprint encrypt-cinder-volumes

Change-Id: Ie189e7ec91f5a8adc9d3496911de2811ad40f282
2013-11-20 10:16:22 -05:00
Zhi Yan Liu
7ea6c8eb80 Adding volume readonly-mode-update interface to Cinder client
Adding volume readonly-mode-update interface to shell and client object
(v1 and v2) to allow end user update volume read-only access mode flag.

blueprint read-only-volumes

Related-Id: I4c84614d6541d5f7c358abadb957da7b8c3d9c48
Change-Id: I2d587f301a21c0d42b8940465862da25a70ed5a8
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2013-10-24 18:01:05 +08:00
Jenkins
f9e0a9a4a3 Merge "Addition of volume/snapshot_metadata CLI" 2013-10-27 14:21:47 +00:00
Jay Lau
4ce8e800c4 Enable "cinder delete" can delete multiple volumes in one request
"nova delete" can delete multiple servers in one request but
"cinder delete" can only delete one volume in one request, it is
better to enhance cinder client to support remove multiple volumes
in one request.

Change-Id: I6a63aa3d7e4c152ae5e45bf2b36d862bdcd6df33
Closes-Bug: #1241941
2013-10-25 22:58:51 -04:00
Edward Hope-Morley
6b998a9529 Deprecates --volume-id arg for v2 backup-restore
This patch deprecates the --volume-id arg of backup-restore
when using the v2 api and adds (preferred) --volume arg.
Both args are still usable but the former is now listed as
"Deprecated" in the help message.

Change-Id: I2575d93041b26f971c59bc04828b356556617b62
Fixes: bug 1242816
2013-10-23 09:26:19 -07:00
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
saurabh
d3a366fd0d Addition of volume/snapshot_metadata CLI
Added below CLIs:-
1. Set or Delete metadata of a snapshot
2. Show metadata of a snapshot
3. Show metadata of a volume
4. Update all metadata of volume
5. Update all metadata of snapshot

Implements blueprint: add-metadata-cli

Change-Id: Ic2b5f3fce6104d1756879718f666a42549458ad3
2013-10-15 23:41:08 +05:30
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