241 Commits

Author SHA1 Message Date
Ivan Kolodyazhny
9e19357e4b Fix upload_to_image method
Commit Ie639179c5bbbaca4de62b42b368830afcfd8f7ac introduced 'visibility'
and 'protected' params. These params should be used only with
v3.1 microversion. Also these changes break current v2 users.

This patch fixes these issues.

Closes-Bug: #1584056
Change-Id: I0574631791c475bbefdb6e7d1647a20d0759df64
2016-05-20 22:55:55 +03:00
scottda
27e6f6f7f8 Add /v3 endpoint support for cinderclient
Add support for Cinder API /v3 endpoint.
A couple of unit tests for /v3 endpoint were added to v3/test_shell.py
to ensure that the v3 shell works, and to also test that modules work
with:
from cinderclient.v2.availability_zones import *
syntax.

Change-Id: I6ae0ada221bebb4ab1850d9c99b10fcbb585201f
Implements: https://blueprints.launchpad.net/python-cinderclient/+spec/add-v3-endpoint-support
2016-04-18 10:49:51 -06:00
Jenkins
d2daa7ba94 Merge "Fix api v2 so that you can delete more than one volume_type at a time." 2016-03-31 01:25:45 +00:00
zwei
edd269aff7 Fix api v2 so that you can delete more than one volume_type at a time.
This path is also allowing us to delete them by name or ID
instead of only by ID.
eg:  cinder --os-volume-api-version 2 type-delete test01 test02

Closes-bug: #1554794
Change-Id: I54faad2c5b60ab69f4b406310eb8059cf1e8cf76
2016-03-29 16:49:18 +08:00
Jenkins
7556a74ae6 Merge "Removed Extra code" 2016-03-24 18:38:53 +00:00
root
b83835d618 Removed Extra code
Some extra code is present like unused variables,
unreachable code after return statement etc.
Same is removed.

Change-Id: Ifca88a19625c56ed520321ecbdd91739a304be8e
2016-03-14 06:20:32 +00:00
John Griffith
99815a521f Add docstrings for chessecake methods
We missed docstrings on freeze, thaw and
failover replication v2.1 methods.

This adds them.

Change-Id: If68a674c66b4f18e80432d1cef269b02813fcc37
2016-03-08 11:43:54 -07:00
Jenkins
a330ff0bba Merge "Add --cascade to volume delete" 2016-03-02 17:12:20 +00:00
Alex O'Rourke
66f7a08385 Remove replication v2 calls
With replication v2.1 merged in cinder and the calls merged in the
client, there is no longer a need for the old calls. If these commands
are called with the newest cinder code, it fails miserably.

Basically reverts this patch: https://review.openstack.org/#/c/231708

Change-Id: I29c0565c1efe518e40c3483ceb4ca0d40cd7d0d7
2016-03-01 08:58:38 -08:00
Jenkins
d4569534b4 Merge "Add replication v2.1 (cheesecake) calls" 2016-02-29 23:13:48 +00:00
Jenkins
64cde9f7f7 Merge "snapshot-list now supports filtering by tenant" 2016-02-29 22:47:42 +00:00
Jenkins
d4fcc92a0d Merge "Word Misspelling" 2016-02-29 11:06:49 +00:00
Deepti Ramakrishna
20c0421857 snapshot-list now supports filtering by tenant
Admin can now filter snapshots on the basis of tenant.
No changes are needed on server side since snapshot model contains
project_id as a column which means that it supports native filtering
by tenant (i.e, project) via SQL.

This closely follows similar functionality for volume listing added in
the change-id - fa8c7e3d84bd93cdfc3641554e10d422281ea018

DocImpact
After this patch is merged we need to regenerate the CLI reference
guide so that the added documentation for the new option
"--tenant <tenant_id>" for "cinder snapshot-list" command gets
included.

