43 Commits

Author SHA1 Message Date
Eric Harney
04ca787f5b Use six.moves.urllib.parse urlencode
Rather than having to do try/except for imports,
just use six.moves for loading this module.

Change-Id: If750253d7e02608fd183675bd97e3956fbfb0853
2016-04-20 10:55:54 -04:00
Tomoki Sekiyama
e1ff87378a Support host-attach of volumes
This patch adds the host_name optional argument to attach API
in order to enable users of cinderclient to attach volumes
not only to the instances but also to the hosts.

The API interface is implemented in
https://review.openstack.org/#/c/34125/ .

Change-Id: I0ff8ef19d1e3073fee1b9ec0f60609c37dfab9ab
Implements: blueprint host-attach
2015-06-01 15:33:18 -04:00
Anton Arefiev
c5c2d67b7f Find resource refactoring
The 'name' field for some resources is called something different,
for example 'display_name' for volumes, 'name' for  volumes type.
So class 'resource' has attribute 'NAME_ATTR' wich contains
attribute name for different resources.

This change removes reduntant call find in resource manager, instead
of it checks NAME_ATTR value.

Related-Bug: #1449444
Change-Id: Ide334d7535c73cbdff72c30319eb539d8f5304d6
2015-05-12 14:52:46 +03:00
Anton Arefiev
235622bf8e Support pagination param limit in volume list in V1
Since v1 api supports limit param in volume list, cinderclient
should support it too.

Change-Id: I60ffe0190a61dee354de5bc60ea3210c666bf6f2
Closes-Bug: #1447162
2015-04-22 16:23:47 +03:00
yatin karel
fa8c7e3d84 cinder list now supports filter by tenant
Admin can now filter volumes on the basis of tenant.
Also updated help argument, to be consistent over the
v1 and v2 shell module.

Closes-Bug: #1341411
Change-Id: I647f0c9331ee4cd27acbfada6cdb9a56f80701b4
2015-04-12 17:02:18 +05:30
Zhiteng Huang
200aeae76c Remove commented code in cinderclient/v1/volumes.py
migrate_volume_completion() function in Volume class was commented
out when it was added.  It hasn't been changed since then.  This
change remove it.

Change-Id: Iad8c88e20268265f9063e2faa2a21514439150ad
2015-01-15 10:56:27 +08:00
Jenkins
0c4010e7fb Merge "Add set-bootable command" 2014-07-16 22:30:28 +00:00
Jenkins
408994c855 Merge "Fix Volume.extend and Volume.update_readonly_flag methods" 2014-06-23 14:45:52 +00: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
HiroyukiEguchi
c364372477 Add set-bootable command
Bootable Status is set to "True" automatically when user
create a volume from a image. But user have to set bootable
status manually when creating a bootable volume manually.

blueprint add-bootable-option

this commit is related to https://review.openstack.org/#/c/84057/

Change-Id: Ib4a44334001b7b9e3b896c2e44607c414e75e952
2014-04-02 09:50:48 +09:00
yrunts
d3236f568e Fix Volume.extend and Volume.update_readonly_flag methods
Correct VolumeManager method signature called from Volume.extend and
Volume.update_readonly_flag methods for v1 and v2 api's.

Change-Id: I2ffb49112d39ad96b91a4173526502a5201666c6
Closes-Bug: #1293423
Closes-Bug: #1294178
2014-03-18 17:35:17 +02:00
Julie Pichon
ea8c9554c9 Fix typos in the volumes and snapshots docstrings
Change-Id: I0e4f3813b8e263ea59e182db153c5b4c6fd2a177
2014-02-26 16:30:53 +00:00
Zhenguo Niu
12ee7b72ff Fix inappropriate comment for volume update api
Change-Id: Id7a436cc864772bd2662fce0ef80d647c9e3dcf0
Closes-Bug: #1264415
2013-12-27 10:38:25 +08:00
wanghao
e8a0e6abdf Fix inappropriate comment for set_metadata
Fix inappropriate comment for the param of set_metadata

Change-Id: I01495f59b11ed88389b0e0f2f5fb34289f64dbac
Closes-Bug: 1254951
2013-11-26 08:07:16 +02:00
Jenkins
e5ae2ff8d7 Merge "Adding volume readonly-mode-update interface to Cinder client" 2013-10-29 08:42:21 +00: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
Zhi Yan Liu
f6f3254d8b Adding Read-Only volume attaching support to Cinder client
Adding mode argument to volume manager attach function.
Allow Nova using read-write or read-only mode to attach a volume to an
instance.

blueprint read-only-volumes

Change-Id: Ib20c7802304d83f4aafef522171ebd47f672d883
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2013-10-24 17:39:32 +08: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
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
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
Seif Lotfy
fdbbb1076e Add print to the upload-to-image command
Change-Id: I4f7fa6f943fce8151ebd609f35c4717f868a5dfb
2013-07-15 00:02:25 +00:00
Mathieu Gagné
d702d5443f Implement ability to extend volume for v1.
Backport implementation from v2 to v1.

Change-Id: Ibb2334859e937a37481308580b072daef068f511
2013-07-08 19:20:27 -04:00
Jenkins
273a829671 Merge "Implement reset-state (os-reset_status) action" 2013-06-25 20:36:00 +00:00
Brian Waldon
7571232c02 Implement reset-state (os-reset_status) action
This change implements a reset-state method in the
cinderclient which exposes the extension: os-reset_status
from the Cinder API.

Fix bug 1190731

Change-Id: I8f631f0f19ca16e0fdd1e3adcf923cc684292887
2013-06-25 13:51:42 -06:00
Chuck Short
cb1149599e python3: Fix import compatibility.
Python3 reorganized the standard library and moved several functions
to different modules. Six provides a consistent interface
to them through the fake six.moves module.

