75 Commits

Author SHA1 Message Date
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
Jenkins
8d2e463ac4 Merge "Fixed Version Functionality" 2013-01-18 07:53:34 +00:00
Anita Kuno
fbddead1cb Fixed Version Functionality
In accordance with bug-1068521, cinder version functionality is available via the shell.

Change-Id: If9608291f318057fc8fa61151328d6503a79d70d
2013-01-17 17:50:15 +00: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
Jenkins
61e2a4237f Merge "Add access to update volume metadata." 2013-01-09 07:57:09 +00: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
Monty Taylor
06acb0c009 Move from unittest2 to testtools
Part of blueprint grizzly-testtools

Change-Id: I13e068ca156f12114eaa3a65bdb557e4eb2c988d
2012-12-24 23:39:32 -06:00
Jenkins
bf7b86748a Merge "Add clone volume support to cinderclient." 2012-12-21 08:46:11 +00:00
john-griffith
9a49690096 Add list-extensions capability to cinderclient.
Implements the list extension functionality from novaclient
written by harlowja (Change-Id: I5b72f5ea73c00f1c1a0f09f670d744c820e05837)

This provides a mechanism to view available extensions, and also
starts actually using the cinderclient contrib dir.

Original Author: harlowja

Change-Id: I4f9d04cb8a2aa05c978a2a5a926c9175ee3614bb
2012-12-19 13:07:02 -07:00
Dean Troyer
82e47d0866 Use requests module for HTTP/HTTPS
* Implement correct certificate verification
* Add --os-cacert
* Rework tests for requests

Pinned requests module to < 1.0 as 1.0.2 is now current in pipi
as of 17Dec2012.

Blueprint: tls-verify

Change-Id: I71066ff7297f3b70c08b7ae1c8ae8b6a1b82bbae
2012-12-18 13:58:05 -06:00
Dean Troyer
d3603535d2 Port some additional logging changes from novaclient
* Allows capture of timestamps prior to and after request for timing
  https://review.openstack.org/11519
* Add -X to DELETE and PUT in debug mode
  https://review.openstack.org/12069
* Show request body in curl command
  https://review.openstack.org/12203

Change-Id: I0d87ab6b3c2b35ff843323cb818915e03993a844
2012-12-13 16:44:07 -06:00
Dean Troyer
e30724df5b Bring back the output from client.http_log()
Ported from novaclient https://review.openstack.org/9241
Support CINDERCLIENT_DEBUG as synonym for --debug

Change-Id: Ic03b9e7d84c8db14f6e193ca2b478fd0d70d1299
2012-12-13 15:56:00 -06: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
Monty Taylor
9201cee6ef Update to swapped versioninfo logic.
Change-Id: I6a8dd1c84df0a92c21f468c7dcad1ce79f69c463
2012-11-30 14:30:27 -08:00
Monty Taylor
5adf791360 Align cinderclient version code.
Change-Id: I81d6a279a52656720626357a1c4ca8bb382ef1f8
2012-11-30 14:05:54 -08:00
Jenkins
a74dee000e Merge "Pin pep8 to 1.3.3" 1.0.1 2012-11-22 07:55:01 +00:00
Jenkins
3ca2c99958 Merge "Adding bootable column to volume list view" 2012-11-22 06:13:15 +00:00
Mike Perez
c01e7822f9 Adding bootable column to volume list view
displays whether a volume is bootable based on cinder's api response for
/volumes

Change-Id: I8f6cc6e02be8226914f65717dcb2e0367553e51f
2012-11-21 21:50:18 -08:00
Chuck Short
62eb92a1f2 Pin pep8 to 1.3.3
Apart of making pep8 version standard across all openstack
projects.

Change-Id: If5ef6be394e557b3554a80f1ad9b44d472c273b6
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2012-11-20 09:42:14 -06:00
Christian Berendt
79dc21d171 show help when calling without arguments
When calling cinder without arguments you'll receive the following
output:

error: too few arguments
Try 'cinder help ' for more information.

With this change the help is also shown when calling cinder
without arguments. I think that's the expected behavior.

Change-Id: I8f46f67b7fef472ac344bb74f80cf1b77c4c4745
2012-11-08 23:33:14 +01:00
Cory Stone
112bd60d4e Add retries to cinderclient.
HTTPClient now supports a retries argument. It will reissue requests
for any 5xx or socket (400 with n/a) errors. This retry loop was
"inspired" by swiftclient's loop. It reauths one extra time if
necessary.  It uses backoff times of 1, 2, 4... seconds.

The default is 0 retries. It is also exposed to the shell as well with
a --retries arg.

Change-Id: I67bed02d65155f4a4d5d879bb233f56cc78849fa
2012-11-07 11:11:54 -06:00
Alessandro Pilotti
1abc0b4edf Fixes setup compatibility issue on Windows
Fixes Bug #1052161

"python setup.py build" fails on Windows due to a hardcoded shell path:
/bin/sh