Change-Id: I0bbd8e0b4aaf25da738c67638fb497337ead312b
Co-Authored-By: wuyuting <wytdahu@gmail.com>
2016-02-27 22:14:47 -08:00
Jenkins
53fc06dd81 Merge "Don't print HTTP codes for non-HTTP errors" 2016-02-25 20:46:58 +00:00
Jenkins
8155d453c8 Merge "Extra 'u' in output of cinder cli commands" 2016-02-24 18:32:35 +00:00
Eric Harney
ccacc338a5 Add --cascade to volume delete
This adds the --cascade parameter to the volume
delete command.  Using this will call the volume delete
with an additional parameter that deletes snapshots as
part of the same operation.

The name "cascade" is chosen to be somewhat generic,
so that we can extend this if desired in the future.
(And to hint at the terminology from SQL.)

Depends-On: I33d15b76d4bd0de14c635d404b2c97096c977a58
Change-Id: I05ce61e647c43f9a1e6d74444356a76e5d284673
Blueprint: del-vols-with-snaps
2016-02-24 16:31:32 +00:00
Eric Harney
c4c2c56042 Don't print HTTP codes for non-HTTP errors
This changes:
 $ cinder rename asdf
 ERROR: Must supply either name or description. (HTTP 1)

To:
 $ cinder rename asdf
 ERROR: Must supply either name or description.

Affects rename, snapshot-rename, consisgroup-update,
and consisgroup-create-from-src.
(consisgroup-* previously printed HTTP 400.)

Closes-Bug: #1549020
Closes-Bug: #1549026
Change-Id: Ia920b3b75b53170789b694cbdd49100bd6a72d21
2016-02-24 11:00:05 -05:00
John Griffith
88934c2708 Add replication v2.1 (cheesecake) calls
Cheesecake introduces a host based replication use case.
This change includes the changes needed to support those
implementations in the Cinder API.

Implements: blueprint replication-update

Change-Id: I74dc1a00fb4a2c05510c6159253036ac19706959
2016-02-24 00:47:13 +00:00
Jenkins
13a29b5a32 Merge "Fix sort problem in snapshot and backup list" 2016-02-23 22:04:17 +00:00
Sheel Rana
a26c1e67b6 Extra 'u' in output of cinder cli commands
In output of cinder show command, below fields contains extra 'u'
character being unicode:
1. volume_image_metadata
2. metadata

In output of "cinder credentials", below field contains extra 'u'
1. roles

In output of "cinder qos-create", below field contains extra 'u'
1. specs

In output of "cinder qos-list", below field contains extra 'u'
1. specs

In output of "cinder extra-specs-list", below field contains extra 'u'
1. extra_specs

In output of "cinder qos-show", below field contains extra 'u'
1. specs

Change-Id: I8be32f117ddc29b087ee872ff065c175dd70b372
Closes-Bug: #1538413
Closes-Bug: #1538415
2016-02-19 17:26:24 +00:00
Shilpa Jagannath
a3dca1599f Allow "cinder backup-delete" to delete multiple backups in one request
While "cinder snapshot-delete" and "cinder delete" allow multiple resources to be deleted in a single command, "cinder backup-delete" request can only delete one backup at a time. Adding this capability to backups in cinderclient. Enables "cinder backup-delete" to delete multiple backups in a single command.

With this change the command can be run as below:

cinder backup-delete <backup> [<backup>...]

DocImpact
Closes-Bug: #1543056
Implements: blueprint cli-backup-multiple-deletes

Change-Id: I767710bda3b7c358c6525c9a9f074010084e411d
2016-02-11 10:40:05 +00:00
Jenkins
64138007bd Merge "Bootable filter for listening volumes from CLI" 2016-02-08 16:49:49 +00:00
Sheel Rana
3dec787a52 Bootable filter for listening volumes from CLI
This fix depends upon fix proposed in cinder.

Depends-On: I1f1ec20441b28e01bf07bc4f60d848b653e58d58

DocImpact

Implements : blueprint select-volume-through-bootable-option

Closes-Bug: #1535749

