163 Commits

Author SHA1 Message Date
Sean McGinnis
1021aee31f
Add directive to document CLI
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>
2020-06-03 22:19:10 -05:00
Rajat Dhasmana
8d0d0521c6 Add filters support for volume transfer
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
2020-02-12 17:53:58 +00:00
Zuul
dea742c940 Merge "Raise hacking version to 2.0.0" 2020-02-12 15:54:32 +00:00
Zuul
48a9cd5aca Merge "Fix: --poll inconsistency" 2020-02-12 12:56:08 +00:00
Sean McGinnis
ced267b1d5
Raise hacking version to 2.0.0
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>
2019-12-21 03:27:48 -06:00
Zuul
d240091c32 Merge "Update hacking version" 2019-12-12 00:59:06 +00:00
whoami-rajat
ceddb3cfd0 Fix: --poll inconsistency
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
2019-12-05 05:24:14 +00:00
jacky06
e2436b310f Update hacking version
Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I1ae708f0753249226ceb47610a1a4d0b558c1d0e
2019-10-30 11:00:12 -04:00
Zuul
a63d4d651a Merge "Drop support for --sort_key and --sort_dir" 2019-09-11 20:29:58 +00:00
Zuul
d83998f6f0 Merge "Drop support for --allow-multiattach" 2019-09-11 15:59:44 +00:00
Sean McGinnis
246040a732 Drop support for --sort_key and --sort_dir
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>
2019-09-11 09:38:34 -04: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
whoami-rajat
624b444226 Optional filters parameters should be passed only once
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
2019-09-05 18:27:52 +05:30
Zuul
67dcd42291 Merge "Add transfer-list --sort argument" 2019-08-30 18:15:41 +00:00
Zuul
fd106c77bf Merge "Add 'is_public' support in '--filters' option" 2019-08-21 11:13:18 +00:00
Minmin Ren
03f228c11e Add missed 'Server ID' output in attachment-list
'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
2019-06-04 10:11:02 +00:00
Zuul
a9d9d34778 Merge "Add bash completion for groups" 2019-06-03 17:27:43 +00:00
Zuul
ee74e8f2e8 Merge "Fix shell upload-to-image with no volume type" 2019-05-23 07:08:51 +00:00
Sean McGinnis
8b1ed34ec1 Add transfer-list --sort argument
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>
2019-05-04 09:52:51 -05:00
Sean McGinnis
44061cfab2
Add support for backup user ID
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>
2019-04-17 09:59:44 -05:00
whoami-rajat
6a498163e2 Add 'is_public' support in '--filters' option
'--is-public' is a valid argument for cinder type-list command[1]
and cinder group-type-list command but is missing in cinderclient.
This patch adds the support for it.

[1] https://developer.openstack.org/api-ref/block-storage/v3/?expanded=list-all-volume-types-detail#list-all-volume-types

Change-Id: I8af9bb06a28f3cc384c4925b8b52bdeaed52cb15
2019-04-15 08:36:27 +00: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
Eric Harney
17a1c4a14a Add bash completion for groups
Completion for group create/list.

Change-Id: I0b7027a72a3bc8ad7ca7323c6dbe0a501616cdd5
2019-03-07 12:25:06 -05:00
Zuul
dc6e24f7d7 Merge "Fix: cinder group-list not working with non-admin user" 2019-02-25 23:09:28 +00:00
whoami-rajat
532aef0c73 Fix: cinder group-list not working with non-admin user
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
2019-02-18 14:34:35 +05:30
Eric Harney
e40166740e More shell completion cache additions
Closes-Bug: #1712835
Change-Id: I9326d5d92ff2e93dd0398d9a115210b376059064
2018-12-21 06:16:55 +00:00
Eric Harney
7319a40767 Re-enable shell UUID completion cache
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)
2018-12-14 11:41:34 -05:00
Sean McGinnis
e26b64c1a3
Fix incorrect use of flake8:noqa
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>
2018-10-26 13:26:29 -05:00
Zuul
3dbf4728ea Merge "[Optimize] Update help text for hint argument" 2018-10-01 17:15:49 +00:00
whoami-rajat
525a855643 [Trivial] Add backup-id to 'size' param info
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
2018-09-19 11:30:22 +00:00
Zuul
e76c4958ea Merge "Reflect multiattach deprecation in help text" 2018-07-27 02:16:21 +00:00
Sean McGinnis
fee0b58ef8 Reflect multiattach deprecation in help text
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>
2018-07-26 15:39:52 -05: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
Zuul
9b1d6247be Merge "Transfer snapshots with volumes" 2018-07-20 03:32:53 +00:00
wanghao
a554faa653 Transfer snapshots with volumes
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
2018-07-19 14:02:19 -05:00
TommyLike
2b632c48e3 [Optimize] Update help text for hint argument
Update scheduler_hint's help text to describe
how to specify multiple hints and array value.

