28 Commits

Author SHA1 Message Date
Armstrong Liu
8f12b620a0 Update revert_to_snapshot params
In revert_to_snapshot method, snapshot param must be a object and
also has 'id' attribute, so before use the method, we have to use
snapshot.get method to get snapshot information.

But revert_to_snaoshot only use id of snapshot, we can use snapshot
instead of snapshot.id.

Change-Id: Ifbdbae3ee66d72f9d34cf4a8fdf2bde388b2b6f0
2019-12-13 11:46:37 +08:00
Sean McGinnis
3c1b417959 Drop support for --allow-multiattach
The ability to enable multiattach on the command line was deprecated in
Queens with the full implementation of multiattach enabling it through
volume type extra specs. This removes the command line arg and handling
for specifying it with volume creation.

Change-Id: Ifc0c874657f959266050cd1a7a40e6ecccc8c114
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-09-11 08:06:43 -04:00
Eric Harney
274fa11169 Fix shell upload-to-image with no volume type
Upload-to-image would error after launching
the operation if the volume type is None.

Closes-Bug: #1821818
Change-Id: I015e0ddfa98d62f25334e2df5effaee72a3988ab
2019-04-03 11:34:40 -04:00
Sean McGinnis
32251f0ea3
Remove replication v1 support
The replication v1 implementation in Cinder was deprecated in the Mitaka
release in favor of the v2 "Cheesecake" version. Support was kept in the
client for backwards compatibility, but it has now been several releases
and these options should be removed.

Closes-bug: #1705470

Change-Id: I978a39a552fffc9ac7ba6e4726d1df2072fa45ba
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-07-26 11:41:57 -05:00
Neha Alhat
8d56668900 Remove unnecessary parameters from volume create APIs
As per Cinder code, following parameters are not required to be
passed in the request body of create volume API.

    * status
    * user_id
    * attach_status
    * project_id
    * source_replica

If you pass these parameters, previously it was ignored but in the
schema validation changes[1] we don't allow additionalProperties to be
passed in the request body. If user passes additional parameters which
are not as per API specs[2], then it will be rejected with 400 error.
On patch[3], tempest tests: test_volume_snapshot_create_get_list_delete,
test_volume_create_get_delete" are failing because of these unnecessary
parameters.

This patch removes these unnecessary parameters passed to the create
Volume API.

[1]https://blueprints.launchpad.net/cinder/+spec/json-schema-validation
[2]https://review.openstack.org/#/c/507386/
[3]https://review.openstack.org/#/c/573093/

Change-Id: I37744bfd0b0bc59682c3e680c1200f608ad3991b
2018-07-26 11:29:08 -05:00
jeremy.zhang
e2618ebb24 Add api_version wraps for some v3 volume APIs
This patch is mainly to add api_version wraps for some v3 volume APIs.

Change-Id: Iea8b9b68930548156749da3f98629e3602ffca83
2018-01-25 21:56:28 +08:00
Zuul
24e46d116a Merge "Add cluster support in manage listings" 2018-01-16 07:37:17 +00:00
jeremy.zhang
97925fe251 Fix 'cluster' paramter using for v3 volume manage
The 'cluster' paramter is wrongly provided for v3 volume manage, as it
should be included in the 'volume' object.

Change-Id: I12440aa6ada9c0e058138e8da7f7bc12359847bb
2018-01-05 21:48:56 +08:00
Sean McGinnis
adb141a262 Deprecate multiattach flag on volume create
This form of multiattach was never fully supported and is now being
replaced by the new mutliattach workflow with Nova. As part of this,
volume type extra specs will be used to indicate multiattach ability
and will allow retyping between volume types to change the flag after
creation.

That work is still in progress and has some potential to change. But
we know we are not going to support this old style, so we should get
that deprecated now so we can remove it and not cause any confusion.

Change-Id: Icbb9c0ca89b25620cedff6cac7a4723e7126eca6
2017-12-21 16:08:55 -06:00
TommyLike
7aedf4c898 Support create volume from backup in client
This patch adds create volume from backup support
in cinderclient.

Change-Id: I01dbcf6b113d88732c174b848be2127ee7242b3c
Implements: blueprint support-create-volume-from-backup
Depends-On: 58d0fb327f9fc980e0c8b84dcd9f64c093285d13
2017-12-07 11:31:39 +08:00
Gorka Eguileor
1a4176ad87 Add cluster support in manage listings
This patch adds support for API microversion 3.17, which allows us to
pass --cluster optional argument to volume and snapshot manage listings.

Implements: blueprint cinder-volume-active-active-support
Change-Id: I97b5f2e9960d5a1f140fc638804dbc631d63ff9d
2017-10-03 11:03:28 +02:00
Gorka Eguileor
8fce74056f Add cluster support in migration and manage
This patch adds support for API microversion 3.16, which allows us to
pass --cluster optional argument to migration and manage operations.

