172 Commits

Author SHA1 Message Date
Jenkins
7971b36c52 Merge "cinder list now prints dash '-' when data is None" 2015-03-16 21:36:02 +00:00
Gloria Gu
425565b79c Update to change name for volume type client
This continues to update the name for volume type:

* Update a client method for volume type.
  update: to update an existing volume type's name

* Update a command-line operations.
  type-update: (adminitrator only) to update a volume type name

The corresponding cinder APIs change to update volume type name:
https://review.openstack.org/#/c/140906/

Implements: blueprint volume-type-description
Change-Id: I66adb7fd2a433e7443cb609046f64dbab3d9d4c7
2015-03-16 18:45:21 +00:00
yatin karel
0f73c5fb8a cinder list now prints dash '-' when data is None
cinder list used to print None when volume was created without name.
Now it prints '-' dash when display_name is None

Closes-Bug: #1422244
Change-Id: I195ccc37fe96dbb54a0460527fabf55146170bc7
2015-03-16 23:26:22 +05:30
Jenkins
7c68f6f6df Merge "cinderclient accepts arguments after metadata without -- separator" 2015-03-16 16:52:02 +00:00
rajiv
57c9bf17b3 cinderclient accepts arguments after metadata without -- separator
Added a function, which parse arguments and add -- separator
after metadata subcommand

Change-Id: I907eb89209d549dcdad361d88352491110eaadb9
Closes-Bug: #1379486
2015-03-10 09:45:00 +05:30
yatin karel
f47f973d9b Updated help on cinder reset-state cli
volumes also have 'in-use', 'attaching' and 'detaching' states.
These were missing in cinder help for reset-state cli. I have added
these in help.

Partial-Bug: #1309086

Change-Id: I094a61dd4921bed83e97134a4bfbcdc7d0c9ad63
2015-03-06 01:45:08 +05:30
Jenkins
7fc093b504 Merge "Adopt CLI sorting argument guidelines" 2015-03-02 19:55:44 +00:00
Steven Kaufer
fc7ebb1621 Adopt CLI sorting argument guidelines
CLI sorting guidelines are defined in the cross project specs
repository: [1]

This patch deprecates --sort_key and --sort_dir and adds support for
--sort in the 'cinder list' command with the following syntax:

  cinder list --sort <key>[:<direction>]

The --sort parameter is comma-separated and is used to specify
one or more sort keys and directions.

Server-side work for sorting by multiple keys is handled in [2].

[1] https://github.com/openstack/openstack-specs/blob/master/specs/
    cli-sorting-args.rst
[2] https://review.openstack.org/#/c/141915/

Implements: blueprint cinder-pagination

Change-Id: Ie8c2c62b8c129f647f85d66d5bcfe4c8f0f4eedb
2015-02-25 18:51:43 +00:00
liyingjun
c01529fa53 Add missing all-tenants option to transfer-list
cinder transfer-list is missing the --all-tenants option, which makes
it inconsistent with 'cinder list'. Without this fix, when running as
admin horizon will need to make multiple queries to cinder (one for
each tenant present in the volume list) in order to display the transfers
that exist for the volumes being shown.

Change-Id: Ic4d72a54c450876ff24c64efd83678062c93a24e
Closes-bug: 1351084
2015-02-24 16:11:46 +08:00
Jenkins
2f1939405a Merge "Add support for os-volume-type-access extension" 2015-02-03 03:55:13 +00:00
Jenkins
7648eb68f5 Merge "Expose cinder's scheduler pool API" 2015-01-30 23:48:23 +00:00
Gary W. Smith
e5779d352b Expose cinder's scheduler pool API
Make the scheduler pool API available to other clients.

DocImpact
Change-Id: I3f0e0c2ed806b5bfda3129ed2c5b210b9210daa5
Partially-Implements: blueprint get-volume-type-extra-specs
2015-01-30 16:50:21 +00:00
Jenkins
301eef0203 Merge "Add tests for consistency groups and cgsnapshots" 2015-01-23 20:56:41 +00:00
Michal Dulko
11e5e4f6aa Add tests for consistency groups and cgsnapshots
This patch adds missing unit tests for consistency groups and
consitency groups snapshots. Tests cover update operation and
various use cases of list operations.

