215 Commits

Author SHA1 Message Date
zhiyong.dai
fca81526ff Trivial:modify one parameter
This patch modifies a wrong parameter to make the metavar
consistent with the optional argument.
Change-Id: I27ed30fdbc3adbc19d2f5662d6952cfe15dc52b1
2016-11-28 20:27:03 +08:00
Steve Martinelli
0ef8535036 translate all command help strings
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
2016-11-17 02:33:42 +00:00
Jenkins
55ddaf7bbe Merge "Add "--read-only" and "--read-write" options in "volume set"" 2016-11-10 16:59:18 +00:00
Jenkins
b37ad9992b Merge "Add "volume migrate" command" 2016-11-10 14:13:28 +00:00
Jordan Pittier
55669b90c0 Add 'all-projects' option to 'volume backup list'
Similar to what 'volume list --all-projects' does, 'volume backup
list --all-projects' list volume backups accross all projects.

Change-Id: Id5dda9b5adc822c4ddfb2dda339946d3322858e2
2016-11-08 17:35:51 +01:00
Huanxuan Ao
e07b0e0919 Add options to "volume backup list" command
Add "--name", "--status", "--volume", "--marker" (v2 only)
and "--limit" (v2 only) options to "volume backup list" command

Change-Id: If20cb7650f2359d393ee314d9e055a8659c73009
Closes-Bug: #1612484
Closes-Bug: #1639712
2016-11-08 04:47:57 +00:00
Huanxuan Ao
daffce3a6a Add "--read-only" and "--read-write" options in "volume set"
Add "--read-only" and "--read-write" options in "volume set"
command to set volume access mode.

Implements: bp cinder-command-support
Change-Id: I76ba85c7d3ff0eb026a9cbd794368d8b2b0d17fe
2016-10-18 14:34:05 +08:00
Huanxuan Ao
d7c8bb88e4 Add "volume migrate" command
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
2016-10-18 11:48:30 +08:00
Steve Martinelli
82af038bb0 properly format error messages for volume resizing
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
2016-10-15 20:29:54 -07:00
Huanxuan Ao
c9e0c01f67 Add and modify options for "volume create" command
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
2016-09-28 10:13:56 +08:00
Huanxuan Ao
8d63b8b263 Implement "consistency group list" command
Add "consistency group" object in volume v2 (v2 only)
and implement "consistency group list" command

Change-Id: Ifa90d97f4b223f9a5b00708cff07fa2c5e2635f0
Implements: bp cinder-command-support
Partial-Bug: #1613964
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
2016-09-28 09:31:04 +08:00
Huanxuan Ao
3ebc7520a6 Add warning message for --state option of set command in volume
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
2016-09-26 02:42:47 +00:00
Huanxuan Ao
fd876e4cc6 Fix unset commands to pass normally when nothing specified
After I found this problem appear in "volume unset",
I checked all the volume command and also found some
same problems. This patch fix them all.
The main reason of we ignored this problem before is
there was not any tests for it. So I add tests for
"nothing unset" for them all to test and aviod this
problem.
Also, I add unit tests for all snapshot commands
in volume v1 by the way in this patch. We will
need more tests to avoid some ignored problem.

Change-Id: I46775f24643d715e168b30785b8b531c0431a55b
Partial-bug: #1588588
2016-09-23 13:20:51 +08:00
Jenkins
9440509fa0 Merge "Add "volume backup set" command in volume v2" 2016-09-22 17:57:54 +00:00
Huanxuan Ao
3ef7e29dd0 Implement "volume transfer request show/accept" command
Add "volume transfer request show" and
"volume transfer accept" commands in
volume v1 and v2. Also add the unit tests,
docs, release note and functional tests

Implements: bp cinder-command-support
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>

Change-Id: I5787fc486b3401307125caa316f517b9c96a95a5
2016-09-22 17:11:53 +08:00
Huanxuan Ao
ddf84429f2 Add "volume backup set" command in volume v2
Add "volume backup set" command in volume v2 (v2 only)
to set backup name, description and state