Change-Id: Ibf3eadc95307e0c803ad9fa449578f8ca6f654d0
2016-02-04 15:11:24 +00:00
Jenkins
bdeab3af0e Merge "CLI for backup snapshots" 2016-02-03 16:12:01 +00:00
LisaLi
c18f9073a4 Fix sort problem in snapshot and backup list
The sort in command snapshot-list and backup-list
doesn't work, and they show same results.

The patch is to fix the problem, and transfer
sortby_index as None in utils.print_list.

Closes-Bug: #1536054

Change-Id: I00760fd4b395b04b95a8139224e18ea8d649d377
2016-01-20 08:53:38 +00:00
Herman Ge
0e9e2849f6 Word Misspelling
Word misspelling in following message:

1. shell.py

help='A unqiue identifier that represents a failover target.'

2. volumes.py

:param secondary: A unqiue identifier that represents a failover

Should change the word 'unqiue' to 'unique'.

Change-Id: I44a94b403f0bb71864d03683bdaf3b98f4d73bb1
2016-01-11 10:30:36 -05:00
Jenkins
fa18f8e171 Merge "Fix for 'quota-delete' call to API v2" 2015-12-31 20:08:06 +00:00
Jenkins
77fc5c1717 Merge "Fix help message in backup reset-state" 2015-12-23 23:45:02 +00:00
Jenkins
0b3afcc7d7 Merge "support for snapshot management" 2015-12-21 22:41:35 +00:00
LisaLi
35b5e6f4af Fix help message in backup reset-state
Refer the source code
https://github.com/openstack/cinder/blob/master/cinder/api/contrib/admin_actions.py#L367
backup reset-state only supports valid state as available and error.

Change-Id: I783e08170f4a2e56959918b62b424f43c1c93fb5
2015-12-21 15:11:44 +08:00
Szymon Borkowski
f39a383ed9 Fix for 'quota-delete' call to API v2
Before, when API in cinderclient was set to v2, the issued call
used to fail with an error message, that the call is connecting
to the endpoint compatible to API v1, when other quota calls
were connecting to the proper, v2 enpoint.

Change-Id: I99a16e93ed15e3819d48d193b550c786012462d8
Closes-Bug: 1526829
2015-12-16 16:19:00 +01:00
Jenkins
484c6e3a9c Merge "Add optional argument to list subcommand" 2015-12-09 00:19:40 +00:00
Mitsuhiro Tanino
c38b35cb61 Add optional argument to list subcommand
Cinder list command was intended to show summary of
volumes, but currently the command shows many entries
than we expected.

This patch adds these two fixes to show volume list
more simply.

- Remove 'migration status' and 'multiattach' from
  default list view.

- Add '--field' optional argument to 'list' subcommand.
  This argument allows users to show only specified
  entries. Unavailable fields will be ignored from
  the list result.

DocImpact
Change-Id: Iad4bf76e87f84b6e57ec59d134b9413fcad16ce8
Closes-Bug: #1502639
2015-12-04 11:43:06 -05:00
wanghao
948e90010f support for snapshot management
Add support to manage/unmanage snapshot

cinder snapshot-manage volume identifier
option args is --id-type, --name, --description,
--metadata.

cinder snapshot-unmanage snapshot

DocImpact

Implements: blueprint support-for-snapshot-management
Change-Id: Id4d73fa0ff0c0c05c0c69924968aa2154da64118
2015-12-02 10:07:11 +08:00
Atsushi SAKAI
a2ccc85a73 Fix comma location in comment
comment message effects to CLI-reference message.

Change-Id: I6d76d6bc6077b4915aaa74968e294abbc3f72f30
2015-12-02 10:15:56 +09:00
Jenkins
7f9a81bb1b Merge "Adds v2 replication support" 2015-11-30 20:33:11 +00:00
Jenkins
37ea6acad7 Merge "Use oslo_utils encodeutils and strutils" 2015-11-27 22:58:42 +00:00
Alex O'Rourke
b8e118f5c2 Adds v2 replication support
v2 replication has been merged in cinder, but there is no way to call
the api methods. This patch allows the following methods to be called
in order to fully support v2 replication:
  - os-enable_replication
  - os-disable_replication
  - os-list_replication_targets
  - os-failover_replication