However, the urlparse, urllib2, etc modules have been combined
into one module which Six does not support so do it the old
fashioned way.

Change-Id: Idfb4f8eb538dcc98a1f7befc4487635d7f483973
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-15 18:26:57 -05:00
Chuck Short
d12d7a73ff python3: compatibility for iteritems and iterkeys
Use six to allow python2/pyton3 for iteritems and
iterkeys.

six.iteriems() replaces dictionary.iteritems() (python2)
and dictionary.iterms() (python3)

six.iterkeys() replaces dictionary.iterkeys (python2)
and dictionary.keys() (python3)

Change-Id: I26c80b78a7dedf3aa32eedf01a83ff6d1e592ba7
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-11 13:29:13 -05:00
Eric Harney
fd3351ffa8 Minor typo/message fixes
Correct it's -> its in force-delete message
Print whole bash_completion message in "cinder help"
Reformat some doc strings per PEP-0257

Change-Id: I013b849508beac5c9fe5c6f9d4cdfae54676c29c
2013-04-08 17:11:16 -04:00
john-griffith
07ff48f1de Add ability to call force_delete from cinderclient
We have an admin extension to do this however we never
exposed it via the cinderclient.

This change simply enables access to force-delete for admins.

Change-Id: Ia066d7dd06ccdb9b3a9221cf33086437624e65d8
2013-01-18 16:55:01 -07:00
Avishay Traeger
9a064c3d5c Add upload-to-image function to client.
Support uploading a volume to an image in the image service.

Change-Id: Ief996f92aaf6d7a4fee0bce5ca45b92bee3f6990
Fixes: bug #1099866
2013-01-16 15:58:31 +02:00
John Griffith
765cb3ddbe Add access to update volume metadata.
This implements the cinderclient side of
blueprint: update-vol-metadata

Change-Id: I97c120d69b6d30843009f6a297bb51299799f4ec
2013-01-07 09:15:49 -07:00
John Griffith
24733119fe Add clone volume support to cinderclient.
Adds the option to create a clone of a volume, using --source-volid xxx

relies on Change-Id: I72bf90baf22bec2d4806d00e2b827a594ed213f4

Change-Id: Iad2178deb66c328625fbff747e123044f9d86a88
2012-12-13 21:24:00 +00:00
John Griffith
28d4d6bfd0 Remove attach/detach code from cinderclient
Attach and Detach actions are done in the novaclient, however
during the creation of Cinder a number of these methods were copied into
the Cinder client.  This is dead code and just adds confusion, so let's
rip it out.

Change-Id: Ib96fe0cac26f19e7d9f2aa01c71ba9762e4f8b8e
Fixes: bug #1071003
2012-10-30 10:28:09 -06:00
Clay Gerrard
7cba8eb786 add rename and snapshot-rename commands
Change-Id: I06549f19b846d886fabd611d2167b894c4d02df8
2012-09-20 14:45:34 -05:00
Jenkins
6313c9347e Merge "Fixes bug 1045777." 2012-09-12 23:48:50 +00:00
Rongze Zhu
a4d4601432 Add begin_detaching and roll_detaching functions
Fixes bug #1004382

If nova call nova.volume.cinder.API.begin_detaching and
nova.volume.cinder.API.roll_detaching, it need python_cinderclient
support the functions.

Change-Id: If5d00a7f7991d78243e76a6e22031c185caee80a
2012-09-11 08:26:59 +00:00
Avishay Traeger
081cc2e572 Fixes bug 1045777.
Removed conversion from name to ID, now volume type is properly passed
to Cinder.

Change-Id: Idd83af7a5ace58cb062545be221f93db0805438b
2012-09-05 09:58:42 +03:00
Rongze Zhu
0e1e44733b Correct param comments in docstring
Some methods in cinderclient/v1/volumes.VolumeManager have 'volume'
paramter, but in docstring the paramter is 'server'. So change ":param
server:" to ":param volume:".

Change-Id: I75a86180a830d3ae875ee1aecd45f9a6e39f6e22
2012-08-23 16:55:43 +00:00
Josh Durgin
75b6589ed0 Add image id arg to create
This works with patch set 7 at https://review.openstack.org/#/c/11028/

Change-Id: I113e0dc557500ea52e64d810409548ed1ffafe90
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2012-08-15 22:34:00 -06:00
jakedahn
f29d1c8349 Add all_tenants flag to snapshots and volumes.
Adds search_opts functionality for the following branches:
    * https://review.openstack.org/#/c/10750/
    * https://review.openstack.org/#/c/10855/

Change-Id: I8eb69574d3a0510bb6ac8b14b3e2a50a33542f11
2012-08-05 17:42:35 -07:00
John Griffith
778d2d9022 Add missing parameters to volume create body
* Fixes bug 1028684
* Adds metadata and other parameters to volume create

Change-Id: Iaa0c9fd5edac8b48d92ee9722ea5d31d8249cd67
2012-07-25 11:56:50 -06:00
Anthony Young
12d162d0ee Add client work for new cinder extensions.
* #5 of blueprint volume-decoupling
 * Fix pep8

Change-Id: Icad4eada0cf16a0f49d9a52e593bede0fc0c5289
2012-06-19 15:22:23 -07:00
John Griffith
93f9fa75fa Set pep8 version to 1.1 in test_requires
* Fixes bug 1007520
* Changes in pep8 cause new failures

Change-Id: Ie678f01a5008b0df6ef43a360b599890cab40776
2012-06-15 13:56:39 -06:00
Jenkins
471704df64 Initial split from python-novaclient. 2012-05-21 16:32:35 -04:00