setup.py updated using openstack-common/update.py

Change-Id: Iafae444a43c76560020a84e3a1c5c8cb4b6860da
2012-11-06 19:38:28 +02:00
John Griffith
dcbebd7b78 Revert "Add retries to cinderclient."
This reverts commit 3b1eda3b3bb6678e9c9ec3e783e3e12b0c42f0a4
2012-11-02 22:17:03 +00:00
Cory Stone
3b1eda3b3b Add retries to cinderclient.
HTTPClient now supports a retries argument. It will reissue requests
for any 5xx or socket (400 with n/a) errors. This retry loop was
"inspired" by swiftclient's loop. It reauths one time if necessary.
It uses backoff times of 1, 2, 4... seconds.

The default is 0 retries. It is also exposed to the shell as well with
a --retries arg.

Change-Id: I75d9a13d6c4ba16a5da13d4bf5cad78a777d67d7
2012-11-01 14:42:09 -05:00
Jenkins
7d3749e7c3 Merge "Remove extra-specs from types-list command output" 2012-11-01 19:04:42 +00:00
Jenkins
0288e7fd09 Merge "Remove attach/detach code from cinderclient" 2012-11-01 18:59:45 +00:00
John Griffith
a8be1b2a20 Remove extra-specs from types-list command output
type-list was including the extra-specs info in it's response,
however extra-specs are admin accessible only. As a result only admin
users could run type-list which is not what we want.

Add a seperate admin only call to provide volume-types with associated
extra-specs info (extra-specs-list).

Change-Id: I2a716cd7076fb17fd5f2ceb94363eef0009e9bce
2012-11-01 10:13:06 -06:00
Jenkins
92bd08b9e1 Merge "Add volume_type extra_specs support to client" 2012-10-31 20:24:16 +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
Jenkins
4649420ca2 Merge "Fix support for Unicode volume names" 2012-10-30 16:15:09 +00:00
Dean Troyer
c20d7d902e Add python_cinderclient.egg-info to .gitignore
Change-Id: I24a7a5f423e99a9b6839b5f3a1b1fbf05297dc53
2012-10-23 15:39:12 -05:00
Eric Harney
01dad32c07 Fix support for Unicode volume names
It is possible to create a Unicode volume from the command line,
but it cannot be manipulated by name for operations such as delete.
This is because the find_resource function tries to match the
Unicode string to a regular byte string, and a UnicodeWarning is
issued, failing the match.  Fix by decoding the Unicode name when
trying to match.

Fixes bug 1065275.

Change-Id: I8e19a78bbc1ccb503ccd39dc3b904fc4f6f77858
2012-10-23 15:50:33 -04:00
Doug Hellmann
5a3a18d0cb Add OpenStack trove classifier for PyPI
Add trove classifier to have the client listed among the
other OpenStack-related projets on PyPI.

Change-Id: I904372caf0a8eaa44dd048729b4d87e5333f04cc
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
2012-10-22 18:42:34 -04:00
John Griffith
942ab5c7fe Add volume_type extra_specs support to client
Adds ability to set/clear volume_type extra_specs
via python-cinderclient.

* Adds extra_specs info to the list-types output
* Adds missing tests for volume_types features
* Fixes unset loop so it actually iterates through all of the supplied keys

Change-Id: I3552de722f76389cfef6d4f12320720e022ebfac
2012-10-10 10:02:30 -06:00
Clay Gerrard
7cba8eb786 add rename and snapshot-rename commands
Change-Id: I06549f19b846d886fabd611d2167b894c4d02df8
2012-09-20 14:45:34 -05:00
Vishvananda Ishaya
2e6be694c1 Show volume and snapshot data on create
cinder create and cinder snapshot-create do not display the data
returned from the api. This makes it difficult to find the id of
of the newly created object.

Fixes bug 1053432

Change-Id: I1defafff3fd08f9b3510f70a455d49d470322d82
1.0.0
2012-09-20 14:31:27 +00:00
Adam Gandelman
45bcdcaa22 Fix some pep8 issues.
Replace a few '== None' comparisons with 'if None' to fix
E711 pep8 failures in test suite.

Change-Id: Ibce88b74cd19233820f9b00a4eacdabff6c71a6b
2012-09-17 16:57:47 -07:00
Rongze Zhu
f2424f2921 Remove unused methods in FakeHTTPClient and unused unittests
Removed unittests:

tests/v1/test_limits.py

Modified methods:

get_os_quota_sets_test
get_os_quota_sets_test_defaults
put_os_quota_sets_test
get_os_quota_class_sets_test
put_os_quota_class_sets_test

Removed methods:

