summaryrefslogtreecommitdiff
path: root/cinderclient/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Support list with 'with_count' in clientTommyLike2017-12-051-2/+8
| | | | | | | | Add 'with_count' parameter in list volume, snapshot and backup APIs. Change-Id: I2b7b41b3579c24703a7a67ab5dc6f960a3ccbdc2 Partial-Implements: bp add-amount-info-in-list-api
* Add pagination for snapshots, backupsGerhard Muntingh2017-06-221-6/+7
| | | | | | | | | | | | | | Allow cinderclient to retrieve more than osapi_max_limit (default 1000) snapshots, backups, etc. Cinder pagination support has been added to the API quite some time ago. Client support was only implemented for volumes. This commit allows other resources to be paginated as well. Change-Id: I9a6f446b680dadedccd14ba49efdef7f5ef0a58a Closes-Bug: #1691229 Co-Authored-By: Gorka Eguileor <geguileo@redhat.com>
* Support list-volume for group showwangxiyuan2017-05-251-2/+7
| | | | | | | | | | V3.25 support query groups with volumes, this patch add the client support. Partial-Implements: blueprint improvement-to-query-consistency-group-detail Partial-Bug: #1663474 Change-Id: Ic0d86b9265f295877eebca97ff450f5efd73b184
* Change "--sort" description in help messagelihaijing2017-03-151-0/+1
| | | | | | | | | | In Cinder server project, class ManageResource just supports 'size' and 'refrence' sort key. So change "--sort" description in manageable-list and snapshot-manageable-list commands help message. Change-Id: Ie07bb73a9b9f2ef1a2a1e90834fcbe1f53cb562d Closes-Bug: #1657988
* Merge "_human_id_cache or _uuid_cache error about completion_cache"Jenkins2017-01-231-1/+6
|\
| * _human_id_cache or _uuid_cache error about completion_cachedrngsl2017-01-181-1/+6
| | | | | | | | | | | | | | | | | | cinderclient raises _human_id_cache or _uuid_cache exception in method completion_cache. Error happend when launching many api request with creating and list volumes on the client host. Change-Id: I5c7de6fbb0a2d5106fca180ae6f940d6b738de93 Closes-Bug: #1634112
* | Add convertation of query parameters to stringMykhailo Dovgal2016-12-301-1/+1
|/ | | | | | | | | | | | | There are some problems with non-ascii chars and special symbols during using cinderclient. This patch closes bug connected with parse.urlencode py27 unicode encode bug by adding convertation of query parameters before creating query string in manager._build_list_url method. Also it fix the problems with encoding in quota commands. Change-Id: I96269cca7ad203eaad02d87b30c16d970b26b25f Closes-Bug: #1636621 Closes-Bug: #1518141
* Move old oslo-incubator code out of openstack/commondineshbhor2016-11-031-1/+1
| | | | | | | | | | | | | | As part of the first community-wide goal, teams were asked to remove the openstack/common package of their projects if one existed. This was a byproduct of the old oslo-incubator form of syncing common functionality. The package, apiclient, was moved to a top level location and cliutils was moved to the common module. There are no oslo specific libraries, the recommended solution is to move it in tree and maintain it there. Change-Id: Iee52004bd33c19d63133577ff466164b85fd6ca6
* Deleting volume metadata keys with a single request1.9.0Yuriy Nesenenko2016-09-011-1/+1
| | | | | | | | | | | | | | | | Deleting multiple volume metadata keys with a single request to improve performance. To delete multiple metadata items without affecting the remaining ones, just update the metadata items with the updated complete list of ones (without items to delete) in the body of the request. This patch uses etags to avoid the lost update problem with volume metadata. The command isn't changed: $ cinder metadata volume_id unset k1 k2 k3 Co-Authored-By: Ivan Kolodyazhny <e0ne@e0ne.info> Depends-On: I575635258c10f299181b8e4cdb51a7ad1f1be764 Implements: blueprint delete-multiple-metadata-keys Change-Id: I8e18133ffee87c240a7af4b8177683ab99330d9e
* Add v3 user messages with paginationAlex Meade2016-09-011-1/+5
| | | | | | | | | | GET /messages GET /messages/{id} DELETE /message/{id} Partially-Implements: blueprint summarymessage Depends-On: I398cbd02b61f30918a427291d1d3ae00435e0f4c Change-Id: Ic057ab521c048a376d2a6bed513b8eb8118810d1
* List manageable volumes and snapshotsAvishay Traeger2016-07-191-2/+5
| | | | | | | | | | | | | Cinder currently has the ability to take over the management of existing volumes and snapshots ("manage existing") and to relinquish management of volumes and snapshots ("unmanage"). The API to manage an existing volume takes a reference, which is a driver-specific string that is used to identify the volume on the storage backend. This patch adds the client code for APIs for listing volumes and snapshots available for management to make this flow more user-friendly. Change-Id: Icd81a77294d9190ac6dbaa7e7d35e4dedf45e49f Implements: blueprint list-manage-existing
* Fix useless api_version of Manager classCao ShuFeng2016-08-231-3/+1
| | | | | | | | | | | | | | | | | Manager's api_version property is used by api_version.wraps. It should not be an "empty" class and the real api_version can be read from Client class. The 3.0 version's upload-to-image doesn't work as excepted because of this useless api_version of VolumeManager class. This patch also fix it and update some unit tests for it, because the changes are co-dependent on one another. Co-Authored-By: Nate Potter <nathaniel.potter@intel.com> Change-Id: I398cbd02b61f30918a427291d1d3ae00435e0f4c Closes-Bug: #1573414 Closes-Bug: #1589040
* Add api-version to get server versionsscottda2016-07-111-0/+8
| | | | | | | | | | | | | Mitaka Cinder added an API to return Versions from the base endpoint URL: http://<url>:8776/ This patch exposes that API for /v3 endpoint microversions 3.0 and above with the command: cinder api-version Implements: blueprint add-get-server-versions Change-Id: Ieb1a56b28188ec17946fe5564b28c165833ffc24
* Support api-microversionsscottda2016-04-191-0/+6
| | | | | | | | | Changes to cinderclient to use microversions. Implements: blueprint api-microversion-support-for-cinderclient api-microversion-support-for-cinderclient Change-Id: I840a1162b88e8ff36fa3fc4e1d6b9317104df3e0
* Merge "Add backup list sorted by data_timestamp"Jenkins2016-03-051-11/+17
|\
| * Add backup list sorted by data_timestampLisaLi2016-02-241-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As Mitaka implments snapshot backup function, created_at shows when backups are created, and data_timestamp shows time when data are taken from volumes. This patch adds data_timestamp as a sort item, so that customers can list backups sorted by data_timestamp. As a result, they can know which backup has latest data. Closes-Bug: #1536065 Change-Id: Ibb680769cc73bd513dee81e55817d87df5958359
* | Merge "Fix omission of request_ids returned to user"Jenkins2016-02-271-2/+5
|\ \ | |/ |/|
| * Fix omission of request_ids returned to userCao Shufeng2016-02-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | ManagerWithFind's find() and findall() function is exposed to users as ManagerWithFind is parent class of VolumeManager, SnapshotManager, etc. When the find() and findall() function is called by users, they should also return request_ids to users. Change-Id: I87dca61f96ff9cf4dc9a443a46d7f559e8b3026f Closes-Bug: 1545975
* | Provide consistency for Wrapper classesAnkit Agrawal2016-02-151-1/+1
|/ | | | | | | | | | | | | | Updated TupleWithMeta class to make it consistent with other Meta classes in order to avoid confusion. Also made provision to call TupleWithMeta with a tuple containing one or more elements. 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 Change-Id: I5a79a4ed8cb4dc83ea3b64499df191750462100d Partial-Implements: blueprint return-request-id-to-caller
* Return wrapper classes with request_ids attributeAnkit Agrawal2016-01-281-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | Return appropriate wrapper classes with request_ids attribute from base class. Note: In cinderclient/base.py->_update method will return None for qos_specs->unset_keys method and for all other cases it returns body of type dict. At few places, wherever the _update method is called, it converts the return value back to the resource class and in all other cases the same return value is returned back to the caller. It's not possible to return request_ids with None so for all cases object of DictWithMeta will be returned from this method. Second approach would be to return (resp, body) tuple from _update method and wherever this method is called, return the appropriate object. These changes will affect v1 version and since v1 is already deprecated the above approach sounds logical. This change is required to return 'request_id' from client to log request_id mappings of cross projects. Change-Id: If73c47ae2c99dea2a0b1f25771f081bb4bbc26f1 Partial-Implements: blueprint return-request-id-to-caller
* Merge "Remove unused code from cinderclient.utils module"Jenkins2015-10-211-1/+1
|\
| * Remove unused code from cinderclient.utils moduleIvan Kolodyazhny2015-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | _format_servers_list_networks method is not used anywhere. It's safe to delete it. We'ge got the same cinderclient.openstack.common.apiclient.HookableMixin class so we don't need to duplicate it in the utils Change-Id: Ifa7f5c1d00c1673811af48575460e6563d2d3180
* | Adding pagination to snapshots and backups listsSergey Gotliv2015-10-051-0/+118
|/ | | | | | | | | | Snapshot and backups pagination was recently implemented in the Cinder backend. This patch is implementing a pagination for the snapshots and backups on the client side in the same way that volume pagination works using limit, marker and sort parameters. Partial-Implements: blueprint extend-limit-implementations Change-Id: Ie3660854407a947f7470b4dc0911704c0a31c1b4
* Add findall server side filteringAnton Arefiev2015-05-221-7/+20
| | | | | | | | | | | | | Findall method in cinderclient/base.py isn't very efficient: it loads the entire list then filters on the Python side. When calling "cinder show 'volName'" on a tenant holding a lot of volumes (> 1000) the run time is too long. On my env show command with 10000 volumes takes ~2 min, after apply this patch few seconds. Closes-Bug: #1449444 Change-Id: I23070d94d5bb100b2dd8677f67d7c8b1e7d34e52
* Added type description for volume type clientGloria Gu2014-12-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | This patch added client handling and unit tests for volume type description: * Added 2 client methods for volume type. default: to get the default volume type update: to upate an existing volume type to update description * Added 2 new command-line operations. type-update (adminitrator only) type-default * type-list should display description. * type-create should have an option for entering the description. The corresponding cinder APIs change volume-type-description: https://review.openstack.org/#/c/131871/ Implements: blueprint volume-type-description Change-Id: I2735d7050d90589d19f45e21096577febdcca8bb
* List all the request items when the list is over osapi_max_limitVincent Hou2014-12-041-3/+35
| | | | | | | | | | | | | Convert the function _list into a loop function, which can retrieve the items from the next link till the limit or the end of items has been reached. This works for v2 only. So far, only volume list in v2 support limit. The limit parameter work for volume list in v2 only, but other list can extend it in future work. Change-Id: I011f0ed1a4ab639f67db6cae580d978c0b44c1bb closes-bug: #1342192
* Remove Python 2.4 compat shimEric Harney2014-09-191-8/+0
| | | | | | | | It's clear that we aren't testing against Python 2.4 (not supported by dependencies like six) and no other client projects have this, so we should drop it. Change-Id: I14108964c0261d9144ced16cee7101d14ca7e644
* Reuse Resource from osloAndrey Kurilin2014-04-041-85/+4
| | | | | | | | | | Class Resource from oslo is equal to code from cinderclient. In the process of unification of the clients code we should reuse common functionality from Oslo. Related to blueprint common-client-library-2 Change-Id: If39e49ff739d659d145725966192acf81975c90c
* Fix typo in cinderclienthuangtianhua2013-11-281-2/+2
| | | | | | | | | sematics --> semantics hypen-separated --> hyphen-separated typicaly --> typically Change-Id: I5df277ef7036082d0e4b079c23d41da809e5270f Closes-Bug: #1254587
* Enable del of other tenants resources by nameJay S. Bryant2013-10-291-1/+4
| | | | | | | | | | | | | | | | | | | | | Currently, due to the way that resources are being retrieved by the findall() function, an administrator can do a list, snapshot-list, etc. with the --all_tenants option and see other tenants' resources. If the admin then tries to delete the another tenants' resource by name, it fails with a 'No <resource> with a name or ID of <name> exists.' error. The solution to this is to change the call to the list() function in findall() to set the all_tenants search option to 1. This causes the admin to get a list of all the resources that they have access to back when the search is done instead of just a list of their resources. The delete by name is then possible. The server takes care of ensuring that only resources that the user has access to are returned. This will enable delete by name for all resources that use the find_resource function. Closes-bug: 1241682 Change-Id: I4e9957b66c11b7e1081f066d189cedc5a3cb2a6c
* python3: Refactor dict for python2/python3 compatChuck Short2013-10-111-1/+1
| | | | | | | | | | | 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>
* Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-281-1/+1
| | | | | | | | | | 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
* Revert "Use exceptions from oslo"John Griffith2013-07-151-1/+1
| | | | | | This reverts commit a7cce08eab5e2e42275b84bd56127bd09b00f5bf Change-Id: I6c0047adbc33d0d6b5890f11853974578c36c78c
* Use exceptions from osloAlessio Ababilov2013-07-011-1/+1
| | | | | | | | | These exceptions can be used in novaclient, keystoneclient, glanceclient, and other client projects. Partially implements: blueprint common-client-library Change-Id: I43918316622b1c1d722872fe30199db6a3a7bb76
* python3: Fix traceback while running testsChuck Short2013-06-191-3/+3
| | | | | | | | | | | | The testsuite is full of the following: TypeError: 'dict_keys' object does not support indexing This is due to the fact in python3 dict methods dict.keys(), dict.items() and dict.values() return “views” instead of lists. Change-Id: Ifa5383e6485fdbabf363fd1442877b2452346c1c Signed-off-by: Chuck Short <chuck.short@canonical.com>
* python3: Fix traceback while running tests.Chuck Short2013-06-151-1/+2
| | | | | | | | | | | | Fix: TypeError: Unicode-objects must be encoded before hashing while running tests. This is due to the fact in python3 hashlib.md5 works with bytes and we are passing unicode strings. Change-Id: I0adde942423af28572473030f6685e12cd8f7dae Signed-off-by: Chuck Short <chuck.short@canonical.com>
* python3: Update for metaclassesChuck Short2013-06-121-2/+1
| | | | | | | | Use six.with_metaclass to create a new class with a base class base and metaclass metaclass. Change-Id: Id1e70f8cae0ac3dd075157f57d41a02b15e655f4 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Merge "Start Gating on Pyflakes and Hacking"Jenkins2013-06-121-1/+1
|\
| * Start Gating on Pyflakes and HackingDirk Mueller2013-06-091-1/+1
| | | | | | | | | | | | | | | | Instead of globally ignoring Pyflakes and Hacking warnings, only blacklist those that occur frequently and fix the others. Start gating on those checks. Change-Id: Ice032c16d445ef08ef018bcdc5c221ab3c323755
* | python3: compatibility for iteritems and iterkeysChuck Short2013-06-111-1/+4
|/ | | | | | | | | | | | | | 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>
* Make ManagerWithFind abstract and fix its descendantsAlessio Ababilov2013-05-191-4/+7
| | | | | | | | | ManagerWithFind requires list() method in its descendants. Make it abstract and fix its improper descendants that do not implement list() (QuotaSetManager and others). Change-Id: I691ca389b5fea4c1bb36499a264b578fa825bbbf Fixes: bug #1180393
* Set pep8 version to 1.1 in test_requiresJohn Griffith2012-06-151-2/+2
| | | | | | | * Fixes bug 1007520 * Changes in pep8 cause new failures Change-Id: Ie678f01a5008b0df6ef43a360b599890cab40776
* Initial split from python-novaclient.0.0Jenkins2012-05-211-0/+293