10 Commits

Author SHA1 Message Date
Ivan Kolodyazhny
603c615ae5 Refactor v2 and v3 APIs support
Now v2 API uses code from v3. It's confusing and logically incorrect.
This patch makes v3 API as an extended version of v2.

The next patches related to this bug duplicated code between v1 and v2,
v2 and v3 will be removed.

Change-Id: I90a2b713556e91db69270a03ef6b798e08f93f90
Partial-Bug: #1643584
2016-12-20 16:29:36 +02:00
scottda
27e6f6f7f8 Add /v3 endpoint support for cinderclient
Add support for Cinder API /v3 endpoint.
A couple of unit tests for /v3 endpoint were added to v3/test_shell.py
to ensure that the v3 shell works, and to also test that modules work
with:
from cinderclient.v2.availability_zones import *
syntax.

Change-Id: I6ae0ada221bebb4ab1850d9c99b10fcbb585201f
Implements: https://blueprints.launchpad.net/python-cinderclient/+spec/add-v3-endpoint-support
2016-04-18 10:49:51 -06:00
Ankit Agrawal
c49fce3909 Add request_ids attribute to resource objects
Added request_ids attribute to resource object for all the
volume_backups, volume_encryption_types and volume_transfers
APIs by updating following APIs:

volume_backups: reset_state, delete, export_record, import_record
volume_transfers: delete
volume_encryption_types: list

Returning list with request_ids as attribute in case of 'list' API
for volume_encryption_types.

These changes are required to return 'request_id' from client to log
request_id mappings of cross projects.

For more details on how request_id will be returned to the caller,
please refer to the approved blueprint [1] discussed with the
cross-project team.
[1] http://specs.openstack.org/openstack/openstack-specs/specs/return-request-id.html

DocImpact
'request-ids' will be returned as an attribute with response object.
User can access it using 'res.request_ids' where 'res' is a
response object.

Change-Id: I2197ca38f6c9a8b0ced5c82d29676b49c9700b09
Partial-Implements: blueprint return-request-id-to-caller
2016-02-16 00:34:58 -08:00
chenying
62aa713a1b Fix three resources not being deleted by using name
There are three resources: VolumeBackup, Snapshot, VolumeTransfer.
None of them can be deleted by using their names on V2.

For example, Snapshot client side filtering fails in the function
findall. The reason is that snapshot object
<class 'cinderclient.v2.volume_snapshots.Snapshot'> does not have
a attribute 'display_name'.

The response of /v2/{tenant_id}/backups/detail does not have
a parameter 'display_name', but have a parameter 'name'.
So class Snapshot does not need to define NAME_ATTR = 'display_name'.
The superclass of Snapshot 'Resource' has defined NAME_ATTR = 'name'.

Closes-Bug: #1497873
Closes-Bug: #1495428
Change-Id: I3c89fd9a82918e8a02385cfccb32dc9c3f4c4095
2015-09-28 02:36:04 +00: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
liyingjun
c01529fa53 Add missing all-tenants option to transfer-list
cinder transfer-list is missing the --all-tenants option, which makes
it inconsistent with 'cinder list'. Without this fix, when running as
admin horizon will need to make multiple queries to cinder (one for
each tenant present in the volume list) in order to display the transfers
that exist for the volumes being shown.

Change-Id: Ic4d72a54c450876ff24c64efd83678062c93a24e
Closes-bug: 1351084
2015-02-24 16:11:46 +08: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
Swapnil Kulkarni
4273bbefb9 Fix typos in cinderclient
Small nit-pics in volume_transfers.

Change-Id: I846b38970b14e6385269a02bb495c63464ea0842
Closes-Bug: #1255905
2014-02-05 16:23:23 +02:00
Xiao Chen
2f0863b7d4 Fix 'search_opts' unexpected keyword argument error
When executing 'encryption-type-create' command using resource
name, it will use the findall() in base.py, then error will
occur because list() in findall() used 'search_opts' argument
which list() in VolumeEncryptionTypeManager did not have. Some
other command like 'transfer-delete' met same issue.

This patch will add 'search_opts' argument in list() function
in child class to avoid the bug.

Closes-Bug: #1248519
Related-Bug: #1252665

Change-Id: If1cd8b812af21335e5d4351766539a927a8fbdf4
2014-01-20 15:43:31 +08:00
Cian O'Driscoll
1d5eea0921 Implements support migration for volume transfer
Implements support for the volume transfer api added to cinder in
https://review.openstack.org/#/c/29227

Change-Id: Idbcdfdd3ef76a8c516e08d1cf351d549254bc8c0
2013-06-17 16:59:20 +01:00