Change I1f43c37c2266e43146637beadc027ccf6dec017e adds time-comparison
filtering to the volume list calls (summary and detail) in the Block
Storage API microversion 3.60. The current cinderclient filter
support will pass these filters correctly, so the only change needed
on the client side is to bump the MAX_VERSION so that the client
can make calls to mv 3.60.
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>
Change-Id: Ib4b7cbc7e527c0524336e139e127f19accfb7568
Partially-Implements: bp support-to-query-cinder-resources-filter-by-time-comparison-operators
If OS_VOLUME_API_VERSION is not set, use the highest
supported by both the client and the server.
If OS_VOLUME_API_VERSION exceeds that supported by the server,
use the highest supported by both the client and the server.
A warning message is printed for the user indicating that this
happened.
(This is similar to the behavior of the manila CLI, and is
mostly code from manilaclient tweaked to work in cinderclient.)
Change-Id: Ie1403eca2a191f62169e60c0cde1622575327387
Change Idb04f783b2287b2b45d626131648b0005a232fbe to the cinder service
introduced pagination and the ability to sort results for listing volume
transfers. This adds the sort ability to the cinder client.
The service side uses the sort_key and sort_dir that we've deprecated
long ago, but was unfortunately missed when merging this support. Since
we have been giving deprecation warnings for using those for other
operations, this adds support for --sort that internally will convert to
the API's expected sort_key and sort_dir.
Change-Id: I137436c76852cbb974eee87e49712c698cbf081b
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The discover_version function was ignoring the max microversion
supported by the client. This patch corrects its behavior to return
the most recent API version, if any, supported by both the client
and the server it is communicating with.
Closes-bug: #1826286
Change-Id: If22b72452065080b24cb1b899c5a5a88b809e986
This drops compatibility with Cinder services with the V1 API.
Change-Id: Ic7c6bd05a3991c3afce3dec80b29501932c5aac9
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Functionality was added during stein, but the MAX_VERSION of the client
was not updated for these versions. This raises the version to support
the added functionality.
3.57 - Improve volume transfer records - no client changes
3.58 - Add project_id to group - no client changes
3.59 is not included here as that adds sort and pagination that will
need to be slightly reworked before we expose it.
Change-Id: If8a3b88b9a2811ae6681e52dbca62b906d3542eb
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Backup user_id was added with microversion 3.56 but never added to the
client. Added in Rocky with I3ffb544ef3ee65276cee8b1e870d524fd0e57085.
Change-Id: Ib9a4159db0f8af599dcf8315334de4f859be077e
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Functionality was added during rocky, but the MAX_VERSION of the client
was not updated for these versions. This raises the version to support
the added functionality.
3.53 - Schema validation - no client changes
3.54 - Add mode option to attachment-create:
I22cfddd0192c4a72b8f844f23d1fa51b96c57e06
3.55 - Transfer snapshots with volumes
I61a84b5abf386a4073baea57d8820c8fd762ae03
Change-Id: I8c8fb8f552e529c8474a3e3b771ba8eb7aed193a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Since 3.52, new option '--filters' has been
added to 'type-list' command, and it's only
valid for administrator.
Change-Id: I140f6d61a2747d4fcaabfbccea864dcc7eb841d1
Depends-On: I4e6aa7af707bd063e7edf2b0bf28e3071ad5c67a
Partial-Implements: bp support-az-in-volumetype
This change is to bump MAX_VERSION to
3.50 in api_version. This bump is necessary to
keep cinderclient in sync with cinder which moved
to 3.50 with change: f1bfd9790d2a7cac9a3e66417b11dc8e3edd8109
With MV 3.50 we are able to request multiple attachments for
a single volume.
Change-Id: Ic51b890b816112cecaedd68df8d13ec175623c66
This patch will support the feature: report backend state in service list
in client side.
Depends-On: I561dca3ef7c1901401621bc112389dbd178a907e
Change-Id: If15e1fa50b5feecd74c7394c918f4fc9d87bcf3e
Implements: blueprint report-backend-state-in-service-list
In order for Nova to be able to make use of the code
for shared_targets that has gone into Cinder we need to
bump to API Version to 3.48.
This bumps to 3.48 to match the latest add to the Cinder side:
https://review.openstack.org/#/c/524697/1
Change-Id: Icaa17654bd2810098d02f8074fedb35c5221cd55
This patch adds create volume from backup support
in cinderclient.
Change-Id: I01dbcf6b113d88732c174b848be2127ee7242b3c
Implements: blueprint support-create-volume-from-backup
Depends-On: 58d0fb327f9fc980e0c8b84dcd9f64c093285d13
Bump max version in client directly as
the client changes are not needed.
1. 3.46: support create bootable volume from nova
0 size image.
Change-Id: Ib0cf2d88e55006c10b873327ccc85dca2dd09769
Add 'with_count' parameter in list
volume, snapshot and backup APIs.
Change-Id: I2b7b41b3579c24703a7a67ab5dc6f960a3ccbdc2
Partial-Implements: bp add-amount-info-in-list-api
3.45 has landed, but it's not the expected change.
This reverts commit 664299b235be69ae35670d96fb70e62836b9b5b0.
Change-Id: I39e93c6078871f8652889cf8a46c1af6962288e4
Adding a shared_targets field to Volumes in Cinder. This doesn't
require any changes in the client, however we do need to bump the
MAX MV support value.
Show volumes now returns two new fields that will be displayed in
the show command:
shared_targets: <True|False>
backend_name: <backend-name-of-storage-device>
Change-Id: Ie1291f90756c3752de562f022126af2f6b3e0637
The new attachment_update method in Cinder's API creates an attachment
object and populates it with the provided connector info. In addition,
we set the volumes status to in-use and update the attachment object
status to "attached".
This isn't really accurate though, because we don't know if the volume
is actually attached (connected) by the consumer or not. Also a big
side effect here is that currently all of our tests and automation
use volume-status to determine if a volume is fully connected/ready
for use and that everything went well. It's used as an ack in most
cases.
This change goes back to using multiple states to signify where a
an attachment is in it's life-cycle:
1. attachment_create
We've created an empty attachment record but haven't done anything
with it yet.
2. attachment_update
We provided a connector and set up the TGT so that everything is
ready for a consumer to connect/use it.
3. attachment_complete
An ACK back from the consumer letting us know that they connected
it successfully and are doing their thing.
It would be cool to just key all these checks of the attachment object itself,
and just use attachment_update to do so, maybe in the future?
Change-Id: I3b28d2cb89a8d81c7cdec425f355c78bfdfe3450
Related-Bug: #1710295
Enforce ordering of imports with H306.
For tests, this is mostly done by grouping test
imports after other cinderclient imports.
Change-Id: Ie40fda014d1aedb057e5b4ea1f27f999c84e6373
_get_server_version_range only supports a v3 client object
because ServiceManager.server_api_version() is only implemented
for the v3 client code. If you're trying to call this with a
v1 or v2 client object, it will raise an AttributeError which
is unhelpful for the end python API client.
This change handles the AttributeError and returns a more useful
error with an explanation of how the client code is wrong.
We could alternatively set versions = None and let it return two
empty APIVersion objects, but that seems confusing. This change
opts to be explicit about the failure.
Change-Id: I2266999df6332b8c5fb0ec808db69bcc847effb0
Closes-Bug: #1694739
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
This adds in a version-list command that reports the
min/max versions of the Cinder API supported by this
version of the client, and also queries the Cinder API
V3 server to obtain min/max micro-versions and report
those as well.
In addition, we bump the default version of the client to
3.0, of course if you specify V2 in your rc file or on the
cmd line that works fine too.
I did run into one problem where I broke:
cinder.tests.unit.test_shell:test_cinder_service_name
Seems to be some hidden trickery with a fake, fixture or
mock that I can't figure out. For now I added a skip to
that test, but maybe somebody can point out the problem
during review.
Change-Id: I44e667c511d89de28af758a3c9ea1f812e682f18
Add method to query a server that supports /v3 endpoint and get the
highest supported microversion.
Change-Id: If179760787526440c852803eafaf9617bcd2d36e
discover_version needs to find the proper module for server_api_version
method, and it needs to properly parse a list of versions.
Do some refactor to clean things up.
Add unit tests.
Co-Authored-By: waj334 <justin.wilson@intel.com>
Change-Id: I742bc33074cc55fe5f9682b8b97a82573c51183f
Closes-Bug: #1632872
We added cinderclient support for new cinder attach APIs,
but we didn't not bump the cindercliient MAX_VERSION to 3.27 to
correspond with the microversion of the new APIs.
Change-Id: I8ee93e28e8425cd46784a6f7280227ab28135177
Closes-Bug: 1660673
A StreamHandler was being setup that dumped logs to the console
regardless of the user's wishes. This removes that StreamHandler
setup so that the user can control the logging themselves.
Change-Id: I02756539a7c094153b9ec29a0ff2fecaabd44f71
Closes-Bug: #1647846
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
Our current APIVersion object has an is_null method to check when the
version instance is null (major=0 and minor=0).
While this works it is not very pythonic, since you have to write
expressions such as:
if not min_version and not max_version:
return True
elif ((min_version and max_version) and
max_version.is_null() and min_version.is_null()):
return True
This patch removes the is_null method and instead implements the truth
value testing to simplify expressions and make code more pythonic.
So previous code would just look like:
if not min_version and not max_version:
return True
Because this will work with min_version being None or being an
APIVersion instance with major=0 and minor=0.
Change-Id: I7497c5dc940c1e726507117cadbad232d8c1d80d
This patch adds support for group types and group specs
in the client.
Server patch is merged: https://review.openstack.org/#/c/320165/
Current microversion is 3.11. The following CLI's are supported.
cinder --os-volume-api-version 3.11 group-type-create my_test_group
cinder --os-volume-api-version 3.11 group-type-list
cinder --os-volume-api-version 3.11 group-type-show my_test_group
cinder --os-volume-api-version 3.11 group-type-key my_test_group
set test_key=test_val
cinder --os-volume-api-version 3.11 group-specs-list
cinder --os-volume-api-version 3.11 group-type-key my_test_group
unset test_key
cinder --os-volume-api-version 3.11 group-type-update <group type uuid>
--name "new_group" --description "my group type"
cinder --os-volume-api-version 3.11 group-type-delete new_group
Change-Id: I161a96aa53208e78146cb115d500fd6b2c42d046
Partial-Implements: blueprint generic-volume-group
String interpolation should be delayed to be handled by the logging
code, rather than being done at the point of the logging call.
See the oslo i18n guideline.
* http://docs.openstack.org/developer/oslo.i18n/guidelines.html
Change-Id: I3fa26c1c5c672d5505fa556e03af35318f4774ab
Closes-Bug: #1596829
This patch updates client to support cluster related changes on the API
done on microversion 3.7.
Service listing will include "cluster_name" field and we have 4 new
commands, "cluster-list", "cluster-show", "cluster-enable" and
"cluster-disable".
Specs: https://review.openstack.org/327283
Implements: blueprint cinder-volume-active-active-support
Depends-On: If1ef3a80900ca6d117bf854ad3de142d93694adf
Change-Id: I824f46b876e21e552d9f0c5cd3e836f35ea31837
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>
Changes to cinderclient to use microversions.
Implements: blueprint api-microversion-support-for-cinderclient
api-microversion-support-for-cinderclient
Change-Id: I840a1162b88e8ff36fa3fc4e1d6b9317104df3e0