summaryrefslogtreecommitdiff
path: root/openstackclient/volume/v2/volume.py
Commit message (Collapse)AuthorAgeFilesLines
* translate all command help strings3.4.0Steve Martinelli2016-11-171-7/+7
| | | | | | | | | | | | | | Leverage the new cliff command class attribute (_description) to get the help of a command, this allows us to mark strings for translation. We could not do this before since the help was grabbed from the docstring. This also depends on a new release of cliff and a bump to the minimum level in osc's requirements. Closes-Bug: 1636209 Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
* Merge "Add "--read-only" and "--read-write" options in "volume set""Jenkins2016-11-101-0/+20
|\
| * Add "--read-only" and "--read-write" options in "volume set"Huanxuan Ao2016-10-181-0/+20
| | | | | | | | | | | | | | | | Add "--read-only" and "--read-write" options in "volume set" command to set volume access mode. Implements: bp cinder-command-support Change-Id: I76ba85c7d3ff0eb026a9cbd794368d8b2b0d17fe
* | Add "volume migrate" commandHuanxuan Ao2016-10-181-0/+47
|/ | | | | | | | Add "volume migrate" command in volume v1 and v2 to support migrating volume to a new host Change-Id: Ie4e6037171a31a872006a13f9fd1e15eaa627c26 Implements: bp cinder-command-support
* properly format error messages for volume resizingSteve Martinelli2016-10-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | The error messages are tuples and not substituting variables. Before: $ openstack volume set vol1 --size 1 Failed to set volume size: (u'New size must be greater than %s GB', 2) $ openstack volume set vol1 --size 1 Failed to set volume size: (u'Volume is in %s state, it must be available before size can be extended', u'error') After: $ openstack volume set vol2 --size 3 Failed to set volume size: New size must be greater than 4 GB $ openstack volume set vol2 --size 3 Failed to set volume size: Volume is in error state, it must be available before size can be extended Change-Id: Ide6e644b1c6d1c11a9dc2f3f53c1a1837380b8d5
* Add and modify options for "volume create" commandHuanxuan Ao2016-09-281-6/+61
| | | | | | | | | | | | | | 1.Add mutually exclusive options into a mutually exclusive group. 2.Add "--source-replicated", "--consistency-group", "--hint" and "multi-attach" options 3.Make --size option to be optional under some cases Closes-Bug: #1568005 Closes-Bug: #1627913 Implements: bp implement-cinder-features Co-Authored-By: Roman Vasilets <rvasilets@mirantis.com> Change-Id: I2c4c3073195d33774e477f4d7f22e383b14b41dd
* Add warning message for --state option of set command in volumeHuanxuan Ao2016-09-261-1/+4
| | | | | | | | | There are some set commands can set object state, it maybe a danger behavor for users, so add explanation and warning in the help message of the "--state" option to talk users be caution when using (cinderclient have done this too) Change-Id: I6a902887ea98879999c9972f36b1b7ef332173c3
* replace metavar "volume-id" with "volume" to avoid ambiguityShu Yingya2016-09-211-1/+1
| | | | | | | | | | | | | The help message of command "openstack volume show" accepts either volume-name or volume-ID. But the metavar is "volume-id" as below. It can easily lead to misunderstanding. usage: openstack volume show [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN] [--max-width <integer>] [--noindent][--prefix PREFIX] <volume-id> Change-Id: I57576ea23868b1026cf268be69b39e98a53aafd4
* Merge "Support mark volume as bootable in volume set"Jenkins2016-09-141-0/+18
|\
| * Support mark volume as bootable in volume setqtang2016-09-141-0/+18
| | | | | | | | | | | | | | | | Add --bootable | --non-bootable option in volume set to mark or unmark volume as bootable. Change-Id: Ifa6c2dd1642202f55b6d50e3b8614d3513d488f6 Closes-Bug:#1535704
* | Merge "Multi REST API calls error handling of "volume unset" command"Jenkins2016-09-141-4/+18
|\ \ | |/ |/|
| * Multi REST API calls error handling of "volume unset" commandHuanxuan Ao2016-09-111-4/+18
| | | | | | | | | | | | | | | | Support multi REST API calls error handling for "volume unset" command follow the rule in doc/source/command-errors.rst. Also add a unit test for testing the error handling Change-Id: I2de7a7bd5a7a5e39817ed5cf6952abf4afba75e4
* | Add "--limit" and "--marker" options to "volume list" commandHuanxuan Ao2016-09-111-1/+17
|/ | | | | | | | | Add ``--limit`` option to ``volume list`` command in volume v1, add ``--limit`` and ``--marker`` options to ``volume list`` command in volume v2. Change-Id: I327a252aa83ed84166da99cf6aa80334e0e6dd44 Partial-Bug: #1612484
* Support multi REST API calls error handling for "volume set" commandHuanxuan Ao2016-08-061-14/+41
| | | | | | | | Support the error handling follow the rule in doc/source/command-errors.rst Also add a unit test for testing the error handling Change-Id: I98064f4b8c1dc17eb3874f7b25c827a568463c0f
* Add support of setting volume's stateXi Yang2016-08-031-0/+12
| | | | | | | | | OSC does not support to set volume's state, this patch is going to add this functionality. Closes-Bug:#1535213 Change-Id: I5bc1c7e81b8ba61c37f4bfd209fc86c5857fb050 Co-Authored-By: Huanxuan Ao <huanxuan.ao@easystack.cn>
* Add support for deleting volumes with associated snapshotswuyuting2016-07-271-5/+12
| | | | | | | | | | OSC doesn't support deleting volumes with associated snapshots. This patch provides support for deleting volumes with associated snapshots by adding an optional argument. Change-Id: I7e74f251574993ff13a38e508fd2f9debeda8d0a Closes-Bug: #1589332 Co-Authored-By: Rui Chen <chenrui.momo@gmail.com>
* Support error handling for delete commands in volumev2Huanxuan Ao2016-07-141-7/+22
| | | | | | | | Some delete conmmands in volumev2 did not support error handling, this patch add them and also add the unit tests for bulk deletion Change-Id: I56ade6f9c7396c78fb989547476c4d94ccd76eae
* Remove useless dest of option in volume v1&v2Huanxuan Ao2016-07-111-1/+0
| | | | | | | some "dest" argument is useless because they are the same as the option name. So remove them. Change-Id: Idd37e8816cf8b0833c94a5e741fdfe56602551f9
* Make set/unset command in volume pass normally when nothing specifiedsunyajing2016-06-271-3/+0
| | | | Change-Id: Iac2d1b4ba9fa6358dc9317054af970eae8d49e84
* Standardize logger usage in volumeTang Chen2016-06-141-6/+9
| | | | | | | | | | | | | | | | | self.app.log is the logger in class OpenStackShell, which should be used to record logs that have nothing to do with any specific command. So, use the file logger instead. This patch also fixes some usage that doesn't follow rules in: http://docs.openstack.org/developer/oslo.i18n/guidelines.html 1. add variables to logger as an argument 2. do not wrap variables with str() Change-Id: I248861a38a4de0412a080046aa7a6f6473c3e082 Implements: blueprint log-usage
* osc-lib: commandDean Troyer2016-06-131-1/+1
| | | | | | | Leave command.py and test_command.py as a sanity check during the deprecation period. Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
* osc-lib: parseractionsDean Troyer2016-06-131-1/+1
| | | | | | | Leave parseractions.py and test_parseractions.py as a sanity check during the deprecation period. Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
* osc-lib: utilsDean Troyer2016-06-131-1/+1
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Make set/unset commands in volume return normally when nothing specifiedTang Chen2016-06-041-4/+0
| | | | | | | | | | | set/unset commands should ends up normally instead of logging an error when nothing is specified to modify. The main reason is: When nothing is specified, the command sets/unsets nothing, which is a normal behavior, and ends up normally. No API call fails. No error happens. Change-Id: Ib03a512650e5da90aa1ef38019772448383d0d33 Partial-bug: #1588588
* i18n support for help and error messages in cinderSheel Rana2016-05-231-40/+41
| | | | Change-Id: I98fbc959034fe0530966291643b381855801de20
* use correct manager for volume snapshotsSteve Martinelli2016-04-081-1/+1
| | | | | | | the snapshot manager is volume_snapshots, not snapshots. Closes-Bug: #1567895 Change-Id: I12c0238fc04507c97e92089fda3bec816171a973
* Docs cleanup: volume command helpDean Troyer2016-03-281-33/+33
| | | | | | | | | This formats the volume command help text consistent with the rest of OSC, adds some reference targets and some explanation text to some commands. No functional changes have been made, only cosmetic/help output. Change-Id: Ib86ec3ca58bdea5f33078ced3ec3583b2be0e89a
* Add support for deleting Image-propertyroot2016-03-161-4/+16
| | | | | | | | | | OSC does not support to delete volume's image property. This patch will provide support for deleting image property to existing volume. Closes-Bug:#1554879 Change-Id: I9256913948fae9e9a03fed173b826dfa918f78e9 Implements: bp cinder-command-support
* Add support for setting Image-propertyroot2016-03-161-1/+12
| | | | | | | | | | | | OSC does not support to set volume's image property. This patch will provide support for adding image property to existing volume. Closes-Bug:#1554877 Implements: bp cinder-command-support Change-Id: I4ff5532c228f010789b81c7587dd4a2838a90f20
* Fixed a bunch of spacingBrandon Palm2016-02-231-1/+1
| | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* Add functional tests for "volume" commands v2Tang Chen2016-02-211-0/+10
| | | | | | | | | | The tests for v2 "volume" commands are quite similar to v1. This patch also map 'metadata' to 'properties', 'volume_type' to 'type' to align to the v1 output. Change-Id: Icf2c5463b186fc78c890ccd96453090c4a2c2eb6 Partial-bug: #1519503
* log take_action parameters in a single placeAkihiro Motoki2016-02-021-26/+4
| | | | | | | | | | | | Previously each command logs take_action parameters explicitly by using @utils.log_method decorator or log.debug(). Some commands have no logging. This commit calls a logger in the base class and drops all logging definition from individual commands. Closes-Bug: #1532294 Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
* Trivial: Remove useless return from files in image and volumeTang Chen2015-12-181-4/+0
| | | Change-Id: I3526ecd202d0908d91305a066ad72d03cee794b5
* Fix exception when doing volume set operationXi Yang2015-12-031-1/+1
| | | | | | | | | | The v2 SetVolume extends from show.ShowOne and returns None after setting volume operation. It will raise an exception. This patch is going to fix the issue by changing the parent class of SetVolume to command.Command. Change-Id: Iefa453fe4adad06f2a0601a052c01e74004be5b7 Closes-bug: 1521896
* Fix a bug of "openstack volume delete"xiexs2015-11-271-4/+4
| | | | | | | | | While multi volumes specified for the osc "openstack volume delete", only the last volume is deleted. This patch tries to fix it. Change-Id: I171b2869f85b29c88fda16eaf5bf163c55795df0 Closes-Bug: #1520541
* Trivial: Fix wrong param name in comment.Tang Chen2015-11-131-1/+1
| | | | | | "volume" should be "attachments". Change-Id: Id1e9a733e18db595d8981b5b3a7735313a346787
* Change method to get the user_idxiexs2015-11-081-3/+3
| | | | | | | | Instead of "find_project", using "find_user" to get the user_id while the option --user is specified for "openstack volume list" Change-Id: Iea8472b7b8e709a8792a56575e00003a9cbdaa39 Closes-Bug: #1514145
* Follow-on for volume list - add tests, clean helpDean Troyer2015-10-161-8/+7
| | | | | | | | | | * Add volume list tests for v1 (a copy of the v2 tests) * Converts volume v2 tests to use Identity v3 so domains can be tested * Add volume list (v2) tests for new options * Re-orders volume list options (both v1 and v2) to match * MArks the new volume list (v2) options as v2-only in doc Change-Id: I2181b2c48cfde2147d7d0ef135322df8a81e7ce8
* Add filtering by project/user for 'openstack volume list'kafka2015-10-151-5/+34
| | | | | | | | | | added project, user and domain options for filtering results, also cleaned up the order to match the docs. Co-Authored-By: Steve Martinelli <stevemar@ca.ibm.com> Closed-bug: #1483976 Change-Id: I9d955094d31d4a28e215d24f7521a11c62bee8db
* Add one parenthesisAtsushi SAKAI2015-10-021-1/+1
| | | | | | | | | | | | | | | | | | | In the following help message, last parenthesis is missing. $ openstack --os-volume-api-version 2 help volume delete usage: openstack volume delete [-h] [--force] <volume> [<volume> ...] Delete volume(s) positional arguments: <volume> Volume(s) to delete (name or ID) optional arguments: -h, --help show this help message and exit --force Attempt forced removal of volume(s), regardless of state (defaults to False Change-Id: I45c4030abf076cba14450019c379d333eb6530d6
* Merge "Use a common decorator to log 'take_action' activation"Jenkins2015-09-111-4/+4
|\
| * Use a common decorator to log 'take_action' activationJoshua Harlow2015-09-011-4/+4
| | | | | | | | | | | | | | | | | | Instead of duplicating the same log statement throughout the code, the same logic can be provided by a shared decorator that abstracts away the logging capability and unifies it behind a common function instead. Change-Id: Icc63bced7347c8bbf0299a4c5821425a10892a79
* | Volume v2 list does not show server nameTerryHowe2015-08-281-1/+1
|/ | | | | | | | The volume v2 list was using the volume id rather than the server id. Change-Id: Ibe03d34b5b503af2d00202dabd640f796449cf9a Closes-Bug: #1489954
* Add list feature to volume v2heha2015-08-061-0/+109
| | | | | | | | | | "volume list" is not in the v2. Co-Authored-By: Lin Hua Cheng <os.lcheng@gmail.com> implements bp: volume-v2 Change-Id: I9f4585202f5f9ec5f4c091278fc6c4036efb1290
* Add support for volume v2 commandsAmey Bhide2015-07-241-0/+235
| | | | | | | | | | Adds the following commands: openstack volume create openstack volume set openstack volume unset Implements: blueprint volume-v2 Change-Id: Icb7404815763aa88550112fb42f5200ce05c2486
* Add support for volume v2 APIAmey Bhide2015-05-301-0/+83
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