Change-Id: I8998a5c8643559cee83c8c0c81b616b5564c0a30
2015-01-22 15:11:33 +00:00
Steven Kaufer
0560f78833 cinder list fails with 'name' sort key
The client restricts the sort keys that the user can supply. The
'name' key is allowed but is not the correct key for sorting by name,
it should be 'display_name'.

If 'name' is used then the client returns with the error 500
Internal Server Error.

This patch will add support for mapping client sort keys (eg, 'name')
to server sort keys (eg, 'display_name'), allowing the user to supply
the 'name' key to sort by name.

This patch also adds UT for the sort key and direction error cases
when an invalid value is supplied.

Change-Id: I0bdad6d61da83a3924a6b18678afe4722b5778d6
Closes-Bug: 1404020
2015-01-22 14:52:25 +00:00
Jenkins
09bfc76c02 Merge "Allow CG quota to be showed and updated" 2015-01-16 18:34:50 +00:00
Jenkins
fdf6fd1d67 Merge "Add command to show pool information for backends" 2015-01-13 08:38:06 +00:00
Jenkins
0d93c3b76d Merge "Client output is not sorted by --sort_key" 2015-01-07 23:15:39 +00:00
Jenkins
9c1ec1d19c Merge "Fix incorrect variable name" 2015-01-06 19:52:00 +00:00
Mitsuhiro Tanino
1d38426680 Add command to show pool information for backends
An admin-api extension to show pool info was supported at commit
https://review.openstack.org/#/c/119938/.

This change adds a command to show pool information for backends
using the admin-api. This change also closes the gap for end users.

Partial-Bug: 1403902
Change-Id: I20e0828c5403b73bc44d07eebf08e2aa2deb428a
2015-01-05 16:04:43 -05:00
Steven Kaufer
b0e4cc1b63 Client output is not sorted by --sort_key
The cinder client supports invoking the volumes REST API with the
sort_dir and sort_key parameters. However, the client output table
is always sorted by ID even though the REST API is returning in
sorted order based on the sort key/direction provided.

For example, the command below supplies the 'size' sort key but the
output table is still sorted by ID:

cinder list --sort_key size --sort_dir desc

This fix contains:
* Updates to the print_list utility to prevent any re-ordering so
  that the current object order is maintained
* Updates to the shell to disable re-ordering if the user supplies
  sort parameters

Change-Id: I4cc111a8bdd2b89158dfc4bb0d16fa6dbf36cc57
Closes-Bug: 1402846
2014-12-22 02:23:00 +00:00
Jenkins
59177814a4 Merge "Use immutable arg rather mutable arg" 2014-12-21 16:15:41 +00:00
Mathieu Gagné
6f8c235a92 Add support for os-volume-type-access extension
This change adds the ability to manage volume type access:
- Create non-public volume type
- List volume type access
- Add a project access
- Remove a project access

This change also adds the is_public flag to volume type list.

Note: The volume type access extension is only implemented
in the Cinder API v2.

DocImpact: Add volume type access extension support
Implements: blueprint private-volume-types
Change-Id: Ife966120d9250be8d8149cdec9c1a53405d37027
2014-12-19 13:26:21 -05:00
Gloria Gu
bc2b8bf1be Added type description for volume type client
This patch added client handling and unit tests for volume type description:

* Added 2 client methods for volume type.
  default: to get the default volume type
  update: to upate an existing volume type to update description

* Added 2 new command-line operations.
  type-update (adminitrator only)
  type-default

* type-list should display description.

* type-create should have an option for entering the description.

The corresponding cinder APIs change volume-type-description:
https://review.openstack.org/#/c/131871/

