14 Commits

Author SHA1 Message Date
haixin
cea1f674ae Remove all usage of six library
Replace six with Python 3 style code.

Change-Id: I4b97e040f3e790ac114dcd43c68e6b67b1079adf
2021-03-04 16:03:35 +08:00
Goutham Pacha Ravi
223d754f61 Fix encoding of query parameters
IETF RFC 3986 classifies "~" as a reserved character [1],
however until python3.7 [2], python's url parsing
used to encode this character.

urllib has seen a lot of churn in various python
releases, and hence we were using a six wrapper
to shield ourselves, however, this backwards-incompatible
change in encoding norms forces us to deal with
the problem at our end.

Cinder's API accepts "~" in both, its encoded
or un-encoded forms. So, let's stop encoding it
within cinderclient, regardless of the version
of python running it.

Also fix an inconsitency around the use of the
generic helper method in utils added in
I3a3ae90cc6011d1aa0cc39db4329d9bc08801904
(cinderclient/utils.py - build_query_param)
to allow for False as a value in the query.

[1] https://tools.ietf.org/html/rfc3986.html
[2] https://docs.python.org/3/library/urllib.parse.html#url-quoting

Change-Id: I89809694ac3e4081ce83fd4f788f9355d6772f59
Closes-Bug: #1784728
2018-09-13 18:51:17 -06:00
wanghao
83864a25e2 unable to create group from src in cinderclient
According the api schema of cinder, create_group_from_src
should only specify one of arguments from [group_snapshot_id, source_group_id].
Now cinderclient specified them both even if one of them is None.

This patch fix this issue to just pass one argument.

Change-Id: Idef51ab9a1452dd5eb3be4d4b6dca095a777d611
Closes-Bug: #1777555
2018-06-20 09:09:54 +08:00
wanghao
7283dedb13 Remove useless args in create_group_from_src
Remove status, project_id
and user_id args from create_group_from_src.

Those args will cause error when using cinderclient since
schema validation in Cinder side.

Change-Id: Iba9a45625f9e6423e8e582425605ca184238cde9
Closes-Bug: #1772375
2018-05-22 09:44:26 +08:00
jeremy.zhang
9c95a3fe7e Add api_version wraps for generic volume groups
This patch is mainly to add api_verion wraps for volume group APIs.

Change-Id: I1f71ef67c482410b9a671226f68160afde98ae5d
2018-01-11 23:21:37 +08:00
pooja jadhav
2a478b3528 Removed unnecessary parameters from group and group_snapshots create APIs
As per code, the 'status', 'user_id' and 'project_id' parameter
is not required to be passed in the request body in case of group
and group_snapshot create APIs. Even if you pass these parameter,
it is silently ignored in the code.

This patch removes those parameters passed in the request body.

Change-Id: I29e7d4c8a3eee52f4ea7278d2edf2c7deec40628
2017-12-14 11:23:12 +05:30
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
xing-yang
da79866e14 Tiramisu: replication group support
This patch adds CLI support for replication group.
It is built upon the generic volume groups.

Server side patch is here:
    https://review.openstack.org/#/c/352228/

Depends-On: I4d488252bd670b3ebabbcc9f5e29e0e4e913765a
Change-Id: I462c3ab8c9c3a6a1b434748f81d208359ffd2431
Implements: blueprint replication-cg
2017-05-05 02:14:56 -04:00
wangxiyuan
c349b318ae Support list-volume for group show
V3.25 support query groups with volumes, this patch add the client
support.

Partial-Implements: blueprint improvement-to-query-consistency-group-detail
Partial-Bug: #1663474

Change-Id: Ic0d86b9265f295877eebca97ff450f5efd73b184
2017-05-25 10:01:10 +08:00
TommyLike
af921bb6b4 Cinder client reset-state improvements
Now we can use 'cinder reset-state' command for 'volume',
'snapshot', 'backup', 'group' and 'group-snapshot'.
Also change volume's default status from 'available' to
'None' when not any status is specified.

Co-Authored-By: Eric Harney <eharney@redhat.com>

Change-Id: I0aefeaf5ece74f1f2bc4b72d5705c8c088921e20
Partial-implements: blueprint client-reset-state-improvements
2017-05-19 22:52:24 +00:00
TommyLike
d8ca399aba Optimize: add build_query_param method to clean code
Currently the client build query params in respective method
this patch intends to use 'utils.build_query_param' to make
the code clean.

Change-Id: I3a3ae90cc6011d1aa0cc39db4329d9bc08801904
2016-11-07 09:26:52 +08: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
xing-yang
f7928c4058 Add support for group snapshots
This patch adds support for group snapshots.

Server side API patch was merged:
    https://review.openstack.org/#/c/361369/

Current microversion is 3.14. The following CLI's are supported:
cinder --os-volume-api-version 3.14 group-create-from-src
    --name my_group --group-snapshot <group snapshot uuid>
cinder --os-volume-api-version 3.14 group-create-from-src
    --name my_group --source-group <source group uuid>
cinder --os-volume-api-version 3.14 group-snapshot-create
    --name <name> <group uuid>
cinder --os-volume-api-version 3.14 group-snapshot-list
cinder --os-volume-api-version 3.14 group-snapshot-show
    <group snapshot uuid>
cinder --os-volume-api-version 3.14 group-snapshot-delete
    <group snapshot uuid>

Depends-on: I2e628968afcf058113e1f1aeb851570c7f0f3a08
Partial-Implements: blueprint generic-volume-group
Change-Id: I5c311fe5a6aeadd1d4fca60493f4295dc368944c
2016-07-19 16:35:45 -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