summaryrefslogtreecommitdiff
path: root/openstackclient/volume/v2
Commit message (Collapse)AuthorAgeFilesLines
* volume: Add 'volume qos set --no-property' optionStephen Finucane2023-05-171-1/+32
| | | | | | | | | Supporting "--no-property" option will apply user a convenient way to clean all properties of volume qos in a short command. The patch adds "--no-property" option in "volume qos set" command and update related test cases and docs. Change-Id: I1fb5b4f0a923bbf557a3af3f63809bde9e84ffd4
* Blacken openstackclient.volumeStephen Finucane2023-05-1012-641/+1076
| | | | | | | | | | 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>
* Merge "Wait for volume being available to set bootable or readonly"Zuul2023-02-221-4/+33
|\
| * Wait for volume being available to set bootable or readonlymatbu2023-02-221-4/+33
| | | | | | | | | | | | | | | | This patch add a check to be sure that the volume created is in a available state before trying to set bootable or readonly flag. Story: 2002158 Change-Id: I8db71fd8cf5bd14eb67880f76d2e9135edeb3ed2
* | Merge "Fix really long help strings"Zuul2023-02-221-6/+8
|\ \
| * | Fix really long help stringsStephen Finucane2022-12-121-6/+8
| |/ | | | | | | | | | | | | | | Each command should have a summary line followed by a longer description, if needed. Some commands were not following this. Fix them. Change-Id: If1ce7654037d192626460f34c069ea0979919b9b Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* | volume: Remove duplication from 'consistency group create' optsStephen Finucane2023-02-141-13/+32
|/ | | | | | | | | The '--consistency-group-source' and '--consistency-group-snapshot' opts are unnecessarily verbose. Shorten them to '--source' and '--snapshot', respectively, maintaining aliases to avoid breaking users. Change-Id: I2b6656a8a09d953eb4406f1d4fd1e804743a8963 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Add test for creating volume from sourcewhoami-rajat2022-11-231-4/+9
| | | | | | | | | | | | | This patch adds a test to create a new volume from source. We also include code changes to pass the right size i.e. either size passed by the user via --size argument or the source volume size. This case is already handled at the API layer[1] but it helps being consistent with passing the right size value as in case of creating a volume from snapshot or backup. [1] https://github.com/openstack/cinder/blob/7c1a5ce7b11964da4537fd6a7d157ede646b9e94/cinder/api/v3/volumes.py#L381-L382 Change-Id: Idc71636dad6bb678fe24f19b0836d2e9bd92d7d2
* Change --size helptext to include backupwhoami-rajat2022-11-221-2/+2
| | | | | | | | | Followup from [1]. Modifying help text of --size argument to include --backup option. [1] https://review.opendev.org/c/openstack/python-openstackclient/+/864893 Change-Id: I12cf60079ebcfe1cd059602fbfc1a13c8fe86803
* Add option to create volume from backupwhoami-rajat2022-11-211-3/+26
| | | | | | | | Support for creating a volume from backup was added in microversio 3.47. This patch adds a --backup option to the volume create command to add that support. Change-Id: Ib26d2d335475d9aacbf77c0fd7b7cda2ba743943
* volume: Volume names are optionalStephen Finucane2022-09-141-1/+2
| | | | | | | Who knew? Change-Id: I1c1a811c0db59250e8a20a87f25c2662bc3ab3e8 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Merge "Refactor "volume backup restore" command"Zuul2022-06-201-6/+38
|\
| * Refactor "volume backup restore" commandHuanxuan Ao2022-03-101-6/+38
| | | | | | | | | | | | | | | | 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-161-1/+1
|\ \
| * | Fix typosCyril Roelandt2021-10-261-1/+1
| |/ | | | | | | Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
* | 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
* 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 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 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>
* Allow to resize in-use volumesDmitriy Rabotyagov2020-11-111-4/+6
| | | | | | | | | 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-242-4/+4
|\ \ | |/ |/|
| * Fix faulthy state argument choiceBram Verschueren2019-12-192-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Replace six.iteritems() with .items()lihaijing2020-01-099-29/+20
|/ | | | | | | | | | | | | | | | 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
* 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
* Merge "Remove deprecated volume commands and args"Zuul2019-06-224-494/+1
|\
| * Remove deprecated volume commands and argsSean McGinnis2019-05-204-494/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-151-1/+3
|\ \
| * | Handle not having cinderclient.v1 availableSean McGinnis2018-10-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Update help text for encryption providerBrianna Poulos2018-02-231-4/+4
| | | | | | | | | The volume encryption provider no longer uses class names. Instead, 'luks' and 'plain' are used. This patch updates the help text for the volume encryption provider to use the new encryption provider format constants. Change-Id: I2911098505a99658e04ac4008e5f3e857db81f95
* Replace "Display Name" by "Name" in volume listRui Chen2017-05-261-3/+3
| | | | | | | | | | | | | | | | | | Current "volume list --name" command use "display_name" as search_opts to send to cinder API, and show the result table with "Display Name" column title in osc, cinder list API support "name" as search opts too, and there is "name" attribute in volume response body, so we can replace all "Display Name" by "Name" in order to keep "volume list" command consistent with other commands, like: server list, network list and so on, only use "Name" attribute for all objects. Support a mapping for volume list -c "Display Name" (Volume v1 and v2) and volume create/show -c "display_name" (Volume v1) for minimal backward compatibility until R release. Change-Id: I120be0118e7bb30093b4237c5eeb69a9eedef077 Closes-Bug: #1657956 Depends-On: I1fb62219b092346ea380099811cbd082cae5bafe
* Fix volume qos spec listDean Troyer2017-04-281-5/+14
| | | | | | | | | | | | | | | This has been sporadically failing in functional tests due to the way the volume qos spec list command calls get_associations() for each spec. When tests run in parallel occasionally a spec from another test is present in the list returned and is deleted before the get_associations() call is made, causing a NotFound exception. We should just keep going when this occurs. * make v1 match v2 * add tests to ensure the exception is being caught and handled Closes-Bug: #1687083 Change-Id: If2d17c1deb53d293fc2c7f0c527a4e4ef6f69976
* Fix NoneType error for volume snapshot create commandHuanxuan Ao2017-04-261-2/+1
| | | | | | | | | | | | | In volume snapshot command, <volume> is the same as <snapshot-name> when --volume is not specified, but <volume> cannot be None, so when <snapshot-name> is not specified (<snapshot-name> is None), a NoneType error appears. So make <snapshot-name> no longer optional, it should be always present. Change-Id: I3d9f10753a8ef601e70816421c160598e2cc811f Closes-bug: #1659894
* Help/docs cleanups: marker, limit, ip-address metavarsDean Troyer2017-04-045-9/+9
| | | | | | | | | | | | Cleanup help strings and docs for clarity and to keep things consistent: * --limit metavar should be <num-resource> to indicate what is being counted * --marker metavar should be <resource> or <resource-id> to indicate the type of value being specified * <*-ip-address> metavars should be just <ip-address> as there is no difference in format between fixed and floating IPs * Move all occurances of '(name or ID)' to end of help text Change-Id: I2c31746ed6ded3845244e03e57d809f8bc0e6b9d
* Fix volume transfers request commandsDean Troyer2017-03-271-18/+57
| | | | | | | | | | | | * Fix volume transfer request accept to actually not crash when trying to call Volume API. * Fix volume transfer request accept syntax to have only one positional argument, which is the ID of the resource in the command * Change the output column order in volume transfer request list to have ID followed by Name then the remaining columns. Closes-bug: 1633582 Change-Id: I5cc005f039d171cc70859f60e7fe649b09ead229