summaryrefslogtreecommitdiff
path: root/cinderclient/v3/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Change "--sort" description in help message"2.0.1Jenkins2017-03-151-2/+2
|\
| * Change "--sort" description in help messagelihaijing2017-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* | Fix service-list command for API v.3.0-3.6Ivan Kolodyazhny2017-03-141-3/+8
|/ | | | | | | | Commit I90a2b713556e91db69270a03ef6b798e08f93f90 introduced an issue with service-list command. It was broken for version from 3.0 to 3.6 Change-Id: I0febcb5debdbe157febfd1d1796e716897bde33d Closes-Bug: #1672705
* Fix all_tenants doesn't work for group listwangxiyuan2017-03-141-2/+4
| | | | | | | | | all_tenants is forgotten to pass by group list. This patch fixed it. Change-Id: I419430e929038c35747c59600be83f2e2d084802 Closes-bug: #1671293
* Merge "Make V3 the default and fixup version reporting"2.0.0Jenkins2017-03-111-1/+19
|\
| * Make V3 the default and fixup version reportingJohn Griffith2017-03-101-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds in a version-list command that reports the min/max versions of the Cinder API supported by this version of the client, and also queries the Cinder API V3 server to obtain min/max micro-versions and report those as well. In addition, we bump the default version of the client to 3.0, of course if you specify V2 in your rc file or on the cmd line that works fine too. I did run into one problem where I broke: cinder.tests.unit.test_shell:test_cinder_service_name Seems to be some hidden trickery with a fake, fixture or mock that I can't figure out. For now I added a skip to that test, but maybe somebody can point out the problem during review. Change-Id: I44e667c511d89de28af758a3c9ea1f812e682f18
* | Group show command should be in V3wangxiyuan2017-02-201-0/+14
| | | | | | | | | | | | | | | | | | Group feature was introduced in Cinder V3, So the command should be there as well. But the "group show" command is in V2 which is wrong. Change-Id: If3ba44b2b188607542bdadfeb58f8e4b363837b7 Closes-bug: #1663496
* | Remove duplicate columns from list outputDinesh Bhor2017-02-141-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you specify duplicate fields in --fields, then it prints duplicate columns on the console. By default 'ID' column is added to the output so if you specified it in --fields, then it shouldn't be displayed twice. A user can pass 'NaMe', ' Name ' or 'naMe' in --fields option and it displays same name values three times under the user supplied column names. If a user doesn't pass --fields option, then it shows "Name" column in the list. To maintain consistency between user supplied column and default column names, converted it into title case and removed leading and trailing whitespaces. Kept ID field as capital only('ID') for consistency. Closes-Bug: #1659742 Change-Id: I98999e4c5934b56cd2e5a3fac1fe4d2a73a0d5a1
* | Add start_version check for do_list() image_metadata optionMitsuhiro Tanino2017-02-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | The image_metadata options requires Cinder API v3.4, but user can specify this option before API v3.4 then the option will be ignored without any warning message. We should check this option using start_version to avoid confusion. Change-Id: I6983494cb6653a9eaf35f4eedba87aeb70b55260
* | Add --metadata option to API v2 cinder list command againMitsuhiro Tanino2017-02-031-4/+4
|/ | | | | | | | | | | | | | | | | | | | | | | In the commit I90a2b713556e91db69270a03ef6b798e08f93f90, --metadata option of do_list() in v2/shell.py was unexpectedly removed and --image_metadata option was added instead of --metadata option. This is wrong fix because --image_metadata option requires API version >= "3.4" and is not supported at API v2. On the other hands, --metadata option of do_list() is supported from API v1. We should remove --image_metadata option and then add --metadata option to do_list() again. Also comment on API v3 cinder list --metadata should be fixed because this doesn't require API >=3.4. Co-Authored-By: Masaki Kimura <masaki.kimura.kz@hitachi.com> Change-Id: Ic7d5cfa2acb47fbf73776e034d958ad8fb9119a8 Closes-Bug: #1661045
* Attach/Detach V2John Griffith2017-01-261-1/+202
| | | | | | | | | | | | | | | | | Add an attachments API This includes a new attachment controller and shell commands. To use you'll need to set your api version `export OS_VOLUME_API_VERSION=3.27` Now you can do things like attach a volume (cinders part at least): `cinder attachment-create --connect True ......` List/show/delete existing attachments: `cinder attachment-list` `cinder attachment-show <attachment-id>` `cinder attachment-delete <attachemnt-id>` Change-Id: I2c463f0910b6c9e37502869b7ec33073f12939f1
* Merge "Fix getting metadata attr error in snapshot-list command"Jenkins2017-01-261-3/+9
|\
| * Fix getting metadata attr error in snapshot-list commandMykhailo Dovgal2017-01-261-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Because of 'start_version' parameter in decorator here [0] we won't have metadata attr in args using api versions from 3.0 to 3.21. This patch changes getting metadata from args logic for compatibility with the api versions 3.0 - 3.21. [0] - https://github.com/openstack/python-cinderclient/blob/b73b3932404c4645e05aaefae5502ab2304a5334/cinderclient/v3/shell.py#L1237 Change-Id: I4aa099556c57c49e9ad74fe80e5591d738cf3aa0 Closes-Bug: #1659561
* | Support filter volumes by group_idwangxiyuan2017-01-251-0/+6
|/ | | | | | | | After v3.10, cinder support filter volumes by group_id, this patch support this feature for client side. Change-Id: Ie7df4d8b81789fd36ca6f91d96a477c88e8d5a52 Partial-Implements: blueprint improvement-to-query-consistency-group-detail
* Removed unnecessary 'service_type' decoratorIvan Kolodyazhny2017-01-231-37/+0
| | | | | | | | | | | | | | | @utils.service_type was introduced with 'Initial split from python-novaclient' commit and used for CLI. Now both Python and Command-line APIs for each version work well without this decorator. Unused 'get_service_type' function is removed too. 'utils.retype_method' removed as well because everything works well without it. Change-Id: Ic2470d8ca9d581b7c47da8d7e6a414c3c78ad27a Partial-Bug: #1643584 Related-Bug: #1621126
* Fix v3 volume list based on image_metadataVivek Agrawal2017-01-191-1/+1
| | | | | | | | | | | volume list filtered on image_metadata does not work as expected. The filtering based on image_metadata depended on non existent utility for extracting image_metadata. Fixed the issue by calling appropriate utility module for extracting image_metadata. Looks like a typo. Change-Id: I13e78277fc1afd22d044bb49b6a5ccc00904228c Closes-bug: #1657650
* Metadata based snapshop filteringVivek Agrawal2017-01-181-0/+91
| | | | | | | | | | | | | | | | | | | | | The snpapshot-list API for cinder gives a list of snapshots based on certain criteria to the user. From microversion 3.22 onwards the snapshot-list API has been enhanced to support snapshot list filtering based on metadata of snapshots. The metadata is stored as key-value pair for every snapshot. With this commit cinder will be queried based on metadata key and value specified in the API snaphot-list. All the snapshots which match the key, value provided by the user along with any other filter criteria will be returned. Added the test cases for the CLI and web requests. DocImpact: "Filters results by a metadata key and value pair. Default=None." on cinder snapshot-list APIImpact Closes-bug: #1569554 Change-Id: Idec0d0d02e7956843f202508e32c023c3cafbb0f
* Refactor v2 and v3 APIs supportIvan Kolodyazhny2016-12-201-2377/+71
| | | | | | | | | | | 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
* Remove extra 'u' from cli outputCao ShuFeng2016-12-161-1/+2
| | | | | | | | | | | | | The unicode_key_value_to_string() function is designed to remove extra 'u' in cinderclient cli output. However this patch[1] bring the extra 'u' back. Let's remove the extra 'u' again. Closes-bug: #1615921 Closes-bug: #1606904 [1] https://review.openstack.org/#/c/342734/ Change-Id: I26f0ad7149f57e935953c2398ba90b7b3585e201
* Fix help message for 'type-list' commandIvan Kolodyazhny2016-11-011-1/+4
| | | | | | | Change help about private volume types according to the implementation. Change-Id: I59d811c4a6afb1a8162cf25ff1a734facbf68d8d Related-Bug: #1637549
* Merge "Showing the metadata readonly value as a separate field"Jenkins2016-10-181-0/+6
|\
| * Showing the metadata readonly value as a separate fieldKarthik Prabhu Vinod2016-09-121-0/+6
| | | | | | | | | | | | | | | | | | Now, cinder show <volume_id>, shows readonly as a separate field. This helps the user to not have to scan all through the volume's metadata field Change-Id: Ib427f7e76e8e28fee97b75413c3032fbee75af86 Closes-bug: #1307098
* | Fix volume type 'is_public' flag updatebhagyashris2016-10-121-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Update 'is_public' flag only if flag is passed as an argument while updating volume type. With this change If 'is_public' flag is not passed by the user, its value will not be updated and only arguments passed to the update api will be updated. Added code to check if none of the argument is passed to update volume-type then it raises the CommandError exception with appropriate error message. Change-Id: Ice52e204ebea5d35f04455e74e16745a8bcce3d4 Closes-Bug: #1548708
* | Merge "Volume detail support glance_metadata in CLI"Jenkins2016-10-051-3/+16
|\ \
| * | Volume detail support glance_metadata in CLIwanghao2016-05-301-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add supporting to allow list volumes filtering by glance_metadata. Cinder code has merged, support it in client. Change-Id: Ifc2124b88c4199700d91a89c9fe68598630877db Implements: blueprint support-volume-glance-metadata-query
* | | remove raise "e"zheng yin2016-09-261-2/+2
| | | | | | | | | | | | | | | | | | | | | when it has an exception, it will call raise without arguments. we can use "raise" replace "raise e", the result is the same. Change-Id: I329932dcb2f49dcd3f0dfd88a5896860322e60ec
* | | Parse filter item "name" correctly for snapshot-listCao Shufeng2016-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinderclient will parse filter item "name" to "display_name" when get snapshot list via v2/v3 api. This works for admin user. However for non-admin user, cinder-api[1] removes "display_name" as an invalid filter item and return the full snapshot list. This change use "name" as filter of snapshots rather than "display_name". [1]: https://github.com/openstack/cinder/blob/master/cinder/api/v2/snapshots.py#L87-#L93 Co-Authored-By: cheneydc <dongc@neunn.com> Change-Id: I63b6049a417293534079012dc6ee2a5b25e176be Closes-Bug: #1554538
* | | Deleting volume metadata keys with a single request1.9.0Yuriy Nesenenko2016-09-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Add support for group snapshotsxing-yang2016-07-191-0/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for group snapshots. Server side API patch was merged: https://review.openstack.org/#/c/361369/ Current microversion is 3.14. The following CLI's are supported: cinder --os-volume-api-version 3.14 group-create-from-src --name my_group --group-snapshot <group snapshot uuid> cinder --os-volume-api-version 3.14 group-create-from-src --name my_group --source-group <source group uuid> cinder --os-volume-api-version 3.14 group-snapshot-create --name <name> <group uuid> cinder --os-volume-api-version 3.14 group-snapshot-list cinder --os-volume-api-version 3.14 group-snapshot-show <group snapshot uuid> cinder --os-volume-api-version 3.14 group-snapshot-delete <group snapshot uuid> Depends-on: I2e628968afcf058113e1f1aeb851570c7f0f3a08 Partial-Implements: blueprint generic-volume-group Change-Id: I5c311fe5a6aeadd1d4fca60493f4295dc368944c
* | | Add generic volume groupsxing-yang2016-07-191-3/+168
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to generic volume groups. Server patch is here: https://review.openstack.org/#/c/322459/ Current microversion is 3.13. The following CLI's are supported: cinder --os-volume-api-version 3.13 group-create --name my_group <group type uuid> <volume type uuid> cinder --os-volume-api-version 3.13 group-list cinder --os-volume-api-version 3.13 create --group-id <group uuid> --volume-type <volume type uuid> <size> cinder --os-volume-api-version 3.13 group-update <group uuid> --name new_name description new_description --add-volumes <uuid of volume to add> --remove-volumes <uuid of volume to remove> cinder --os-volume-api-version 3.13 group-show <group uuid> cinder --os-volume-api-version 3.13 group-delete --delete-volumes <group uuid> Depends-on: I35157439071786872bc9976741c4ef75698f7cb7 Change-Id: Icff2d7385bde0a7c023c2ca38fffcd4bc5460af9 Partial-Implements: blueprint generic-volume-group
* | Merge "Changed backup-restore to accept backup name"Jenkins2016-08-261-1/+1
|\ \
| * | Changed backup-restore to accept backup nameEllen Leahy2016-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Beckup-restore does not currently accept the name of the backup, however other backup actions do and according to its description backup-restore should as well. Change-Id: I26d8d2f1fe6cf7362d23d9b9668936dbb0509251 Closes-Bug: #1604892
* | | Enhance help message of upload_to_imageCao Shufeng2016-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the commit fb2c434c2461a25193067104de766fc1142a6024 in the cinder repo the --force option to upload-to-image is ignored by default. To enable it the config option enable_force_upload must be set to true. The help text for upload-to-image in the python cinderclient should remind user that --force may not work in some cloud now. Closes-Bug: #1611667 Change-Id: Ib56fb2016d933a9bbbcb0185c50e33d2166b34e6
* | | Merge "Fix useless api_version of Manager class"Jenkins2016-08-241-9/+18
|\ \ \
| * | | Fix useless api_version of Manager classCao ShuFeng2016-08-231-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 group types and group specsxing-yang2016-07-141-0/+142
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for group types and group specs in the client. Server patch is merged: https://review.openstack.org/#/c/320165/ Current microversion is 3.11. The following CLI's are supported. cinder --os-volume-api-version 3.11 group-type-create my_test_group cinder --os-volume-api-version 3.11 group-type-list cinder --os-volume-api-version 3.11 group-type-show my_test_group cinder --os-volume-api-version 3.11 group-type-key my_test_group set test_key=test_val cinder --os-volume-api-version 3.11 group-specs-list cinder --os-volume-api-version 3.11 group-type-key my_test_group unset test_key cinder --os-volume-api-version 3.11 group-type-update <group type uuid> --name "new_group" --description "my group type" cinder --os-volume-api-version 3.11 group-type-delete new_group Change-Id: I161a96aa53208e78146cb115d500fd6b2c42d046 Partial-Implements: blueprint generic-volume-group
* | | Merge "deprecate command `cinder endpoints`"Jenkins2016-08-191-0/+5
|\ \ \
| * | | deprecate command `cinder endpoints`Steve Martinelli2016-08-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command `cinder endpoints` will now print a warning message, indicating that users should use openstackclient instead. This has already been done in nova's CLI [1]. Related-Bug: 1608166 [1] https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/shell.py#L4071-L4072 Change-Id: If68b40cf8116aa0ec386d8067c58703cb7b7c0da
* | | | Add "start_version" and "end_version" support to argparseCao Shufeng2016-08-161-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, "cinder help subcommand" can not show whether an argument is supported for a specific microversion. With this change, developers only need to add a start_version or end_version in the utils.arg wrap, cinderclient will support the microversion for that arguement. @utils.arg( '--foo', start_version='3.1') @utils.arg( '--bar', start_version='3.2', end_version='3.5') def do_some_action(): ...... In previous example, an exception will be raised for such command: $ cinder --os-volume-api-version 3.6 --bar some-ation And only "--foo" will show up for such help command: $ cinder --os-volume-api-version 3.1 help some-ation Change-Id: I74137486992846bbf9fdff53c009851db2356eef Partial-Bug: #1600567 Co-Authored-By: Nate Potter <nathaniel.potter@intel.com>
* | | Merge "Add backup-update"Jenkins2016-08-161-0/+25
|\ \ \
| * | | Add backup-updatelisali2016-08-051-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add backup-update command to update name and description of a backup. DocImpact Change-Id: Ie24b2a13f8d1132b65f30e95059479e532fad41a
* | | | Change api-version help to indicate server APIscottda2016-08-041-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | The help for the 'api-version' command should state that it is displaying the api-version info for the server, not the client: Display the server API version information. Change-Id: Ia4380871ddca1b7ff41a5e6c8cf86488626e69fc
* | | Merge "Add cluster related commands"Jenkins2016-08-041-0/+76
|\ \ \ | |/ / |/| |
| * | Add cluster related commandsGorka Eguileor2016-06-211-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates client to support cluster related changes on the API done on microversion 3.7. Service listing will include "cluster_name" field and we have 4 new commands, "cluster-list", "cluster-show", "cluster-enable" and "cluster-disable". Specs: https://review.openstack.org/327283 Implements: blueprint cinder-volume-active-active-support Depends-On: If1ef3a80900ca6d117bf854ad3de142d93694adf Change-Id: I824f46b876e21e552d9f0c5cd3e836f35ea31837
* | | Merge "Changed backup-restore to accept backup name"Jenkins2016-08-031-2/+3
|\ \ \
| * | | Changed backup-restore to accept backup nameEllen Leahy2016-07-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Edited do_backup_restore function to accept the name of the backup as well as its id. Changed the test to comply with this. DocImpact Closes-Bug: #1604892 Change-Id: Iaec69dd053a119366fa5a8437701a6f7c3da2235
* | | | Merge "Add tenant_id parameter to limits."Jenkins2016-08-021-2/+12
|\ \ \ \
| * | | | Add tenant_id parameter to limits.Dimitri Mazmanov2016-07-291-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cinder API allows specifying tenant_id to get tenant specific resource usage. This was missing in the client. This fix should allow fetching tenant specific resource usage directly from the client. Added tenant argument to the limits CLI. Closes-Bug: #1580562 Change-Id: I3fbd6341f6d018a79e7c343107ac974b6fbb9239