Implements: blueprint volume-type-description
Change-Id: I2735d7050d90589d19f45e21096577febdcca8bb
2014-12-17 07:27:38 -08:00
Jenkins
c3b1b1b0c0 Merge "Fix comment in tearDown()" 2014-12-12 21:54:32 +00:00
Vincent Hou
592099475c List all the request items when the list is over osapi_max_limit
Convert the function _list into a loop function, which can retrieve
the items from the next link till the limit or the end of items has
been reached. This works for v2 only.

So far, only volume list in v2 support limit. The limit parameter
work for volume list in v2 only, but other list can extend it in
future work.

Change-Id: I011f0ed1a4ab639f67db6cae580d978c0b44c1bb
closes-bug: #1342192
2014-12-04 02:20:59 +00:00
Xing Yang
d9da860371 Allow CG quota to be showed and updated
This patch added the ability for CG quota to be showed and updated.
- Added consistencygroups as a quota resource to be displayed.
- Added an option for consistencygroups quota to be updated.

Change-Id: I7e88eb426eb1733bce955b7a15b8bffdb1e8ee20
Closes-Bug: #1373766
2014-12-03 16:39:23 -05:00
Jenkins
3398e424bf Merge "client HTTPClient __init__ fails if auth_url None" 2014-12-02 09:48:02 +00:00
Jenkins
4154f88fa1 Merge "Add the parameter bypass_url to the cinder client" 2014-12-01 19:10:17 +00:00
Vincent Hou
7a50182fbe Add the parameter bypass_url to the cinder client
If the bypass_url is specified in the http client, there is no need
to get it from Keystone.

Change-Id: I891849f77ad2ba98a83c993b401121216c8cfff6
closes-bug: #1350702
2014-12-01 02:43:52 +00:00
Duncan Thomas
4ccb70a90f Support Volume Backup Quota
Python-cinderclient support update volume backup quota.

Cinder server side commit for this feature was:
https://review.openstack.org/#/c/111460/

blueprint volume-backup-quota

Change-Id: I1fceeb9fc0eb92370e249c46749a61e4b11420b0
2014-11-30 19:37:10 +02:00
Jenkins
d6f4ab3c96 Merge "Fixed typos found by RETF rules" 2014-11-25 03:02:01 +00:00
Jenkins
f5a4e59467 Merge "Adds tty password entry for cinderclient" 2014-11-20 05:30:24 +00:00
Jamie Lennox
384b8825b4 Fix incorrect variable name
valid_versions does not exist here, it is obviously supposed to mean
_VALID_VERSIONS.

Closes-Bug: #1386232
Change-Id: I477baa7642feba72f80d884d6183512185b02cf1
2014-10-27 14:41:54 +00:00
Christine Wang
a6b434ee05 cinderclient does not retry with TimeoutException
Added retry support when encounter requests.exceptions.Timeout
during HTTP request.

Closes-Bug: #1379505

Change-Id: I6253a109c3a76dd2f15c96a349da68936f9bfff4
2014-10-24 11:57:42 -04:00
John Trowbridge
122bf5bdcc Adds tty password entry for cinderclient
Added functionality from keystoneclient to fallback to the tty for password
entry if no password is given via the environment or the --os-password option.

Change-Id: If5b27cb8c67712860faa24d543ed48eaa542f28b
Closes-Bug: 1357559
2014-10-24 15:43:04 +00:00
Jenkins
8428ffd099 Merge "Fix volume name support of unmanage and replication commands" 2014-10-14 20:31:35 +00:00
Mitsuhiro Tanino
20df1cb7a7 Fix volume name support of unmanage and replication commands
Volume not found error occurs when running these commands via cinderclient
with volume name as an argument.
unmanage, replication-promote, replication-reenable

However in their help text, it is described that Name and ID are supported.
Therefore, this patch fixes volume name support to their argument.

Closes-bug: #1374211
Change-Id: I8b90523d8e79a65eb27ff4e99820e8cb3feb3120
2014-10-02 15:24:01 -04:00
John Griffith
1cb1350d16 Simplify cinder manage command args
The 'cinder manage' command argumenst are kind of a disaster.
The positionals are <host> <id> where <id> is undefined/free form
K/V pairs.  On top of it we then have --source-name and --source-id
optional arguments available.  There absolutely no way to tell from
the help what one should be entering here without referring to the
code, and even then it's not quite clear how the options work and
which one will be used.