Change-Id: If975e06b6e9914848498fa2c3ab27c2f41d7860b
2018-07-17 16:03:02 -05:00
John Griffith
9072700887 Add mode option to attachment-create
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
2018-07-17 15:58:46 -05:00
Zuul
4856c7fc6e Merge "Add the parameter service-id for service cleanup command" 2018-05-28 03:38:58 +00:00
liuyamin
eafde59a3e Add the parameter service-id for service cleanup command
There isn't service_id param in cinderclient. We have this param
in cinder, so add this param in the cinderclient.

Change-Id: I579741595f91802bcf117029889567f234b5b14c
Closes-bug: #1771721
2018-05-25 03:26:58 +00:00
TommyLike
5a1513244c Support availability-zone in volume type
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
2018-05-02 10:25:27 +08:00
Zuul
cd87e5d4b4 Merge "Support cross AZ backups" 2018-03-27 08:10:24 +00:00
jeremy.zhang
0fb448cc6d Add api_version wraps for group snapshot list in v3/shell.py
The API 'do_group_snapshot_list' in v3/shell.py misses api_version wraps,
and the cmd 'cinder group-snapshot-list' can be used even not specifing
the param 'os-volume-api-version'. This patch just to fix it.

Change-Id: I6a46e587b1aab692fe6b81b46fa3d95ab66c0625
2018-03-12 01:26:25 +00:00
Gorka Eguileor
2c774cc015 Support cross AZ backups
Add support for microversion 3.51 that allows us to specify the
Availability Zone of the backup service that should create the backup.

New optional parameter available for "backup-create" when using
microversion 3.51 is "--availability-zone".

Depends-On: I595932276088d25abd464025c99dce33a2cc502b
Change-Id: Ia4bab5fcb95f6a8d1adb99c5d7dc1b3f7546c6f6
2018-02-12 15:03:20 +01:00
Zuul
0a323eaf94 Merge "Support for reporting backend state in service list" 2018-01-18 02:13:59 +00:00
Zuul
d2cf6e6ddc Merge "Add service cleanup command" 2018-01-16 12:26:57 +00:00
Zuul
24e46d116a Merge "Add cluster support in manage listings" 2018-01-16 07:37:17 +00:00
wanghao
1eb2d6c9f6 Support for reporting backend state in service list
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
2018-01-09 09:04:00 +08:00
Zuul
7b34445a3c Merge "Fix the way to get backup metadata" 2017-12-20 02:59:53 +00:00
TommyLike
9bfd6da08d Backup create is not available from 3.0 to 3.42
Backup create command is shielded by patch [1].

[1]: 2255fc99da9752737dcaa96ae4507b646074afb2

Change-Id: I100b8734ee2df4d81e16e2bfdafd81227c20d25e
2017-12-14 11:17:29 +08:00
lihaijing
d59eb3ee05 Fix the way to get backup metadata
In v3/shell.py do_backup_update(), the metadata through
'args.metadata' is a list, like this: 'metadata': [u'k1=v1'].
But we need a metadata dict like this: 'metadata': {"k1": "v1"}.
So call the right method shell_utils.extract_metadata()
to get metadata from args.

Change-Id: I82cb96b1f89b4009d4b3f4a0e64db076a7a04977
2017-12-13 16:53:28 +08:00