Our CLI docs are very out of date. These used to be generated by the
docs team with some tooling they had. Since the docs moved in-repo, that
tooling has gone away, and for the most part no one has done any updates
to the CLI docs.
This adds a sphinx directive that will generate these docs every time
the docs are built. This way, whenever someone makes a CLI change, they
do not need to have to know to also edit a documentation file to match
their change. Any code changes will automatically be picked up and
reflected in the docs.
Change-Id: I4406872ab6e9335e338b710e492171580df74fa5
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The --bypass-url argument was removed with
I3b951cc4eb3adff23f3d2cbe674971816261ef56 so this name does not make
sense now. Replace with os_endpoint.
Change-Id: Ifa889cc2e885e9c621c8494995b2020195b696ca
Currently ``id`` and ``volume_id`` filters are working
correctly for transfer-list command.
support for filtering by ``name`` is handled in patch
provided in Depends-On.
Since filtering by all parameters is supported by API,
we can happily add the filters option on the client for
volume transfers.
Also adds functional test for transfers.
Related-Bug: #1860100
Depends-On: https://review.opendev.org/#/c/703658/
Change-Id: I2fd3a6a7b9add65a9a21388df44efb6747065a74
We've kept hacking capped for a long time now. This raises the hacking
package version to the latest release and fixes the issues that it
found.
Change-Id: I69e41a340c815090f25677607e971a8e75791f6d
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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
When we use `--poll` parameter with cinder create command, it waits
for the volume to become available but doesn't update the data
displayed to the user.
Due to this, there are inconsistency between several parameters
in the output after 'poll' and 'cinder show' command.
Eg: cinder create 1 --image <image-id> --poll
shows 'bootable' flag as false
whereas, cinder show <vol-id>
shows 'bootable' as true
Change-Id: I1502e88f1cd84d225b75c07313e4eb252cc2d645
Closes-Bug: #1855224
These arguments were deprecated in the kilo release in favor of a
combined --sort argument. This drops support for the deprecated
arguments.
Change-Id: If8f8ac44cc81f553009a15ca67257e86cb925b6f
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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>
This patch does the following :
1) Errors out if similar type of filters args are passed
Eg :
cinder list --name abc --name xyz
cinder list --name abc --filters name=xyz
2) Allows multiple filter parameters of different type
cinder list --filters name=abc --filters size=1
Change-Id: I2f8662555f830b0821147324849d04e7a29d0580
'server_id' is not Attachment attribute, should be
set by 'instance' attribute.
v3/attachments respond body:
{"attachments":
[{"status": "attached",
"instance": INSTANCE_UUID,
"id": ATTACHMENT_UUID,
"volume_id": VOLUME_UUID,
},
...
]
}
Change-Id: Ica5d278cb7455befe1db4be0ab65114fd606ea0a
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>
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>
Upload-to-image would error after launching
the operation if the volume type is None.
Closes-Bug: #1821818
Change-Id: I015e0ddfa98d62f25334e2df5effaee72a3988ab
The all_tenants filter is passed to API when it's value is 0
(when not specified) which shouldn't be the case.
This patch only allows adding of all_tenants when specified
manually by user.
Change-Id: Ic7810c4d6e9f4be7c28c7a8778d57bb5ccb996a0
Closes-Bug: #1808621
Closes-Bug: #1808622
This enables writing ids to a local completion
cache when using the cinderclient shell, which
allows tools/cinder.bash_completion to complete
commands such as
cinder delete a<tab>
Volume ids are recorded on "cinder list" and
"cinder create" operations, similar for backup ids.
This functionality was unintentionally removed in
changes some time ago. Labeled as Partial-Bug
because I haven't added name caching yet, which also
used to exist.
Partial-Bug: #1712835
Change-Id: Id56aa43b061758a00a2a8c9c92a5a33ab9f7ab84
(cherry picked from commit c4b37c2830fdd90b57383a93e09a8bd40ca41221)
Adding the comment flake8:noqa in a file will skip linting the entire
file. Most of the time, the intent was just to skip individual lines to
handle exception cases.
This gets rid of the "flake8:" prefix where it was used incorrectly and
fixes a few legitimate errors that were being hidden by the entire file
being skipped.
The behavior is change in flake8 to handle this better, which will
result in pep8 job failures if these are not fixes first. See more
information in the 3.6.0 release notes:
http://flake8.pycqa.org/en/latest/release-notes/3.6.0.html#features
Change-Id: I56cb20a7c8885c101826d4fe28c315de02b6ecb8
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Specifying size is not required while providing --backup-id.
Also When we don't provide the size the output turns out to be
error: Size is a required parameter if snapshot or source
volume or backup is not specified.
which should be modified in 'size' info too.
Change-Id: Ia250df37db9170757d5f834d516781e04582f08b
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
All volume transfer v3 calls were being sent to the endpoint introduced
with microversion 3.55. This fixes backwards compatibility by routing
calls less than 3.55 to the original API extension endpoint.
Change-Id: I7205033ddd5be126b8614372a9fc82a2bc555f48
Closes-bug: #1785330
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Handling for the new `no_snapshots` option was incorrectly handling
microversion evaluation that would prevent anything less than the new
microversion from working. This changes the check to only handle the
changed argument for 3.55 and later.
Change-Id: If96889ccde6044706e6a5dcd83fde3c20fe1c1fd
Closes-bug: #1784703
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Change Icbb9c0ca89b25620cedff6cac7a4723e7126eca6 notified that the
``multiattach`` argument was deprecated, but nothing was added to the
args help text to indicate this, relying on a user to have read the
release notes.
In preparation of removing this option, this updates the help text so
there is at least some indication that it is going away.
Change-Id: I9e767a3f1411fbfc0bf0e433b45560e451d547d5
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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>
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
This patch will support to transfer volumes with or without
snapshots in new V3 api after mircoversion 3.55.
Change-Id: I61a84b5abf386a4073baea57d8820c8fd762ae03
Depends-On: https://review.openstack.org/533564/
Implements: blueprint transfer-snps-with-vols
We introduce a mode option in attachment-create starting with
microversion 3.54. The mode option is the new/preferred way of
setting ro mode (as opposed to admin-metadata).
This patch adds the support for the mode option to the client for
endpoints that support 3.54.
Depends-on: https://review.openstack.org/532702/
Change-Id: I22cfddd0192c4a72b8f844f23d1fa51b96c57e06
5a1513244caf7acbd41e181419bc8b62bf4bcaba added the ability to
filter by AZ, but it changed the existing behavior if is_public
was not specified. This adds handling to make sure we are still
consistent with the previous behavior.
Co-Authored-by: Alan Bishop <abishop@redhat.com>
Change-Id: I5000aab092c1b434c8dc17bbe4b2d3d632f528c3
Closes-bug: #1778055
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