To clean this up, change the positionals to <host> <identifier>
where both are strings.  Remove --source-name and --source-id
and consolidate those options with --id-type.

id-type will allow a user to specify the type of identifier
(source-name, source-id, or whatever), but defaults to
source-name which is most commonly used currently.

* NOTE *
Ideally we'd just do away with the designator source-name/source-id
altogether and just have an <identifier> positional arg.  Each driver
would then be responsible for figuring out what was passed an how to
deal with it.  This however requires changes in all of the drivers and
broader changes on the Cinder side which I don't think are warranted
during RC.

During Kilo we should clean all of this up, but for now at least the
syntax is somewhat ready for human consumption and a bit easier than
what we introduced.

Change-Id: I07696648ae647f17ab9180cd87b25f8cb888f5d6
Closes-Bug: 1376311
2014-10-02 14:58:19 +00:00
Jenkins
5922af5441 Merge "Ability to pass metadata during snapshot create" 2014-09-30 03:47:30 +00:00
Xing Yang
40f06b8be5 Make <volume-types> required option for create cg
Change-Id: I101ec89ab95cedd8b55247301c1c3b9cba2645c5
2014-09-10 13:58:46 -04:00
Bill Arnold
f7d391e5cb client HTTPClient __init__ fails if auth_url None
The initializer for the python-cinderclient HTTPClient class
fails if passed a None for an auth_url.
This patch modifies the inializer to not call rstrip
if auth_url is None, matching the initalizers in
python-novaclient and python-neutronclient

Change-Id: I19dd6911816639a0e0d6175ba910e9777a4b5981
Closes-bug: #1358926
2014-09-09 18:40:31 +00:00
Xing Yang
9fc64a52b1 Cinder Client for Consistency Groups
This patch implements CLI commands for the Consistency Groups
feature. Only snapshots for CGs will be implemented in phase 1.

Change-Id: I447555fd8a92bceecf6f40be59030d65461e4cbb
Implements: blueprint consistency-groups
2014-09-08 10:37:04 -04:00
Christian Berendt
17e4d6c381 Fixed typos found by RETF rules
Rules are available at
https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos

Change-Id: I8de0631346b703870ce8ebe9ce728a0360f1ba7f
2014-09-08 11:31:22 +00:00
Jenkins
4162c9ff5c Merge "Add client support in Cinder for volume replication" 2014-09-05 03:32:33 +00:00
Subhadeep De
4a7014a46e Ability to pass metadata during snapshot create
Metadata as a parameter is supported by the underlying cinder driver.
This is not exposed by the python client. It is helpful to store additional information
for snapshots and can be used for decision within cinder driver during snapshot creation.
Similar functionality exists for volume creation in cinder client and cinder driver.
Updating cli(shell) to accomodate the new metadata parameter
Adding above change for v2

Change-Id: I002221efea1b9994da4a8d200544a88b0ed26277
Closes-Bug: #1341424
2014-08-29 00:09:43 -07:00
Jenkins
7bd8eb2aac Merge "convert availability zone tests to requests-mock" 2014-08-28 20:00:46 +00:00
Jenkins
3113ce8d23 Merge "Fix order of arguments in assertEqual" 2014-08-28 16:47:27 +00:00
Ronen Kat
953ac3ec6d Add client support in Cinder for volume replication
Provide Cinder client support to manage volume replication.
Cinder-specs available at https://review.openstack.org/#/c/98308/

Change-Id: Id60bacbcc113d42730e822b29b2fa78be94d3276
Implements: blueprint volume-replication
2014-08-27 06:38:50 +03:00
Jamie Lennox
49c2c64304 convert availability zone tests to requests-mock
Blueprint: http-mock-testing
Change-Id: Ib02db9b9e24808d2f5eac42cf6f5b3c5ca123e9b
2014-08-25 16:15:26 +10:00