Change-Id: If17e8457db9a4704fb5bb9c75921ed82fd0069cf
Closes-Bug: #1613261
2016-09-22 13:55:12 +08:00
Jenkins
69c4f605ec Merge "Fix "volume unset" command pass normally when nothing specified" 2016-09-22 02:35:13 +00:00
Huanxuan Ao
bba5c9047f Fix "volume unset" command pass normally when nothing specified
When nothing specified in "volume unset" command, there
will be an error message says that the "--properties"
option is required, it is unusual behaviour, this patch
fix it and also add unit test for it.
Also, this patch add unit test for "volume show" command
by the way.

Change-Id: I5b5d587670acf0af4262b8521292455bf9f60fe5
Partial-bug: #1588588
2016-09-21 15:47:55 +08:00
Shu Yingya
b30a7b795f replace metavar "volume-id" with "volume" to avoid ambiguity
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
2016-09-21 12:33:01 +08:00
Jenkins
276675f352 Merge "Support mark volume as bootable in volume set" 2016-09-14 18:48:28 +00:00
Jenkins
3b0e648041 Merge "Multi REST API calls error handling of "volume unset" command" 2016-09-14 17:02:04 +00:00
Jenkins
c381193214 Merge "Do not show "os-volume-type-access:is_public" property of volume type" 2016-09-14 16:55:03 +00:00
qtang
6a914d0056 Support mark volume as bootable in volume set
Add --bootable | --non-bootable option in volume set
to mark or unmark volume as bootable.

Change-Id: Ifa6c2dd1642202f55b6d50e3b8614d3513d488f6
Closes-Bug:#1535704
2016-09-14 16:35:49 +00:00
Tang Chen
1a78c76250 Trivial: Rename ListTransferRequests to ListTransferRequest
The class name should use plural.

Change-Id: I2de2489ff9aa60c2d1bf12743cbd41f2091739ca
2016-09-12 10:44:54 +08:00
Huanxuan Ao
d2273ecea5 Implement "volume transfer request delete" command
Add "volume transfer request delete" command in
volume v1 and v2. Also add the unit tests, docs,
release note and functional tests

Change-Id: Ic3d375bc8df3312fac53c1800d75f48376b8c91c
Implements: bp cinder-command-support
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
2016-09-11 14:08:27 +08:00
Huanxuan Ao
6f4acc45c6 Implement "volume transfer request create" command
Add "volume transfer request create" command in
volume v1 and v2. Also add the unit tests, docs,
release note and functional tests

Change-Id: If362df1acf214efdf6ba129cd917d33eb54e1030
Implements: bp cinder-command-support
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
2016-09-11 14:08:19 +08:00
Jenkins
30afdb9684 Merge "Error handling of multi REST API calls for "snapshot set" command" 2016-09-11 05:50:40 +00:00
Jenkins
cc5379b55c Merge "Add "--limit" and "--marker" options to "volume list" command" 2016-09-11 05:22:58 +00:00
Huanxuan Ao
10e665a148 Error handling of multi REST API calls for "snapshot set" command
Support multi REST API calls error handling for
"snapshot set" command follow the rule in
doc/source/command-errors.rst. Also add a unit
test for testing the error handling

Change-Id: I0c6214271bc54a25b051c0a62438c3344c8b51d7
2016-09-11 11:41:05 +08:00
Huanxuan Ao
6986a32e1c Add "--limit" and "--marker" options to "volume list" command
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
2016-09-11 11:23:25 +08:00
Huanxuan Ao
af81a92c37 Support error handling for delete commands in volume v1
Some delete commands in volume v1 support multi delete
but do not support error handling, this patch fixes them,
and this patch also refactor (or add new) unit tests for
some delete commands in volume v1.

Change-Id: Ia8177698f8733cfe75ea0ff00eee8fdc0820f62e
2016-09-11 11:08:14 +08:00
Huanxuan Ao
cb6c11b0a8 Multi REST API calls error handling of "volume unset" command
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
2016-09-11 11:00:09 +08:00
Huanxuan Ao
5231ade27c Do not show "os-volume-type-access:is_public" property of volume type
"os-volume-type-access:is_public" property is the
same as "is_public" property in volume type object.
So stop showing "os-volume-type-access:is_public"
property and leave "is_public" property only.

