summaryrefslogtreecommitdiff
path: root/openstackclient/volume
Commit message (Collapse)AuthorAgeFilesLines
* Merge "volume: Correct output of 'volume attachment create'"Zuul2022-06-271-7/+16
|\
| * volume: Correct output of 'volume attachment create'Stephen Finucane2022-05-161-7/+16
| | | | | | | | | | | | | | | | | | When adding these, we missed that the underlying cinder library call actually returns a dictionary and not a Resource-based object. This requires slightly different handling. Fix this. Change-Id: Ie065fe4198ae1238830cb619220e856390d4cb6e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "Refactor "volume backup restore" command"Zuul2022-06-202-13/+50
|\ \ | |/ |/|
| * Refactor "volume backup restore" commandHuanxuan Ao2022-03-102-13/+50
| | | | | | | | | | | | | | | | Make the positional argument "volume" optional and add a "--force" option (volume v2 only) to the "volume backup restore" command. Closes-Bug: #1597189 Change-Id: If944e10158bd18e8331be63e96187a23e23095d7
* | Merge "Fix typos"Zuul2022-05-162-2/+2
|\ \
| * | Fix typosCyril Roelandt2021-10-262-2/+2
| |/ | | | | | | Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
* | volume: Add 'block storage resource filter list' commandStephen Finucane2022-05-131-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are based on the 'cinder list-filters' command, which accepts an optional '--resource {resource}' option to limit the listed filters to a single resource type. block storage resource filter list block storage resource filter show We used the 'block storage resource filter' terminology rather than simply 'resource filter' to highlight the fact that this is specific to the block storage service. Note that while this feature is a bit weird, good documentation can be found at [1]. [1] https://docs.openstack.org/cinder/latest/admin/generalized_filters.html Change-Id: I21e7c0ea427aef1f6665394d4b8e9a1f30d6dbb1 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | volume: Add 'block storage cluster *' commandsStephen Finucane2022-05-131-0/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These mirror the 'cinder cluster-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". block storage cluster list block storage cluster set block storage cluster show We used the 'block storage' terminology rather than simply 'volume' to allow us to start distinguishing between the volume service and a volume resource. Change-Id: I9105a9e4a139af4929e3b1f3a6de6c9a53e0b598 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | Merge "volume: fix backup list of deleted volume"Zuul2022-04-111-3/+11
|\ \
| * | volume: fix backup list of deleted volumeJan Hartkopf2022-03-081-3/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to list backups of a deleted volume with --volume, openstackclient fails because the volume does not exist. However, for listing a volume's backups, the volume itself does not need to be present. Fix this issue by allowing the volume of the requested backups to not exist. Story: 2009901 Task: 44716 Change-Id: Iea1a567151f427fa0e1ccff3af5cbeab620defcd Signed-off-by: Jan Hartkopf <jhartkopf@inovex.de>
* | volume list: don't fail when there's no compute serviceDr. Jens Harbott2022-02-171-1/+1
|/ | | | | | | | | | There may be deployments that only have a volume service but no compute service, possibly as an intermediate step during the initial setup. Don't fail the "volume list" command when no compute client can be initiated. Signed-off-by: Dr. Jens Harbott <harbott@osism.tech> Change-Id: Idef77bdc8753a456a4c431b0385318dff6581a65
* Merge "volume: Add 'volume transfer request create --(no-)snapshots' option"Zuul2021-08-261-0/+36
|\
| * volume: Add 'volume transfer request create --(no-)snapshots' optionStephen Finucane2021-07-131-0/+36
| | | | | | | | | | | | | | | | | | This closes a gap with cinderclient's 'transfer-create' command. Change-Id: I7386a7be15c0e3ee87abbcfc2275ba8524c10ff8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Story: 2009054 Task: 42831
* | volume: Add missing 'volume list --offset' parameterStephen Finucane2021-07-271-0/+10
|/ | | | | | | | | | | | | Looking at the code for the ancient v1 cinder API, we see that this supported offset-style pagination [1][2][3]. Add this parameter, simplifying a future patch to standardize pagination across OSC. [1] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L259 [2] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L292 [3] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/common.py#L120 Change-Id: Ifec208ea9ed7afb4bebced6132abb96a3af034b5 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* volume: Add more missing 'volume backup *' optionsStephen Finucane2021-06-101-2/+85
| | | | | | | | Add an additional '--no-property' option to the 'volume backup set' command, along with a brand spanking new 'volume backup unset' command. Change-Id: Id7ca925e0ada03e259f0ecaf3e02af11c900641e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* volume: Add 'volume group snapshot *' commandsStephen Finucane2021-06-101-0/+234
| | | | | | | | | | | | | | These mirror the 'cinder group-snapshot-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". volume group snapshot create volume group snapshot delete volume group snapshot list volume group snapshot show Change-Id: Ia5084749b7c1a5a936fd6d6e8d89b9b80969f68c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* volume: Add 'volume group type *' commandsStephen Finucane2021-06-031-0/+410
| | | | | | | | | | | | | | | | | | These mirror the 'cinder group-type-*' commands, with arguments copied across essentially verbatim. The only significant departure is the merging of some commands, such as 'group-type-default' and 'group-type-list' into 'group type list', and 'group-type-update' and 'group-type-key' into 'group type set/unset'. volume group type create volume group type delete volume group type list volume group type show volume group type set volume group type unset Change-Id: Iee6ee2f1f276e6ef6f75a74f8f2980f14c0d5e2f Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* volume: Add 'volume group *' commandsStephen Finucane2021-06-031-0/+506
| | | | | | | | | | | | | | | | | | | These mirror the 'cinder group-*' commands, with arguments copied across essentially verbatim. The only significant departures are the replacement of "tenant" terminology with "project" and the merging of the various volume group replication action commands into the parent volume group (e.g. 'openstack volume group set --enable-replication' instead of 'cinder group enable-replication') volume group create volume group delete volume group list volume group show volume group set volume group failover Change-Id: I3b2c0cb92b8a53cc1c0cefa3313b80f59c9e5835 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* volume: Add missing 'volume backup *' optionsStephen Finucane2021-06-031-48/+171
| | | | | | | | | | | | | | | | | | | Add a couple of missing options to each command: volume backup create --no-incremental --property --availability-zone volume backup set --property Most of these are version dependent so we add the relevant version checks as part of this work. While we're here, we also make the formatting a little easier on the eye in places. Change-Id: I328d5c981cb32b2ee9a4b1bd43aa36b22347ff63 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* volume: Add 'volume message *' commandsStephen Finucane2021-06-031-0/+165
| | | | | | | | | | | | | This patch implements the necessary commands to utilize the Messages API introduced in Cinder API version 3.3. Version 3.5 built upon this by implementing pagination support for these commands which is present in this patch as well. volume message get volume message list volume message delete Change-Id: I64aa0b4a8d4468baa8c63e5e30ee31de68df999d
* volume: Add 'volume attachment *' commandsStephen Finucane2021-06-031-0/+511
| | | | | | | | | | | | | | | | | | | | These mirror the 'cinder attachment-*' commands, with arguments copied across essentially verbatim. The only significant departure is the replacement of "tenant" terminology with "project". volume attachment create volume attachment delete volume attachment list volume attachment complete volume attachment set volume attachment show Full support for filtering is deferred for now since that's a more complicated change that requires additional commands be added first. TODOs are included to this effect. Change-Id: If47c2b56fe65ee2cee07c000d6ae3688d5ef3b42 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-112-6/+15
| | | | | | | | | 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
* Merge "Switch image to use SDK"Zuul2020-03-251-3/+2
|\
| * Switch image to use SDKArtem Goncharov2020-03-231-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a work to switch OSC from using glanceclient to OpenStackSDK. With this change only v2 is using OpenStackSDK. V1 is still using glanceclient and will be switched in a separate change. Remove the direct depend on keystoneauth- let that flow through openstacksdk. Depends-on: https://review.opendev.org/#/c/698972 Change-Id: I36f292fb70c98f6e558f58be55d533d979c47ca7
* | Merge "Fix faulthy state argument choice"5.1.0Zuul2020-03-243-6/+6
|\ \
| * | Fix faulthy state argument choiceBram Verschueren2019-12-193-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The correct state name for a failing volume snapshot deletion is 'error_deleting' instead of 'error-deleting'. [1] [1] https://opendev.org/openstack/cinder/src/commit/89d6a5042fcb2ede5a0b1112d72fae805ea52fcd/cinder/objects/fields.py#L126 Task: #37844 Story: #2007037 Change-Id: Ia99900ece4f1cd29769b22ddaa3965789d719556
* | | 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
* | Replace six.iteritems() with .items()lihaijing2020-01-0915-48/+33
|/ | | | | | | | | | | | | | | | 1. As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2. In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Co-Authored-By: Akihiro Motoki <amotoki@gmail.com> Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85 Implements: blueprint replace-iteritems-with-items
* 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>
* Merge "Use cliff formattable columns in volume v2 commands"Zuul2019-06-236-69/+169
|\
| * Use cliff formattable columns in volume v2 commandsAkihiro Motoki2019-06-226-69/+169
| | | | | | | | | | | | | | Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I761ccac126208927594ad0d98a3cf5ad8b44bd48
* | Use cliff formattable columns in volume v1 commandsAkihiro Motoki2019-06-225-67/+167
|/ | | | | | | Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: Ib4c5798171e32a8ddc08a37ee1d416e366a71d76
* Merge "Remove deprecated volume commands and args"Zuul2019-06-227-917/+3
|\
| * Remove deprecated volume commands and argsSean McGinnis2019-05-207-917/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following were deprecated over two years ago and can now be removed: * Remove ``backup`` commands in favor of ``volume backup`` * Remove ``snapshot`` commands in favor of ``volume snapshot`` * Remove ``volume create`` options ``--project``, ``--user`` and ``--multi-attach`` * Use of an auth-key positional argument in volume transfers * ``volume transfer request`` no longer accepts 'auth_key' as a positional arg, ``--auth-key`` is now required Internal (non-user-visible) * Rename backup.py to volume_backup.py for Volume v1 and v2, update tests These are backwards incompatible changes and will require a major version bump after they are merged. Change-Id: I94aa7a9824e44f9585ffb45e5e7637b9588539b4 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* | Rename review.openstack.org to review.opendev.orgmelissaml2019-05-121-1/+1
|/ | | | | | | There are many references to review.openstack.org, and while the redirect should work, we can also go ahead and fix them. Change-Id: I82e3797dd4c05e4944f40c950b4fafe9a5334cbf
* Merge "Add --attached / --detached parameter to volume set"Zuul2019-03-061-0/+35
|\
| * Add --attached / --detached parameter to volume setDavid Rabel2019-02-281-0/+35
| | | | | | | | | | | | | | | | | | As to reflect cinder reset-state --attach-status functionality, this patch adds --attached / --detached parameter to OSC's volume set command. Change-Id: Ic8ee928c9ab0e579512cfb7608f63bfcc2993c7b Closes-Bug: #1745699
* | Fix: Restore output 'VolumeBackupsRestore' object is not iterablewhoami-rajat2019-02-271-1/+3
|/ | | | | | | | | | | VolumeBackupsRetore object has '_info' attribute which contains the output data of the restore command which should be returned instead of the 'VolumeBackupsRestore' object. Change-Id: I64b75649c1ac9c24e05a197f7280975564b4d386 Story: 2004740 Task: 28811
* Add volume backup import/export commandsSean McGinnis2018-11-101-0/+82
| | | | | | | | | | | | | | | | | | This adds commands to import and export volume backup records so they can be imported and restored on other Cinder instances or to the original instance if the service or database has been lost and had to be rebuilt. I know this is a commonly used process by some users, so it would be good to have this functionality in osc so they do not have to switch clients. More details about the export and import process can be found here: https://docs.openstack.org/cinder/latest/admin/blockstorage-volume-backups-export-import.html Change-Id: Ic95f87b36a416a2b50cb2193fd5759ab59336975 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Merge "Remove invalid 'unlock-volume' migration arg"Zuul2018-11-081-9/+1
|\
| * Remove invalid 'unlock-volume' migration argSean McGinnis2018-10-261-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an optional flag that can be passed in to a volume migration to tell Cinder to 'lock' a volume so no other process can abort the migration. This is reflected correctly with the --lock-volume argument flag to `openstack volume migrate`, but there is another --unlock-volume flag that is shown in the help text for this command that does not do anything and is not used anywhere. Since there is no action to "unlock" a volume, this just causes confusion - including for Cinder developers that know this API. To avoid confusion, this invalid flag should just be removed from the command. Change-Id: I5f111ed58803a1bf5d34e828341d735099247108
* | Merge "Handle not having cinderclient.v1 available"Zuul2018-10-152-8/+17
|\ \
| * | Handle not having cinderclient.v1 availableSean McGinnis2018-10-122-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 volume backend pool list commandSean McGinnis2018-10-091-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an equivalent for "cinder get-pools" with "volume backend pool list" and "cinder get-pools --detail" with "volume backend pool list --long". Story: 1655624 Task: 136949 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com> Change-Id: I826c9946ffe11340d44ad57914f72fc2a72b6938
* | | Add volume backend capability show commandSean McGinnis2018-10-091-0/+61
|/ / | | | | | | | | | | | | | | | | | | | | Adds and equivalend for "cinder get-capabilities" command to show the capabilities supported by a Cinder backend. Story: 1655624 Task: 26947 Change-Id: I38686a26cd503e45ce0102705a6632994ef10274 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* | Deprecate volume create --project and --user optionsAlan Bishop2018-08-101-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder's volume create API does not support overriding the project_id and user_id, and it silently igores those API inputs. Cinder always uses the project and user info in the keystone identity associated with the API request. If a user specifies the --project or --user option, the volume create is aborted and a CommandError exception is raised. This prevents a volume from being created, but without the desired project/user values. A user wishing to specify alternate values can still do so using identity overrides (e.g. --os-username, --os-project-id). Story: 2002583 Task: 22192 Change-Id: Ia9f910ea1b0e61797e8c8c463fa28e7390f15bf9
* | Fix broken gate jobsFan Zhang2018-08-071-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch aims at fixing the broken gate jobs because of cinder and glance patches [1], [2], [3] and [4]. * Remove parameter `--source-replicated` to drop volume replication v1 support * Address some timing issues with volume transfer requests * Only run Image v1 tests when the test cloud has v1 available * Get tolerant of unexpected additional attributes being returned in Image data [1].https://review.openstack.org/#/c/586293/ [2].https://review.openstack.org/#/c/532503/ [3].https://review.openstack.org/#/c/533564/ [4].https://review.openstack.org/#/c/578755/ Co-Authored-By: Dean Troyer <dtroyer@gmail.com> Co-Authored-By: Monty Taylor <mordred@inaugust.com> Depends-on: https://review.openstack.org/588664 Change-Id: I2a785750e92155185d3344e6116c7f5c6fdd3cbe Signed-off-by: Fan Zhang <zh.f@outlook.com>
* | Pass volume snapshot size to volume createMonty Taylor2018-07-231-3/+13
|/ | | | | | | | | When creating a volume from a snapshot, the size parameter is required and type is checked. Since we have to pass something and it needs to be a valid data type (None is not acceptable) grab the size from the snapshot object and pass it. Change-Id: Ie23e3d23828919234e40336b5c65b22e140d337c