get_limits
post_servers
get_servers_1234
get_servers_5678
put_servers_1234
delete_servers_1234
delete_servers_1234_metadata_test_key
delete_servers_1234_metadata_key1
delete_servers_1234_metadata_key2
post_servers_1234_metadata
get_servers_1234_diagnostics
get_servers_1234_actions
get_servers_1234_ips
get_servers_1234_ips_public
get_servers_1234_ips_private
delete_servers_1234_ips_public_1_2_3_4
post_servers_1234_action
get_os_cloudpipe
post_os_cloudpipe
get_flavors
get_flavors_detail
get_flavors_1
get_flavors_2
get_flavors_3
delete_flavors_flavordelete
post_flavors
get_os_floating_ip_pools
get_os_floating_ips
get_os_floating_ips_1
post_os_floating_ips
post_os_floating_ips
delete_os_floating_ips_1
get_os_floating_ip_dns
get_os_floating_ip_dns_testdomain_entries
get_os_floating_ip_dns_testdomain_entries_testname
put_os_floating_ip_dns_testdomain
put_os_floating_ip_dns_testdomain_entries_testname
delete_os_floating_ip_dns_testdomain
delete_os_floating_ip_dns_testdomain_entries_testname
get_images
get_images_detail
get_images_1
get_images_2
post_images
post_images_1_metadata
delete_images_1
delete_images_1_metadata_test_key
get_os_keypairs
delete_os_keypairs_test
post_os_keypairs
get_servers_1234_os_virtual_interfaces
get_os_security_groups
get_os_security_groups_1
delete_os_security_groups_1
post_os_security_groups
get_os_security_group_rules
delete_os_security_group_rules_1
post_os_security_group_rules
get_os_simple_tenant_usage
get_os_simple_tenant_usage_tenantfoo
get_os_certificates_root
post_os_certificates
get_os_aggregates
_return_aggregate
get_os_aggregates_1
post_os_aggregates
put_os_aggregates_1
put_os_aggregates_2
post_os_aggregates_1_action
post_os_aggregates_2_action
delete_os_aggregates_1
get_os_hosts_host
get_os_hosts_sample_host
put_os_hosts_sample_host_1
put_os_hosts_sample_host_2
put_os_hosts_sample_host_3
get_os_hosts_sample_host_startup
get_os_hosts_sample_host_reboot
get_os_hosts_sample_host_shutdown
put_os_hosts_sample_host

Change-Id: I0207a558edbfae8f5e69913c421c31e35fefcf4c
2012-09-13 02:53:33 +00:00
Jenkins
67b5cba433 Merge "Patch for bug #1004382" 2012-09-12 23:51:34 +00:00
Jenkins
6313c9347e Merge "Fixes bug 1045777." 2012-09-12 23:48:50 +00:00
Jenkins
9e69ce1a75 Merge "Implement volume quota support in the cinderclient" 2012-09-12 23:43:35 +00:00
Jenkins
6e7156f0a6 Merge "add tenant_id and make projectid optional" 2012-09-12 21:17:30 +00:00
Jenkins
a416655497 Merge "Add filter options to list and snapshot-list" 2012-09-12 16:40:34 +00:00
Rongze Zhu
5997e233e1 Patch for bug #1004382
Related  change is If5d00a7f7991d78243e76a6e22031c185caee80a

Add new action in tests.v1.fakes.FakeHTTPClient, so it allow to test
os-begin_detaching and os-roll_detaching.
Fix typo in tests/v1/test_volumes.py.

Change-Id: I5c4cd9cc56a7235036b6bab6641554b5919ffbb6
2012-09-12 03:03:46 +00:00
Clay Gerrard
2313ddfc8c add tenant_id and make projectid optional
Add a new optional tenant_id keyword argument to the client classes
cinderclient.client.HTTPClient and cinderclient.v1.client.Client to
support authentication with tenant_id instead of projectid (which is
acctually used as "tenantName" in the auth request body).

Keystone can provide tokens without specifiying the tenant in any form,
but a tenantName _or_ tenantId is required to generate the catalog (the
keystone service code seems to prefer tenantName if both are specified).

When using cinderclient programatically, it may be more convienent,
depending on the context to authenticate with out specificying the
tenant, or by tenant_id instead of tenant_name.  Either way it's
impractial to make the requirement in the client for projectid
(tenantName) if the auth system has no such limitation.

The new client signature is backwards compatible.  There is no change in
behavior for the shell client.

Change-Id: I0c1bdbdabd9acc29133a48a798750323011f1f18
2012-09-11 12:38:09 -05: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
Clay Gerrard
9ba6ed5a90 Add filter options to list and snapshot-list
Change-Id: I9a8b538ad53960700ae7a57d1ceb09b05e3dc468
2012-09-10 12:50:24 -05: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
John Griffith
f270f22cb0 Implement volume quota support in the cinderclient
* fix for bug 1023311
  * Implements quota extensions in cinderclient
  * Implements absolute limits and rate limits

Change-Id: I7e3f8474476cbc03efb2fefcb8400f5fec85ddcb
2012-08-30 09:30:29 -06:00
Jenkins
a153f10b2b Merge "Change '_' to '-' in options" 2012-08-30 15:15:12 +00:00