Change-Id: Ic78a9ee69b0ab356edff18cdb4c46fc24b495d2b
Closes-Bug: #1620922
2016-09-07 16:40:54 +08:00
Huanxuan Ao
81431d24a9 Add "volume service set" command
Add "volume service set" command in volume v1 and v2
(v1 is the same as v2) to disable or enable volume service.

Change-Id: Ibb2db7e93b24cb2e0d2a7c28b6fd8bcc851b8d2f
Closes-Bug: #1613597
2016-08-17 10:42:28 +08:00
Huanxuan Ao
39c5eb9e3f Rename backup commands in volume v1 and v2
Backup commands are used only in volume service now,
but "backup" is too generic, users may not know the
commands are used for volume from the commands name.
By seeing the command name, users can only see the
"backup" but do not know which object the backup
commands work for. It may confuse users. I think
rename "backup" to "volume backup" can depict resource
relation and will be helpful for users to know the
commands clearly.

So add new commands ``volume backup create/delete/
list/show/restore`` to replace the old commands
``backup create/delete/list/show/restore``. And also
deprecate old commands.

Change-Id: I4f844d9bc48573eb4d17288ce6b8a90cea00d16a
Implements: bp backup-snapshot-renamed-for-volume-resource
Co-Authored-By: Sheel Rana <ranasheel2000@gmail.com>
2016-08-11 09:32:10 +08:00
Jenkins
80fd9b2bd4 Merge "Support multi REST API calls error handling for "volume set" command" 2016-08-06 12:02:29 +00:00
Jenkins
3692a2a91a Merge "osc-lib: shell" 2016-08-06 08:01:52 +00:00
Huanxuan Ao
3202fefc65 Support multi REST API calls error handling for "volume set" command
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
2016-08-06 09:15:21 +08:00
Dean Troyer
6a15f90dae osc-lib: shell
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
2016-08-05 13:48:55 -05:00
Xi Yang
20ae54045c Add support of setting volume's state
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>
2016-08-03 12:19:16 +08:00
wuyuting
954c28dfa2 Add support for deleting volumes with associated snapshots
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>
2016-07-27 11:30:52 +08:00
Jenkins
6da7a127af Merge "Add options to "volume type list" command" 2016-07-26 10:53:40 +00:00
Jenkins
566b8566c0 Merge "Standardize import format" 2016-07-26 07:22:27 +00:00
Huanxuan Ao
e31408d2a4 Add options to "volume type list" command
Add "--public" and "--private" options to
"volume type command" in volumev2 (v2 only)
to list optional volume types

Change-Id: I8605990d62116c10d89ce192c14e550657dabee5
Closes-Bug: #1597198
2016-07-23 11:26:49 +08:00
Huanxuan Ao
61b9d9fe2d Add "--marker" and "--limit" options to "snapshot list"
Add "--marker" and "--limit" options to
"snapshot list" command in volume v2 (v2 only).

Change-Id: Ib60840b9b83dfe5e599e4037e8ec308844a9448b
Closes-Bug: #1605475
2016-07-23 10:41:28 +08:00
shizhihui
f996138a0d Standardize import format
According to the rule in
http://docs.openstack.org/developer/hacking/#imports
I modify some irregular import format.

Change-Id: Ibf29ccaf3ddec4a956334cc3368ebee7a66e282c
2016-07-22 19:24:02 +08:00
Sheel Rana
5e8957ef7f Show project access for volume type
OSC does not support to show project access details for
private volume types. This patch will provide support
for showing project access details for private volume types.

Closes-Bug:#1554891

Implements: bp cinder-command-support

Change-Id: I218fb07a6e69033e9f8570748eee1df8df9d6fdc
2016-07-20 16:54:58 +08:00
Jenkins
6ce53fed83 Merge "Support error handling for delete commands in volumev2" 2016-07-18 22:41:07 +00:00
Jenkins
099c3bbd82 Merge "Add "--project" option to "volume type create" command" 2016-07-18 19:38:02 +00:00
Huanxuan Ao
9b51127ecc Support error handling for delete commands in volumev2
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
2016-07-14 17:49:26 +08:00