summaryrefslogtreecommitdiff
path: root/openstackclient/volume/client.py
Commit message (Collapse)AuthorAgeFilesLines
* Blacken openstackclient.volumeStephen Finucane2023-05-101-6/+8
| | | | | | | | | | Black used with the '-l 79 -S' flags. A future change will ignore this commit in git-blame history by adding a 'git-blame-ignore-revs' file. Change-Id: Ic318617c67ab7ce6527f9016b759a1d4b0b80802 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* volume: Allow more versionsStephen Finucane2021-06-031-5/+50
| | | | | | | | | Copy the API version checks from the 'openstackclient.compute.client' module. These will only be necessary until we migrate everything to SDK but it's very helpful until then. Change-Id: I2d9c68db5bf891ffa25fd5a7fc9e8953e44b73ab Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Add check for cinderclient.v2 supportBrian Rosmaita2021-05-201-1/+5
| | | | | | | | | | Block Storage API v2 support is being removed from the cinderclient during the Xena development cycle [0], so add a check to determine whether the available cinderclient has v2 support. [0] https://wiki.openstack.org/wiki/CinderXenaPTGSummary#Removing_the_Block_Storage_API_v2 Change-Id: Id54da1704d94526071f500c36a6e38d6d84aa7b8
* Allow to resize in-use volumesDmitriy Rabotyagov2020-11-111-2/+9
| | | | | | | | | Since Pike (microversion 3.42) [1] Cinder API allows to resize in-use volumes. So no reason not to implement it in CLI. [1] https://opendev.org/openstack/cinder/src/branch/master/cinder/api/openstack/rest_api_version_history.rst#user-content-section-39 Change-Id: I22462a56d261e0a100aac3f27af7be47223edec0
* Honor endpoint override from config for volumeMonty Taylor2020-03-241-0/+4
| | | | | | | | | | | | | | | | I'm guessing we should do this for everyone, but we have volume on the brain right now. Rackspace is in the weird situation where they do support v2 but only have v1 in the catalog (wut) So we need to override the block-storage enpdoint by config. To do that, we need to actually honor the config setting over here in OSC. NOTE: We need to systemically overhaul how we're injesting config over here - because there's too much variation. But we can leave that for another day. Story: 2007459 Task: 39137 Change-Id: Ifddf1ddd5abaa768ab18049c09d18bc269f3a4f5
* Default to Cinder v3 APISean McGinnis2019-09-091-1/+1
| | | | | | | | This switches the default Cinder API version to v3 to prepare for v2 going away. Change-Id: Icca1512b715409e3001c0fd2d1ea663d5e71ec02 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Handle not having cinderclient.v1 availableSean McGinnis2018-10-121-7/+14
| | | | | | | | | | | The Cinder v1 API was deprecated several years ago and may be removed from python-cinderclient in the near future. To handle the case where v1 is no longer present, this updates cinderclient initialization to work without it and give an appropriate error if v1 is requested with a version where it is no longer available. Change-Id: I277d7b48b8ad4cce383ec3722f8117938378f615 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Add Cinder v3 client support for volumesJustin A Wilson2017-02-201-1/+2
| | | | | | Initial Cinder v3 support Change-Id: Idd5074832e80697ed0671f06d3291dfd92dbfb08
* osc-lib: shellDean Troyer2016-08-051-2/+2
| | | | | | | | | | | | | Convert to using ClientManager and OpenStackShell from osc-lib. * Change all internal uses of ClientManager private attributes that are now public in osc-lib's ClientManager. Leave back-compat copies in place in OSC's clientManager so we don't break plugins. * Put some work-arounds in place for changes in osc-lib that we need until a new release makes it through the g-r and u-c change process. * Add a test for Unicode decoding of argv in shell.main() to parallel the one in osc-lib. Change-Id: I85289740d4ca081f2aca8c9b40ec422ad25d302c
* Standardize import formatshizhihui2016-07-221-0/+1
| | | | | | | | According to the rule in http://docs.openstack.org/developer/hacking/#imports I modify some irregular import format. Change-Id: Ibf29ccaf3ddec4a956334cc3368ebee7a66e282c
* Fix foundation copyrightsDean Troyer2016-06-141-1/+1
| | | | | | | | The OpenStack LLC copyrights date from before OpenStack was transferred to the foundation. These appear to be getting copy-pasted to new files so at least should reflect the correct entity. Change-Id: I02953d752cb24ead6aa4ad8bfe257a48317c9f13
* osc-lib: utilsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* i18n support for help and error messages in cinderSheel Rana2016-05-231-3/+4
| | | | Change-Id: I98fbc959034fe0530966291643b381855801de20
* default OS_VOLUME_API_VERSION to v2Steve Martinelli2015-08-241-1/+1
| | | | | | | | | Cinder is trying to deprecate/remove support for v1, so we should, as a client library default to v2 and keep support for v1. Related-Bug: 1467589 Change-Id: I732448a57fc3fd06a8d82ec0f0d2ace671036ca2
* Do not set default versions in parsed argsTerryHowe2015-07-181-5/+3
| | | | | | | | | | | Setting default versions in parsed args makes it so OCC cannot tell if the argument was parsed, an environment variable was set or it is just defaulted. In order to set api versions from OCC, it will have to be defaulted after processing OCC. Closes-Bug: #1453229 Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
* Rename endpoint type to interfaceTerryHowe2015-07-151-3/+2
| | | | | Change-Id: I4e21d09bc747e8210f4f79a1d6c4c7ccf2f25d1c Closes-Bug: #1454392
* Add --os-endpoint-type cli optional argumentRoxana Gherle2015-07-021-0/+5
| | | | | | | | | | | | User should be able to specify the endpoint type through a CLI optional argument/ENV variable setting. We will name this new optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and based on the value given, the service API will use that specific endpoint type. Possible values: public, admin, internal. DocImpact Closes-Bug: #1454392 Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
* Add support for volume v2 APIAmey Bhide2015-05-301-1/+2
| | | | | | | | | | | | | | | Added following commands for volume V2 API: volume show volume delete volume type show volume type delete snapshot show snapshot delete backup show backup delete Implements: blueprint volume-v2 Change-Id: I68bd303c194f304ad15f899d335b72a8bf3ebe10
* Defer client importsDean Troyer2015-04-151-9/+11
| | | | | | | | | | | | So we really weren't deferring the loading of client libs dadgummit, do that for real where possible. This shaves a couple of tenths off the static import times. Also defer as much import-time procesing as possible. This is a little ugly in api.auth but this also eliminates import of the auth plugins until they are needed. Change-Id: Ia11d4b9cf98231d37449103fc29101dc17afb009
* Add region name for identity and volume clientsSteve Martinelli2015-01-211-0/+1
| | | | | | | | | We do not take into account region names for identity and volume clients. Change-Id: I4263e9013226b0adc6b9ad7540d6ad3efb42e809 Co-Authored-By: Eric Helgeson <erichelgeson@gmail.com> Related-Bug: #1405416
* Remove now-unnecessary client creation hacksDean Troyer2014-10-181-18/+2
| | | | | | | | | | | | | | | | | | | | Clients that can use ksc Session don't need the old junk to fake auth anymore: * compute * volume Clients that still need to be fed credentials can pick directly from the auth object in clientmanager. The _token attribute is removed, the token can be retrieved from the auth object: openstackclient/tests/common/test_clientmanager.py This change will break any plugin that relies on getting a token from instance._token. They should be updated to use the above, or preferable, to use keystoneclient.session.Session to create its HTTP interface object. Change-Id: I877a29de97a42f85f12a14c274fc003e6fba5135
* Fix operation on clouds with availability-zonesMonty Taylor2014-10-111-1/+1
| | | | | | | | | In a cloud with AZs, you can get multiple entries back from the service catalog - one for each AZ and then one that is AZ agnostic that's tied to the region. If the region_name is plumbed all the way through, this works as intended. Change-Id: I3b365ea306e8111fc80830672ae8080a5d1dc8e0
* Merge "Add support to list volume extensions"Jenkins2014-07-091-1/+6
|\
| * Add support to list volume extensionsSteve Martinelli2014-07-041-1/+6
| | | | | | | | | | | | | | | | Since cinderclient has support to list extensions, we should add some of the logic to our list extensions command. Change-Id: I7dc7ca325ea9b82194bba6d875e7b8dc1884d77e Closes-Bug: #1337687
* | Clean up make_client() loggingDean Troyer2014-07-081-2/+1
|/ | | | Change-Id: I0b6760a6401b50e3dfb891af75424ae89df42ebc
* Fix find_resource for keystone and cinderTerry Howe2014-06-171-0/+5
| | | | | | | | | | | | | | | | | | | The find_resource method had two hacks in in to support cinder and keystone and I have removed those in favor of a monkey patch for cinder. The find_resource method used to attempt to UUID parse the id, but it would do a manager.get anyway. I changed it to skip the UUID parsing. This will make things run minorly faster and it supports LDAP for keystone. The find_resource used to attempt to use display_name=name_or_id when finding. This was a hack for cinder support, but it breaks keystone because keystone totally messes up with the bogus filter and keystone refuses to fix it. Change-Id: I66e45a6341f704900f1d5321a0e70eac3d051665 Closes-Bug: #1306699
* Skip auth in cinderclientYejia Xu2014-05-051-0/+11
| | | | | | | | | cinderclient can't work well with keystone v3 auth info. We should do it in openstackclient just like compute extension. Closes-Bug: #1315963 Change-Id: I46f794c5315f6a9fe1d9a0e5dc7b84f067d7f792
* Fix volume commands with multiple regionsTerry Howe2014-02-211-0/+1
| | | | | | | | The region_name was not passed into the the client causing volume commands to fail if there were multiple regions. Change-Id: I066dbbc4852f412e017daeeb16a3f186d3f91d2f Closes-Bug: #1241177
* Displaying curl commands for nova and cinder callsFlorent Flament2014-01-021-0/+5
| | | | | | | | | | | | When using the -v option, displays curl equivalent commands and http messages exchanged with the nova and cinder API servers. Displays the same messages as those displayed with the --debug option of python-novaclient and python-cinderclient. Implements: blueprint curl-commands-in-debugging-messages for nova and cinder related calls Change-Id: Ibc8ef79d874334585b81d652b9c7df9e874fffa9
* Expand support for command extensionsDean Troyer2013-11-211-0/+16
| | | | | | | | | | | | Allows client libraries to have complete access to the rest of the OSC ClientManager. In addition, extension libraries can define global options (for API version options/env vars) and define versioned API entry points similar to the in-repo commands. The changes to ClientManager exposed some issues in the existing object api tests that needed to be cleaned up. Change-Id: Ic9662edf34c5dd130a2f1a69d2454adefc1f8a95
* Add options to support TLS certificate verificationDean Troyer2013-10-071-0/+2
| | | | | | | | | | Add --os-cacert and --verify|--insecure options using the same sematics as the other project CLIs. --verify is included for completeness. Bug: 1236608 Change-Id: I8a116d790db5aa4cb17a2207efedce7cb229eba3
* Remove tenant round 1 - global optionsDean Troyer2013-07-311-1/+1
| | | | | | | | | Change the global auth options to use 'project', leave the original tenant options in place but silent for compatability with the existing project CLI auth options. This is the only compatibility for tenant usage in this changeover. Change-Id: I3cce6e552f18822cc9f445ec5f301b0f5d9003f8
* Add Cinder API V1 SupportSteve Martinelli2013-02-081-0/+45
made the changes suggested by dtroyer added client modified setup.py entry points updated pip required added support for create/delete/list volume types openstack list type openstack create type typeName openstack delete type typeNameOrId Change-Id: I43655de151582e37f14dc9550151a66db7a009ab