For this, a new type of CLI argument is added, the mutually exclusive
arguments that can be used similarly to the utils.arg decorator, but
with utils.exclusive_arg decorator.

Implements: blueprint cinder-volume-active-active-support
Change-Id: If004715b9887d2a0f9fc630b44d6e11a4a8b778d
2017-10-03 11:03:28 +02:00
Eric Harney
74457db9ae Enable F811, F821
F811 is a little noisy with api_versions.wraps()
decorated methods, but opting to disable it in these
cases seems better than missing problems in the rest
of the code.

Change-Id: I9c46938ab2a442e55f96b5ab6c119c4475afaecd
2017-08-23 15:02:14 -04:00
Eric Harney
60d00b0a03 Enable H306
Enforce ordering of imports with H306.

For tests, this is mostly done by grouping test
imports after other cinderclient imports.

Change-Id: Ie40fda014d1aedb057e5b4ea1f27f999c84e6373
2017-08-01 16:23:49 -04:00
wangxiyuan
a570f26d97 Support volume summary command
This patch added volume summary command support.

Change-Id: I7cf6e149b9ce9cae21818c60146e6db9cc2904bd
2017-07-12 09:18:31 +08:00
TommyLike
7dfbb239de Support revert to snapshot in client
This patch added revert to snapshot support in
cinder client, also fix two pylint errors.

Change-Id: I20d8df8d7bcf763f6651f44901a98f6d853b27ce
Partial-Implements: blueprint revert-volume-to-snapshot
Depends-On: cca9e1ac54d123da8859ff918b2355606bfa474e
2017-05-04 20:22:13 -04:00
TommyLike
a6affea921 Support generalized resource filter in client
Introduce new command 'list-filters' to retrieve
enabled resource filters.

```
command: cinder list-filters --resource=volume

output:
+----------------+-------------------------------+
| Resource       | Filters                       |
+----------------+-------------------------------+
| volume         | name, status, image_metadata  |
+----------------+-------------------------------+

```

Also Added new option '--filters' to these list commands:
1. list
2. snapshot-list
3. backup-list
4. attachment-list
5. message-list
6. group-list
7. group-snapshot-list
8. get-pools

Change-Id: I062e6227342ea0d940a8333e84014969c33b49df
Partial: blueprint generalized-filtering-for-cinder-list-resource
Depends-On: 04bd22c1eb371805a3ce9f6c8915325bc0da2d36
Depends-On: 7fdc4688fea373afb85d929e649d311568d1855a
2017-05-31 11:32:49 +00:00
Justin A Wilson
6e2253eabf Missing client version 3.0 support for "delete_metadata" method
Attempting to call the "delete_metadata" method with a client
at version 3.0 gives versioning error.

closes bug: 1659670

Change-Id: I839d405f02bcb6cb6bf6ed91dba972809b9916f7
2016-09-29 08:12:22 -07:00
Ivan Kolodyazhny
603c615ae5 Refactor v2 and v3 APIs support
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
2016-12-20 16:29:36 +02:00
dineshbhor
a01a3e1b7f Move old oslo-incubator code out of openstack/common
As part of the first community-wide goal, teams were asked to
remove the openstack/common package of their projects if one
existed. This was a byproduct of the old oslo-incubator form
of syncing common functionality.

The package, apiclient, was moved to a top level location and
cliutils was moved to the common module. There are no oslo
specific libraries, the recommended solution is to move it in
tree and maintain it there.

Change-Id: Iee52004bd33c19d63133577ff466164b85fd6ca6
2016-11-03 18:29:31 +05:30
Yuriy Nesenenko
e15d8e7f09 Deleting volume metadata keys with a single request
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
2016-09-01 22:53:06 +03:00
Avishay Traeger
d24ba31afa List manageable volumes and snapshots
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
2016-07-19 18:57:09 -04:00
xing-yang
6c5a764c77 Add generic volume groups
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
2016-07-19 00:37:36 -04:00
Cao ShuFeng
09a76374c3 Fix useless api_version of Manager class
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
2016-08-23 05:32:00 +00:00
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
Mitsuhiro Tanino
729b8f8474 Don't reset volume status when resetting migration status
In case of failed volume migration, status of the volume is
still in-use and the migration status is set to error.

Current reset-migration-status command resets not only
migration status but also volume status. However the volume
status should not reset because the volume is still attached.

Closes-Bug #1552058
Change-Id: I9a8a5ed6a00bdcffecbf98862fe60aee373f5e9b
2016-05-18 15:43:54 -04:00
Nathaniel Potter
7590fe4b7d Add options when uploading images to Glance
Added --visibility and --protected options
when uploading volumes to the image service.

DocImpact

Change-Id: Ie639179c5bbbaca4de62b42b368830afcfd8f7ac
Closes-Bug: #1288131
Depends-On: I6e6b2276af22b7809ea88289427c6873211b3faf
Signed-off-by: Nathaniel Potter <nathaniel.potter@intel.com>
2016-04-21 17:51:43 +00: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