Change-Id: Ic3cf082916bdf089de05eebce456dff8cdc11f7c
Implements: blueprint replication-v2
2015-11-24 13:13:23 -08:00
Ryan McNair
294acfd5c4 Fix v2 qos-key command
As part of commit 0d2bf657ae5271a01e9ec84d379d17910b263b7e,
qos-key command's v2 support got broken again reintroducing
bug #1284321.

Change-Id: I30d60b060bd1b161bc96c4a529f4732b9ceef90d
Closes-Bug: 1284321
2015-11-24 17:01:54 +00:00
Eric Harney
6fe9f20663 Use oslo_utils encodeutils and strutils
With oslo-incubator being deprecated, move
our use of strutils to oslo_utils.

This leaves in place the use of oslo-incubator's
strutils by other oslo-incubator modules for now.

Change-Id: Ic4e50060b42aeca9d1e54424a8a3a123140fbf2a
2015-11-23 10:44:12 -05:00
Xing Yang
8fbbf7be94 CLI for backup snapshots
This adds CLI support for backup snapshots.

Server side change is here:
https://review.openstack.org/#/c/243406/

Depends-on: Ib4ab9ca9dc72b30151154f3f96037f9ce3c9c540
Change-Id: I5b58d872c9b4842fae5f2e7a4ddfc6662a6c8d7a
Implements: blueprint backup-snapshots
2015-11-20 13:47:46 -05:00
Jenkins
e2a64f361d Merge "Adding backup-reset-state to CLI" 2015-11-18 22:58:06 +00:00
Jenkins
5f436b6a6d Merge "Update help message for cinder migrate" 2015-11-15 03:50:38 +00:00
Jenkins
2ca2b96723 Merge "Implement cinder type-show" 2015-11-11 19:37:39 +00:00
Nate Potter
1a3dbfaabb Update help message for cinder migrate
As per the doc bug https://bugs.launchpad.net/openstack-manuals/+bug/1363830
documentation for the cinder CLI should be updated to reflect that the host
needs to be given in the form host@backend#pool, and the docs for the
cli-reference are auto-generated from the client.

Change-Id: I66d41e05436782c3acd24f9633c4b67ca5c56b15
2015-11-06 21:56:10 +00:00
Kurt Martin
cb08ce33eb Fix volume size units to match the API
Both Horizon and the cinder client documents the size paramater in
gigabyes(GBs) but the API docs(both v1 and v2) list the size units as
gibibytes(GiBs). The correct unit should be gibibytes(GiBs). This
should help in clearing up any confusion on what units are used in
Cinder.

Closes-bug: 1511167
Change-Id: I42e15c18d1f084d435a2be9b343fb2f6c3cf377f
2015-11-03 15:24:29 -08:00
Nate Potter
8690e41c22 Adding backup-reset-state to CLI
This patch adds the ability to reset the state of
a backup with the command backup-reset-state.

DocImpact

Change-Id: I5851bb21c62252f61ad6a09f01859582e774a9db
Closes-Bug: #1279764
2015-10-20 19:17:55 +00:00
Nate Potter
428d2ebb7f Implement cinder type-show
This patch adds the type-show command to the
cinder CLI for viewing information on volume
types.

Change-Id: I7b283b120727f2fbd186e6f07a6450795bdf03c3
Closes-Bug: #1505806
2015-10-16 19:58:06 +00:00
Jenkins
92f3d35d5b Merge "Adding pagination to snapshots and backups lists" 2015-10-10 13:09:54 +00:00
Jenkins
497264e8e9 Merge "Add commands to show image metadata" 2015-10-08 15:04:09 +00:00