Compare commits

...

1276 commits

Author SHA1 Message Date
Andriy Kurilin
0a93733293 Fix quota usage and reservation display
Fix `openstack quota show --usage` to correctly display resource usage
and reservations by applying proper name normalization for corresponding
sections of data.
Previously, name normalization was applied only for "limits" which is
the root section, leaving 'usage' and 'reservation' sections untouched.

Change-Id: Id14fe894b30a74b9b8d78b00c3d4ff151f8b4210
Closes-bug: #2137636
Signed-off-by: Andriy Kurilin <andr.kurilin@gmail.com>
2026-01-07 13:29:49 +01:00
Zuul
d1a0ede7db Merge "zuul: Make openstackclient-check-plugins voting" 2025-12-19 19:38:24 +00:00
Abhishek Kekane
ed2dc692dd Fix image owner change when accepting membership with --project
When using 'openstack image set --project <project> --accept <image>',
the command incorrectly changed the image owner. The --project parameter
when used with membership flags should only identify which member's
status to update, not change ownership.

Closes-Bug: #2136795
Change-Id: I1044b51f38000fb5339740bc40c7f8645c794402
Signed-off-by: Abhishek Kekane <akekane@redhat.com>
2025-12-18 14:01:45 +00:00
Zuul
85fccc7a91 Merge "typing: Fixups for typed osc-lib" 2025-12-16 18:13:51 +00:00
Zuul
08b1bb70dd Merge "taas: Use custom command classes" 2025-12-16 18:13:48 +00:00
Zuul
58210a141a Merge "fix(keystone): correct the args submitted on user creation" 2025-12-15 19:56:34 +00:00
Doug Goldstein
0b05fd8968
fix(keystone): correct the args submitted on user creation
When a user is created without a password then no parameter called
'password' should be submitted to the keystone API. This removes the
incorrect 'password' with null being supplied.

Closes-Bug: 2136148
Change-Id: If1c2eb5db360764a5f7660ce4e5353da85b6d3da
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2025-12-15 10:14:41 -06:00
Stephen Finucane
e8ae075c38 typing: Fixups for typed osc-lib
Change-Id: I436983a13e8812d704af2f1eb3f600277ef8a531
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-15 11:38:36 +00:00
Stephen Finucane
7246a07834 taas: Use custom command classes
In change I53d9058273748ecd4d4eecec5f7291d5f38ce5ab we added custom
Command classes for typing purposes. However, the Tap-as-a-Service code
merged around the same time and was missed. Correct this.

Change-Id: I3a9fe20b5b8eb54708644527538f27396f29b476
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-15 11:27:56 +00:00
Stephen Finucane
8dbb7126c6 identity: Use plural dest for append opts
Change-Id: I73a263a309e022b7606ced43a814a1d1914bc751
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-15 11:25:43 +00:00
Zuul
43ffea5c4d Merge "Remove functional testenv for py38/py39" 2025-12-12 17:59:10 +00:00
Koya Watanabe
f2f0f92d41 Remove functional testenv for py38/py39
Python 3.8 and 3.9 are no longer supported.
Refer to pyproject.toml for the current supported versions.

Change-Id: Ie7f917c26299509050294037cc27e1fd9c20e78b
Signed-off-by: Koya Watanabe <koywatan@lycorp.co.jp>
2025-12-12 14:49:33 +00:00
Stephen Finucane
748cff5914 zuul: Make openstackclient-check-plugins voting
This will ensure we do not forget to ignore a module when migrating
plugins in-tree.

Change-Id: Id4dd657746f7c5f8ebf5ef55964593123303b996
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstackclient/+/970618
2025-12-12 11:39:24 +00:00
Stephen Finucane
841d95b095 common: Remove references to pkg_resources
Even though the comment here attributed this to stevedore, it was in
fact the use of pkg_resources that changed things.

Change-Id: I35377dd7d773024aa6423b72b1412e11b1b6f2e4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-12 10:32:12 +00:00
Stephen Finucane
a7e2f31ecc volume: Remove negotiation for v1 API
Change Ibe1cd6461d2cb78826467078aa17272f171746aa removed support for the
v1 volume API. We should have removed this check at the same time.

We also remove some god-awful monkey patching that references v1
cinderclient but in practice modified all clients.

Change-Id: I3727fd9238df966b3bc59812c5efcf3398da5c72
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-12 10:32:12 +00:00
Zuul
de4e119272 Merge "typing: Add types to custom formatters" 2025-12-11 21:56:06 +00:00
Zuul
30f3192b8d Merge "Add custom command classes" 2025-12-11 21:42:13 +00:00
Zuul
cc36d929b3 Merge "clientmanager: Remove legacy cruft" 2025-12-11 21:32:52 +00:00
Stephen Finucane
e799a4a676 typing: Add types to custom formatters
We make a lot of use of typing.Any just to get this over the line. We
can come back to this later.

Change-Id: I03c18b0b44f210b2ad3e4012344d521fb85cae97
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-11 18:55:15 +00:00
Stephen Finucane
3cd544df53 Add custom command classes
These are effectively identical to the osc-lib variants except they
include the attributes that the OSC shell implementation will set on
this during shell init. This helps from a typing perspective.

Change-Id: I53d9058273748ecd4d4eecec5f7291d5f38ce5ab
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-11 18:55:13 +00:00
Zuul
c59bf71fb7 Merge "Use openstacksdk test generate_fake_resources factory" 2025-12-11 15:50:51 +00:00
Zuul
924822507a Merge "Implement conflict resolution" 2025-12-11 15:50:49 +00:00
Zuul
65801e7e58 Merge "Improve help strings for tap services" 2025-12-11 15:03:09 +00:00
Zuul
f2810a83b0 Merge "Moving tapas osc client code from neutronclient" 2025-12-11 15:03:06 +00:00
Stephen Finucane
3fbe41cd52 clientmanager: Remove legacy cruft
No has used Initialize functions in years, while the _auth_required
attribute has long since been handled by the base class in osc-lib.

Change-Id: I3af9a6d8c339b2170a13346b009392d51e044443
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-11 13:31:26 +00:00
Miro Tomaska
dedc1a342c Use openstacksdk test generate_fake_resources factory
Instead of building fake test objects in the local fakes.py file,
use existing generate_fake_resource(s) factory methods to automatically
populate class attributes. Doing this ensures that fake objects are always
build with actual attributes of the class.

Change-Id: If424b87c79e7dab102cbd8a7938df85411c9465d
Signed-off-by: Miro Tomaska <mtomaska@redhat.com>
2025-12-11 13:28:38 +00:00
Stephen Finucane
060299c749 Implement conflict resolution
Take advantage of functionality recently introduced in cliff to allow us
to prefer commands that are in-tree over those provided via plugin
packages. This will allow us to move the extensions themselves in-tree.

Change-Id: I5dd9bc9743bea779ea1b4a71264c9a77c80033b3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-12-11 13:17:24 +00:00
Takashi Kajinami
92a277ff4c ruff: Enable E5 check
... to enforce maximum line length, to keep consistent code format.

Note that E501 check is disabled in test code now, until we decide how
to update ~50 lines violating the limit due to too long names.

Change-Id: I122c8b9035d6381dafb34438517c26b01e5201f5
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-12-11 02:43:20 +09:00
Miro Tomaska
9e49047ed1 Improve help strings for tap services
This is a follow up patch to feedback from[1]

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/963445/comment/8f9576d4_938391ea/

Change-Id: I1c1ee68b37ef4c87c13d18e773c19b4ca5814ead
Signed-off-by: Miro Tomaska <mtomaska@redhat.com>
2025-12-08 19:00:45 +00:00
Miro Tomaska
97c2238df1 Moving tapas osc client code from neutronclient
Proposal to move all stadium projects from neutronclient
to openstackclient repo. Tap-as-a-service is the first example.
The tapas osc client code was recently moved to neutronclient see
https://review.opendev.org/c/openstack/tap-as-a-service/+/960849
but proposal is to make openstackclient its final destination.

This change also includes automatic lint fixes required in
this repo.

Change-Id: Ied47f40c6947600d40bf675ec06f0bf88fd15f1f
Signed-off-by: Miro Tomaska <mtomaska@redhat.com>
2025-12-08 13:22:12 -05:00
Zuul
f8effe997e Merge "Change metavar name for registered limit delete" 2025-11-26 12:29:54 +00:00
Zuul
79db64f264 Merge "Remove duplicate test utilities" 2025-11-25 14:47:22 +00:00
Stephen Finucane
fb6dad48db Remove duplicate test utilities
We cannot remove them fully, but we can remove a lot of them. Further
cleanup is needed here to remove the references but that will be done
once a version of osc_lib with fixes is included.

Change-Id: Ifd200bd3d3e5c02c239a8ad0e6cee6d823e26544
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-25 12:06:49 +00:00
Luan Utimura
4132ca1818 volume: Add missing backup_id field in tests
This change also reverts commit:
  * 5f1ffe742c

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/958801
Change-Id: Icac78179bc324e6fbe762f8095f2cba490ef6aea
Signed-off-by: Luan Utimura <luan.utimura@luizalabs.com>
2025-11-24 13:50:38 -03:00
0weng
0411805608 Change metavar name for registered limit delete
Change registered limit argument to plural and remove `id` suffix for
`registered limit delete` command. Also, note that service can be
specified by name or ID in help description.

Change-Id: I16950a5ac1a197761592304dcb71dcb09d608d78
Signed-off-by: 0weng <oweng@osuosl.org>
2025-11-19 14:29:31 -08:00
Brian Haley
c17c5f0df6 Try to make help text of network code consistent
Just change all text to be as consistent as possible.

TrivialFix

Change-Id: I959cda9b0688f0fcec0f55ce4c8cadf209d3537f
Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
2025-11-18 19:39:15 -05:00
Zuul
d6b2f42cfb Merge "hacking: Check for missing ignore_missing calls" 2025-11-17 10:58:12 +00:00
Zuul
e9b720e1c7 Merge "trivial: Add missing ignore_missing arguments" 2025-11-17 10:57:14 +00:00
Zuul
0b88ea4fab Merge "identity: Remove duplicated _find_sdk_id method" 2025-11-17 10:28:13 +00:00
Zuul
d7e71480d4 Merge "identity: Fix filtering endpoints by project with domain" 2025-11-17 10:28:11 +00:00
Zuul
351d537cb0 Merge "trivial: Normalize some client usage" 2025-11-17 10:26:43 +00:00
Stephen Finucane
db6c34c2c7 hacking: Check for missing ignore_missing calls
This comes up in reviews frequently. Let's automate it.

Change-Id: Ia7ebd7cf29fe4550b22921e898bebaaa5f7bb4f6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-14 11:54:41 +00:00
Stephen Finucane
73021165ff trivial: Add missing ignore_missing arguments
This prevents a class of bugs.

Change-Id: I96e1cd8ed4a682ef5c95f67f3d1246f7026eada9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-14 11:54:40 +00:00
Stephen Finucane
55fd501657 identity: Remove duplicated _find_sdk_id method
We have a few instances of this. Settle on one.

Change-Id: Id115fea1c59ad75ec8e00d665e587020f7177a55
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-14 11:51:02 +00:00
Stephen Finucane
a5e4d5f0fa identity: Fix filtering endpoints by project with domain
We were incorrectly passing domain_id as a positional argument, causing
it to get picked up as the ignore_missing argument instead. Correct
this, fixing another bug where the look of projects or domains could be
forbidden by policy, in the process. The latter is unlikely to happen,
given endpoint lookup is typically an admin-only operation, but it's
better to be safe.

Change-Id: Idd3300040967d781b7743accd62298cb24c62872
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-14 11:47:18 +00:00
Stephen Finucane
db2c1a5e2b trivial: Normalize some client usage
Ahead of rework in this area.

Change-Id: I1b1c2370967381903970870da8cbe0868b1e23e1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-13 15:20:35 +00:00
Zuul
0e8aa79f9f Merge "Add functional tests for image metadef resource type list" 2025-11-13 15:17:36 +00:00
Zuul
3b6f9ee7ba Merge "Add functional test for cached image command" 2025-11-13 13:34:57 +00:00
Zuul
7505186a41 Merge "ruff: Use more specific name to enable pyupgrade rule" 2025-11-11 20:10:45 +00:00
Takashi Kajinami
188737c69c ruff: Use more specific name to enable pyupgrade rule
UP is the exact name of the rule, instead of U. Use the exact name to
avoid potential problems caused by any UX rules which can be added
in the future.

Change-Id: I5fa59181fcd3e28bf3c87ce2a5e610561b2ee8a8
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-11-12 01:41:37 +09:00
Zuul
1b6df0b5bb Merge "Add new hacking rules" 2025-11-07 18:17:29 +00:00
Zuul
232a0ab68d Merge "tests: Avoid more unnecessary mocks" 2025-11-07 17:18:53 +00:00
Zuul
23f47e0dab Merge "tests: Remove duplicated fake network client" 2025-11-07 17:18:50 +00:00
Stephen Finucane
eb7c4c61a9 Add new hacking rules
To catch some obvious issues.

Change-Id: Ic0ddc95100811e7b313b519aad7d687a1415020b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-07 15:45:51 +00:00
Stephen Finucane
33d34bdfe8 Remove tests for other osc-lib
These are already found in osc-lib itself.

Change-Id: I51114a5a79d6cd6ea46f60284066132b2e54a1a5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-07 14:14:05 +00:00
Stephen Finucane
7116449190 tests: Avoid more unnecessary mocks
Change-Id: I04672d46595e93b19f873a54d5be9363d262370b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-07 14:06:36 +00:00
Stephen Finucane
44dfa157e4 tests: Remove duplicated fake network client
This must have crept in some time after [1] merged.

[1] Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758

Change-Id: Ic0603db8b1a59b7704c51b0e0ffceb7db2e781d3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-11-07 12:43:11 +00:00
OpenStack Release Bot
3cc6b24bb5 reno: Update master for unmaintained/2024.1
Update the 2024.1 release notes configuration to build from
unmaintained/2024.1.

Change-Id: Ia4fff2a8e0f9bb083423c2e5c7339a46aaccd271
Signed-off-by: OpenStack Release Bot <infra-root@openstack.org>
Generated-By: openstack/project-config:roles/copy-release-tools-scripts/files/release-tools/change_reno_branch_to_unmaintained.sh
2025-10-31 12:05:25 +00:00
Zuul
492a184add Merge "Add option to filter for projects when listing volume backups" 2025-10-22 17:51:49 +00:00
Jan Ueberacker
305e037df2 Add option to filter for projects when listing volume backups
Change-Id: Idb07c1be90a98b65b6c1b8f888d0ca5309f8cbc4
Signed-off-by: Jan Ueberacker <jan.ueberacker@inovex.de>
2025-10-22 16:33:09 +02:00
Zuul
b0763f9f9a Merge "Extend project delete command description" 2025-10-14 18:46:12 +00:00
Stephen Finucane
20ad83bf84 pre-commit: Bump versions
We need to rename two hooks.

Change-Id: I15582a23da6ea6babf2b277ff443b7cdb764c9f9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-10-10 10:40:55 +01:00
Zuul
b28b3249de Merge "Fix openstack quota show without cinder" 2025-10-02 13:40:36 +00:00
Zuul
4282a512c0 Merge "identity: Fix 'user list --project' option" 2025-10-02 12:29:02 +00:00
Stephen Finucane
0ed122094a identity: Fix 'user list --project' option
The 'role_assignments_filter' identity proxy method requires either a
user or group, which defeats the entire purpose of the command when used
with this option. Use 'role_assignments' instead.

Change-Id: I8fb705c55fb4e81fa82d4a7dbe4c5bf7e1edd98a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #1616104
2025-10-02 09:58:46 +00:00
Matt Anson
fb8cdd4441 Ensure show on absent appcreds raises exception
Currently, running ``application credential show`` on a
non-existent appcred will exit normally and display a
formatted application credential with no data, despite
the Keystone API returning a 404.

Ensure that querying a non-existent application
credential raises an exception message and an exit-code
1 to the user.

Closes-Bug: #2126565
Change-Id: I597d2d4064f1020c5ac40862ecc556f3c94b53eb
Signed-off-by: Matt Anson <matta@stackhpc.com>
2025-10-01 14:36:17 +01:00
Thomas Goirand
de88853de2 Fix openstack quota show without cinder
Per this Debian bug [1], 'openstack quota show --default' fails when
cinder is NOT installed. This is also true of other services.

[1] https://bugs.debian.org/1109288

Change-Id: I361da44b9f1d09ba3a454632d41e2110a3815395
Signed-off-by: Svein-Erik Skjelbred <svein-erik@skjelbred.com>
Signed-off-by: Thomas Goirand <zigo@debian.org>
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-09-30 10:32:44 +01:00
wonjun0120
4cf70113d2 Add functional test for cached image command
Implements tests for cache clear operations including queue,
cache, and combined clearing functionality.

Change-Id: I71056bb5db6c3de4f9294ac1b661ab927f59c867
Signed-off-by: wonjun0120 <wonjundero@gmail.com>
2025-09-25 23:44:09 +09:00
jiwonjang
6b6a9bafd8 Add functional tests for image metadef resource type list
Implements functional tests for 'image metadef resource type list' command.

Change-Id: If645a04d4b8800da44041769f08b1e81332af33c
Signed-off-by: jiwonjang <kooriangman@gmail.com>
2025-09-25 21:12:10 +09:00
Alexey Stupnikov
c0ada2d6ab Extend project delete command description
"openstack project delete" command doesn't try to figure out if
other services are using specified project somehow before trying
to delete it. This patch extends command description to ensure
that this is clearly communicated to users.

Related-bug: #2118900
Change-Id: I3ae0b2a8f04d4f791cab46ccd89f400549d24ecd
Signed-off-by: Alexey Stupnikov <aleksey.stupnikov@gmail.com>
2025-09-19 19:37:28 +02:00
OpenStack Release Bot
3c3ea30bd3 Update master for stable/2025.2
Add file to the reno documentation build to show release notes for
stable/2025.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2025.2.

Sem-Ver: feature
Change-Id: I6aec2d1f91ed7fc2dba466574b4efb92b4bd7c88
Signed-off-by: OpenStack Release Bot <infra-root@openstack.org>
Generated-By: openstack/project-config:roles/copy-release-tools-scripts/files/release-tools/add_release_note_page.sh
2025-09-16 08:11:27 +00:00
Zuul
8f3277326c Merge "Validation: Cannot create network with segmentation id alone" 2025-09-11 17:49:10 +00:00
dlawton
b808b82dfb Validation: Cannot create network with segmentation id alone
Change-Id: I7d98921fe6f2819a6427bc826d640a6685a00da7
Signed-off-by: Dan lawton <dlawton@redhat.com>
Closes-bug: #1693106
2025-09-11 15:28:51 +00:00
Zuul
afcce59c8d Merge "Add functional tests for role assignment list" 2025-09-10 11:02:58 +00:00
doburn
a5a6ec27e5 Add functional tests for role assignment list
Implements tests for `role assignment list` domain options.

The options covered are:
- `--user-domain`
- `--group-domain`
- `--project-domain`
- `--role-domain`

Change-Id: Ia42dcc337df0de7d5a93250696b807038a2d9d0e
Signed-off-by: doburn <kwon2852@gmail.com>
2025-09-10 16:07:25 +09:00
Zuul
bc98e21559 Merge "tests: Simplify catalog functional tests" 2025-09-09 22:48:09 +00:00
Zuul
475d69efad Merge "Bug Fix: Skip invalid server ID during multi-server delete" 2025-09-08 19:43:25 +00:00
dlawton
3dfeb5ed08 Bug Fix: Skip invalid server ID during multi-server delete
Change-Id: I8e5339f07b43dd0a9422eaf33346bbfdf2c9b328
Signed-off-by: Dan Lawton <dlawton@redhat.com>
Closes-Bug: #2122056
2025-09-08 17:13:47 +01:00
Rajesh Tailor
e7554603ac Fix microversion 2.100
This change fixes missing conditional logic for microversion
2.100 which adds support for showing `scheduler_hints` field
to `openstack server list --long` output.

Change-Id: I2820e02a91deb73850f37dc737dbec79dea99e8d
Signed-off-by: Rajesh Tailor <ratailor@redhat.com>
2025-09-03 16:53:35 +05:30
Stephen Finucane
5f1ffe742c volume: Temporarily ignore Volume.backup_id column
We really need a better way to do this.

Change-Id: I631748e2dfe3c136156d7987eab952370a88d35b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related: https://review.opendev.org/c/openstack/openstacksdk/+/958801
2025-08-29 13:31:58 +01:00
minkyukim
68d1d01b2a tests: Simplify catalog functional tests
Combine multiple test cases into a single test case, in order to
speed up execution.

Change-Id: Idcfd0c8c5b7418046601d222248c0cd16886e079
Signed-off-by: minkyukim <mj110602@gmail.com>
2025-08-24 04:29:44 +09:00
Stephen Finucane
94e447af80 tests: Remove use of namedtuple
Change-Id: I19a272ffd260bab263dd63cb920802b792e192eb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-08-20 17:41:21 +01:00
Rajesh Tailor
dbddbf9760 Fix microversion 2.96
This change fixes missing conditional logic for
microversion 2.96 which adds `pinned_availability_zone`
field to `openstack server list` output.

Change-Id: I1e398bb3379fa6443b0a44db76baaf6241a945e7
Signed-off-by: Rajesh Tailor <ratailor@redhat.com>
2025-08-20 18:19:13 +05:30
Zuul
34f431bade Merge "compute: Fix flavor create --id auto" 2025-08-18 16:59:33 +00:00
Artem Goncharov
a312e9cdad Adopt sdk_fakes for compute.test_flavor
Use sdk_fakes inside test_flavor. The only left fake is for
flavor_access, for which there is no resource in SDK.

Change-Id: I8fcfb734eb45308b80aa1478c2935c9881fee928
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025-08-18 13:57:56 +01:00
Stephen Finucane
5feaa952ad compute: Fix flavor create --id auto
This was inadvertently broken during the switch from novaclient to SDK.
Fix it for now but also deprecate it since it is an unnecessary alias.

Change-Id: Iaf136d82e00defc86e57ae4ea7e848246f2ade2c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2120833
2025-08-18 12:20:44 +01:00
Zuul
d90e18b08c Merge "Support image save with chunk-size option" 2025-08-15 13:37:16 +00:00
Zuul
6ba9473cdb Merge "Adds CLI support for `glance md-namespace-properties-delete`" 2025-08-15 13:37:13 +00:00
Zuul
ae7e8448ba Merge "image: Add hashing-related fields" 2025-08-15 13:18:10 +00:00
Mridula Joshi
2177f07dfb Adds CLI support for `glance md-namespace-properties-delete`
This patch modifies the command to delete all metadef properties
inside a namespace. This operation can be called by `image metadef
property delete`

Change-Id: Iff9bda0dddfa157be0438a66d1d05da7b0b437c3
Signed-off-by: Mridula Joshi <mrjoshi@redhat.com>
2025-08-15 11:16:46 +00:00
Artem Goncharov
a73698490a image: Add hashing-related fields
Add support for the 'os_hash_algo' and 'os_hash_value' image attributes
added with Image API 2.7.

Change-Id: Id8fe6f3fecf77f537587e9088b207ef2077a9def
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025-08-15 12:01:58 +01:00
Hang Yang
13fe801968 Support image save with chunk-size option
Add '--chunk-size' option to 'image save' command to control the size of
bytes to read at one time.

Change-Id: I0a02323384433010b8c6804a4337040acb13da8f
Signed-off-by: Hang Yang <hangyang@verizonmedia.com>
2025-08-15 11:59:30 +01:00
Stephen Finucane
81db99b32b doc: Indicate md-namespace-import as WONTFIX
This is a meta command that can be easily achieved via some shell
scripting. We don't need it in OSC.

Change-Id: Ia3fc8d0458cb0c0dc4695347ef953028112a9c49
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-08-15 11:47:12 +01:00
Zuul
37228ae2d3 Merge "tests: Avoid unnecessary mocks" 2025-08-15 04:48:40 +00:00
Zuul
87fe04ae08 Merge "tests: Simplify mocking in server tests" 2025-08-15 04:48:26 +00:00
Zuul
7bb5857081 Merge "Remap custom named Image attributes when unsetting" 2025-08-15 04:48:23 +00:00
Zuul
a8751b00fe Merge "Add device ID and device owner to port unset" 2025-08-15 03:29:28 +00:00
Zuul
2a492fb58a Merge "Remove leading empty line from server create with --wait" 2025-08-15 03:29:22 +00:00
Zuul
ad2a511434 Merge "Replace deprecated assertItemsEqual" 2025-08-14 13:34:42 +00:00
Zuul
8a88d65a67 Merge "docs: Add note about scoping on tokens" 2025-08-14 11:10:19 +00:00
Stephen Finucane
a99ae364fc tests: Avoid unnecessary mocks
Change-Id: Ibb1bf5c29bf37d3f31889b091a055d0308e8cd85
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-08-14 12:03:16 +01:00
dna
e8a7db5858 tests: Simplify mocking in server tests
Replace assignments of `Mock` objects to methods that are already
mocked in the class functions within test_server.py

Change-Id: I446632301c1b9f94545a0b8314e54e761d5d296f
Signed-off-by: dna <la18byeol@gmail.com>
Story: 2011459
Task: 52211
2025-08-14 12:03:00 +01:00
Mridula Joshi
9f55b253a3 Adds CLI support for `glance md-namespace-objects-delete`
This patch adds operation which delete all metadef object inside a
namespace.
This can be implemented by `image metadef object delete`

Change-Id: Ib196e295aad1921d8bc0c451522e0ad530389134
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/901671
Signed-off-by: Cyril Roelandt <cyril@redhat.com>
2025-08-07 20:25:50 +02:00
Alexey Stupnikov
e37148484c Remap custom named Image attributes when unsetting
Some Image attributes defined in openstacksdk are named differently
from actual properties managed by Glance. Because openstackclient
checked property names to be unset against Image object properties,
it was impossible to unset such properties.

This patch introduces a IMAGE_ATTRIBUTES_CUSTOM_NAMES dictionary
mapping real property names with custom attribute names.

Closes-bug: #2115732
Change-Id: I7296fc293dff9208464c9a07f58ce3e9ffabd3e9
Signed-off-by: Alexey Stupnikov <aleksey.stupnikov@gmail.com>
2025-07-29 18:24:57 +02:00
Alexey Stupnikov
46b25c7c0b network: Add '--project' to SG rule list command
Include '--project' and '--project-domain' filtering options to the
'security group rule list'.

Closes-Bug: #1648317
Change-Id: I19e423906846073cfa1e45b4a295b3a8f5d11970
Signed-off-by: Alexey Stupnikov <aleksey.stupnikov@gmail.com>
2025-07-24 18:06:03 +02:00
Stephen Finucane
c7d465a221 volume: Migrate 'volume show' to SDK
Change-Id: Ibd9d7a62c2500a1f31aa2d3d13ac7e8bad4e6964
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-07-18 11:38:26 +01:00
Stephen Finucane
5e5f12ba40 volume: Migrate 'volume migrate' to SDK
Change-Id: I99af5fce0c2c184e300dfbf5624b91eeed38c94b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-07-18 11:20:42 +01:00
Stephen Finucane
504cbd24e2 volume: Migrate 'volume create' to SDK
We need a shim for consistency group support, which we may eventually
port to SDK but have not yet. Otherwise, this is rather straightforward.

Change-Id: Ic880b7a64cde2148c266d549c4768c669ba3f501
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/943800
2025-07-17 16:41:46 +01:00
Doug Goldstein
51ecb5f984
volume: fix volume service set call
The command line operation could never work due to the incorrect call of
the openstacksdk API. This is updated to make it work and report errors
back to the user.

Closes-Bug: #2116969
Change-Id: I87cc410853c03b00dd1549d67cb1b9a8145bcfaa
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2025-07-16 08:48:45 -05:00
Zuul
ffa37bab12 Merge "Add is_shared to security_groups" 2025-07-15 15:32:51 +00:00
elajkat
1b2dfeacf4 Add is_shared to security_groups
Change-Id: I1ff4aa9c6579699e6b479fdb429668de894cd012
Related-Bug: #1999774
Signed-off-by: elajkat <lajos.katona@est.tech>
2025-07-15 14:27:46 +01:00
Zuul
9d3a956a54 Merge "Add metadata as a filter condition when listing volumes" 2025-07-04 11:51:51 +00:00
ohjiwoo
572eeb6d38 Add metadata as a filter condition when listing volumes
When listing volumes, the API provides metadata as a query parameter, but this feature is not implemented in the client code. So add parameter.

story: 2011487
task: 52446
Change-Id: I4bf66d4e073c86296fa96ee29c2b33d771e18293
Signed-off-by: ohjiwoo <jiwooo.oh@samsung.com>
2025-07-04 09:28:40 +00:00
Takashi Kajinami
b6af7883b7 Replace deprecated assertItemsEqual
It has been provided by testtools to ease migration from python 2, but
was deprecated in 2.7.2[1] and will be removed in 2.8.0[2].

[1] https://github.com/testing-cabal/testtools/commit/e0d56b7ce65ae5b3d
[2] https://github.com/testing-cabal/testtools/commit/f01e86084e6a858d1

Change-Id: I8b68212a88553aff5c3b4182c246b3c0f7365cf6
2025-06-27 23:46:22 +09:00
Stephen Finucane
4ea3deda61 Remove duplicate Python version declarations
ruff can automatically detect this [1] now that it is defined in
pyproject.toml. mypy defaults to the version of Python used to run mypy
[2][3] so we need to keep its configuration around a while longer.

[1] https://docs.astral.sh/ruff/settings/#target-version
[2] https://mypy.readthedocs.io/en/stable/config_file.html#confval-python_version
[3] https://github.com/python/mypy/issues/19349

Change-Id: If5b3e6ff2483d73d5ff54cc28c1558cb9852b464
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-27 09:23:06 +01:00
Stephen Finucane
1b4fe6fac1 Migrate setup configuration to pyproject.toml
Change-Id: If7a6252ce751e875881654965762f6f514a15342
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-06-27 09:22:45 +01:00
Takashi Kajinami
ea85c7aa4d Replace deprecated datetime.utcfromtimestamp
It was deprecated in Python 3.12 in favor of datetime.fromtimestamp[1].

[1] https://docs.python.org/3/library/datetime.html#datetime.datetime.utcfromtimestamp

Change-Id: Ia805157eaecac0c61d4c5f88daa430ec6d69a9d4
2025-06-18 18:15:52 +09:00
psnew14
edb17881d0 Remove leading empty line from server create with --wait
The "openstack server create" with "--wait" args was priting an extra empty line character before the server ID.
This commit removes the extra empty line.

story: 2010947
task: 48984
Change-Id: Ib5ba1c9f23e7655ddfae0e5b644ed167ecd6485e
2025-06-01 22:50:55 +09:00
Zuul
f4c4a7343c Merge "Fix openstack image import --method web-download --uri 'invalid value'" 2025-05-30 17:15:43 +00:00
Zuul
d5e6392454 Merge "identity: Remove unnecessary helper" 2025-05-30 14:37:41 +00:00
djp
9ad18c4967
Fix openstack image import --method web-download --uri 'invalid value'
although python-openstackclient run command(image import) with invalid uri,
but the request succeeds. Fixed it to throw an exception
when requesting with an invalid URI.

unit test added. the test cover --uri 'invalid value'

Task: 52251
Story: 2011468
Closes-Bug: 2111777
Change-Id: I62cd8cdf054b6a5e07d664a543b0923ce5f20f83
2025-05-30 22:47:29 +09:00
Stephen Finucane
2e301857af docs: Add note about scoping on tokens
Change-Id: I4df74eaa1aa82fb8666bc1e6728b55a3e81bc76a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-29 19:13:21 +01:00
Zuul
c923ed5893 Merge "Security-groups: Temporarily ignore is_shared" 2025-05-29 15:59:21 +00:00
elajkat
5f602475cd Security-groups: Temporarily ignore is_shared
[1] introduces is_shared field to SDK security-groups.
Till that is merged and released temporary skip the new field.

[1]: https://review.opendev.org/c/openstack/openstacksdk/+/950305
Related-Bug: #1999774

Change-Id: I71cdf96460bbb21ee61105ef9ccc23170b0b5460
2025-05-29 07:53:58 +00:00
Zuul
a8d2c56337 Merge "bug fix volume group show command." 2025-05-26 16:28:16 +00:00
Zuul
606fd132bc Merge "identity: Normalise output of application credentials commands" 2025-05-26 16:03:37 +00:00
Stephen Finucane
2f03c3ea3c identity: Remove unnecessary helper
Make better use of argparse and eliminate the need for a helper in the
process.

Change-Id: Ibdc9b4bfbb4d532ddb05bce9b49bcf0580cce76d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-26 16:12:28 +01:00
hongp
1c70e264a4 bug fix volume group show command.
There is no "show" function in the "group" class of python-cinderclient. Instead, there is a "get" function, so I fixed it.
0125495f92/cinderclient/v3/groups.py (L134)

Closes-Bug: #2111539
Change-Id: If61d8cf115c9ff04d172d7344565e693774e7a21
2025-05-23 10:08:39 +09:00
Zuul
88b59d8975 Merge "evacuate: respect original SHUTOFF state in --wait completion" 2025-05-21 10:29:33 +00:00
waf
3909e93301 evacuate: respect original SHUTOFF state in --wait completion
When running `openstack server evacuate --wait`, the command would hang
indefinitely if the instance was originally in SHUTOFF state, because
only “ACTIVE” was treated as a successful completion. We now capture
the server’s status before evacuation and dynamically include
“SHUTOFF” in the `success_status` list if the instance was already
shut off. This ensures that a shutoff instance is accepted as a valid
completion without requiring manual intervention.

Unit tests have been added and updated to cover both:
- pre-evacuation ACTIVE → success_status=['active']
- pre-evacuation SHUTOFF → success_status=['active','shutoff']

Closes-Bug: #2103426
Change-Id: I86ad1cd173a144b16fde1dbac87819fab2d7a50a
2025-05-21 16:52:24 +09:00
Zuul
5a565ca1ce Merge "Fix missing 'options' field in 'user show' command" 2025-05-20 18:08:26 +00:00
Chaemin-Lim
9bcb1c5c00 Fix missing 'options' field in 'user show' command
This patch fixes a bug where the 'options' field was missing from
the output of the 'openstack user show' command since v7.0.0.

The issue was caused by the 'options' field not being included in
the column list in the _format_user function. This field is important
as it contains various user settings such as multi-factor authentication
configurations and password policy exemptions.

This patch:
1. Adds 'options' field to the column list in _format_user function
2. Updates all affected unit tests to include this field
3. Uses getattr() to safely handle cases where the options field may be absent

Without this fix, users cannot see important options like multi-factor
authentication settings through the CLI, which could lead to security
configuration issues being overlooked.

Closes-Bug: #2084946
Change-Id: I4319268ad4310e6164eb8e65664d73f9b32cdd78
2025-05-20 23:46:39 +09:00
0weng
a2be1b014e Identity: Migrate 'group' commands to SDK
Change-Id: I5a477426318d77021c0430efa1d1f9a7b1ee2633
2025-05-19 15:39:18 -07:00
Zuul
5fb4559a1f Merge "tests: Simplify mocking in image tests" 2025-05-19 16:25:49 +00:00
Zuul
50dd542519 Merge "network: Allow multiple FIP filter opts" 2025-05-19 16:05:20 +00:00
Zuul
de7762f9b8 Merge "volume: Migrate 'volume delete' to SDK" 2025-05-19 15:54:41 +00:00
Zuul
bea4d834ce Merge "volume: Temporarily ignore new volume columns" 2025-05-19 15:54:38 +00:00
Zuul
47a2596b39 Merge "volume: Split v2, v3 create, delete commands" 2025-05-19 15:54:36 +00:00
Zuul
07909a6a6c Merge "volume: Migrate 'snapshot show', 'snapshot list' to SDK" 2025-05-19 15:47:53 +00:00
Zuul
803c3c6d6a Merge "volume: Migrate 'snapshot set', 'snapshot unset' to SDK" 2025-05-19 15:47:50 +00:00
Zuul
110cd9faae Merge "volume: Migrate 'snapshot create' to SDK" 2025-05-19 15:45:04 +00:00
Zuul
2e0318629d Merge "volume: Migrate 'snapshot delete' to SDK" 2025-05-19 15:45:01 +00:00
Zuul
0e47fc4e45 Merge "volume: Add v3-specific volume snapshot module" 2025-05-19 15:37:26 +00:00
Zuul
5c9c4e3dd7 Merge "tests: Use SDK mocks for SDK-based commands" 2025-05-19 15:15:38 +00:00
Zuul
ff7497689c Merge "volume: Migrate 'backup set', 'backup unset' to SDK" 2025-05-19 15:15:35 +00:00
Zuul
d27ff5a650 Merge "volume: Migrate 'service *' to SDK" 2025-05-19 15:15:32 +00:00
Zuul
82170be8d6 Merge "volume: Add v3-specific volume service module" 2025-05-19 15:15:29 +00:00
Zuul
e3bd9a4c01 Merge "volume: Migrate 'block storage log level *' to SDK" 2025-05-19 15:14:29 +00:00
Zuul
d5238d1dab Merge "Add a column to all_projects tag of server list cmd" 2025-05-19 14:17:25 +00:00
Zuul
5f2145d102 Merge "Add filters to search for enabled/disabled users and projects" 2025-05-19 14:17:22 +00:00
Zuul
51305d06f7 Merge "identity: Migrate 'domain' commands to SDK" 2025-05-19 14:17:19 +00:00
djp
444a1df705 tests: Simplify mocking in image tests
Replace assignment of `Mock` objects to methods that are already mocked
in tests/unit/v1/test_image.py, tests/unit/v2/test_image.py

story: 2011459
task: 52210
Change-Id: I0a4644c27066c26cf0ee0f3613c174f141fe94ed
2025-05-19 13:46:27 +00:00
Stephen Finucane
f1cd38aabf identity: Normalise output of application credentials commands
cliff is now smarter (I9155763eee15e19eab23b48989dfcc19ea2c5d34), so we
can effectively revert change I6b4f1b793dc383856bfdf9a01514381be3cd2bf1.
We bump the dependencies to ensure this.

Change-Id: I2af19043fd66b5be0826a774baeabeac7110a4aa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 14:14:14 +01:00
Stephen Finucane
01c1b1e36f network: Allow multiple FIP filter opts
This is allowed by the neutron API. Allow it in OSC.

Change-Id: I7642ecd686d11c5af9e11cc80896243e853e33f3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 14:07:37 +01:00
Zuul
5e1fc3db05 Merge "Fix incorrect warning with --password-prompt option" 2025-05-19 12:48:49 +00:00
Stephen Finucane
082aca89d6 volume: Migrate 'volume delete' to SDK
Change-Id: Ia7d2bfb14945cb5c185daa820f699a4cfe4a3e7f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:22 +01:00
Stephen Finucane
125133d056 volume: Temporarily ignore new volume columns
Change-Id: I4296766a1576c64eb3927cb0557aef5346b2d6f6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:22 +01:00
Stephen Finucane
03aa172fd0 volume: Split v2, v3 create, delete commands
Change-Id: I42616b9586fede3b775bc0fdbba73df90b555d46
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:21 +01:00
Stephen Finucane
267a29d594 volume: Migrate 'snapshot show', 'snapshot list' to SDK
Change-Id: I40de24012363f496e46c3dddc31a3e2563ccf443
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:20 +01:00
Stephen Finucane
3c6fa42642 volume: Migrate 'snapshot set', 'snapshot unset' to SDK
Change-Id: Id34d460c8c5656bf43f48717b13a002508562e4e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:19 +01:00
Stephen Finucane
e0020aec6a volume: Migrate 'snapshot create' to SDK
Change-Id: I0c2811b8518c41658803a7b2053f0f5d5114ed67
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:18 +01:00
Stephen Finucane
fc42f12eb2 volume: Migrate 'snapshot delete' to SDK
Change-Id: Iba89d521ec17a642c5905b0cff908b5a4a9dafd0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:16 +01:00
Stephen Finucane
e1ff450e34 volume: Add v3-specific volume snapshot module
Change-Id: I23026abbb909c082fbc0fe0c9b2efcc89f4d464a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:15 +01:00
Stephen Finucane
a9b9984973 tests: Use SDK mocks for SDK-based commands
Change-Id: I7e781875d4467ed097196771144e25cee38ce678
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:13 +01:00
Stephen Finucane
8eb1a183fe volume: Migrate 'backup set', 'backup unset' to SDK
Change-Id: Iced346df828faab1ff08a2645ff64f4cfea25cb1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:12 +01:00
Stephen Finucane
b933330d55 volume: Migrate 'service *' to SDK
Change-Id: I81254c6cde8783be371ccdcface5027eb247b1ce
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:10 +01:00
Stephen Finucane
1ee3ef33d7 volume: Add v3-specific volume service module
Ease migration.

Change-Id: Ibcdb157ba1bf370c63320d3a1afcf3c400370624
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:09 +01:00
Stephen Finucane
00f4cf9c17 volume: Migrate 'block storage log level *' to SDK
Change-Id: Ic03f65fee197a85518df448c18a0fd2c11d51993
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 13:20:07 +01:00
xfrnk2
a74850d2c4 Add a column to all_projects tag of server list cmd
Add a Project ID column to the --all-projects tag of server list cmd
Differentiate from the basic command, add a column for Project ID
to facilitate easier identification.
Add test code for the Project ID column of --all-projects tag.

Change-Id: I12af2c91f934e7cd268d21cf76dda78646ed2ff4
2025-05-19 12:38:20 +01:00
Chaemin-Lim
eea369e73c Fix incorrect warning with --password-prompt option
When creating a user with the --password-prompt option, a warning is
incorrectly displayed stating that no password was supplied, even though
a password was entered. This occurs because the code checks parsed_args.password
instead of the password variable that actually stores the prompted password.

This patch fixes the issue by checking the 'password' variable
instead of 'parsed_args.password' in the warning condition. A test
case has been added to verify that no warning is displayed when
using --password-prompt and entering a password.

Closes-Bug: #2091836
Change-Id: Ib3ddc7e400ee7988f605c00db534bccc3617d982
2025-05-19 16:12:06 +09:00
Stephen Finucane
32762bcda6 compute: Fix key used for NIC fixed IP field
Change-Id: If099ac0e2663228681e87e2f4821b746c8113ffc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2106221
2025-05-18 15:12:17 +01:00
Zuul
79de137152 Merge "identity: Add missing user argument" 2025-05-16 02:50:39 +00:00
Zuul
f380d029df Merge "identity: Fix listing of applications credentials by user" 2025-05-16 02:50:36 +00:00
Zuul
efce69b47f Merge "Don't warn about unsupported version with SDK-based commands" 2025-05-15 16:19:20 +00:00
Stephen Finucane
e26b447925 identity: Add missing user argument
Change-Id: Ifd2b32e97d1f5fd426f333da13852a8bb6821f1b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2110765
2025-05-15 16:05:56 +01:00
Stephen Finucane
94d17b8762 identity: Fix listing of applications credentials by user
Change-Id: I71f1c4f338694e2b50e71b6907c415bbb6a768fa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2107354
2025-05-15 15:59:34 +01:00
Zuul
9de5e58bc8 Merge "Bump Python version used for linters to 3.10" 2025-05-09 16:13:11 +00:00
Zuul
05accdde9a Merge "Drop support for Python 3.9" 2025-05-09 16:13:08 +00:00
Stephen Finucane
7c7c066096 Bump Python version used for linters to 3.10
Change-Id: I693516fc2a08218c50d83a3ab121b51254f97958
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-07 17:55:39 +01:00
Stephen Finucane
ce2a253d5a Drop support for Python 3.9
Change-Id: If7d8ce2be7081fdcd609c54a211c91439cddce6b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-07 17:55:31 +01:00
Michael Still
5d730f374b Add support for spice-direct console types.
This patch adds support for Nova microversion 2.99 which exposes the new
spice-direct console type and the pre-existing /os-console-auth-token/ API.

+----------+----------------------------------------------------------+
| Field    | Value                                                    |
+----------+----------------------------------------------------------+
| protocol | spice                                                    |
| type     | spice-direct                                             |
| url      | http://127.0.0.1:13002/nova?token=f78009fb-41ad-...      |
+----------+----------------------------------------------------------+

+----------------------+--------------------------------------+
| Field                | Value                                |
+----------------------+--------------------------------------+
| host                 | 127.0.0.1                            |
| instance_uuid        | f2477018-aa93-...                    |
| internal_access_path | None                                 |
| port                 | 5900                                 |
| tls_port             | 5901                                 |
+----------------------+--------------------------------------+

Change-Id: I2d33646d6ac9b25076d69be76dcef8f5c465cd1b
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/940479
2025-05-07 19:34:17 +10:00
Zuul
a49a290a2b Merge "Update README" 2025-04-17 11:04:23 +00:00
Zuul
871b2a4d80 Merge "Add labels to Dockerfile" 2025-04-17 11:04:21 +00:00
Zuul
6e4c2879d4 Merge "Update the docker image to python3.12" 2025-04-17 11:04:20 +00:00
Zuul
0208a24235 Merge "zuul: Remove osc-upload-image, osc-promote-image jobs" 2025-04-17 09:47:42 +00:00
Stephen Finucane
6cb5d8cd14 Update README
Restructure things to be a little more helpful. Also add a reference to
the Dockerfile we provide and remove an errant header that should have
been removed in change Ife108e6ae191641b56e872e4616a3f4ec78281e8.

Change-Id: I5f562a99ccee7db485b5d40ef4ea6f2e2e362c13
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-17 08:53:35 +00:00
Stephen Finucane
22eecc54f8 Add labels to Dockerfile
Change-Id: Ic2c774c4fea263c7b04d20182e3354d9ae93788b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-17 08:53:27 +00:00
Stephen Finucane
f4e97d9733 Update the docker image to python3.12
Change-Id: I2120ac8d27bcefffa0b414cb74871922ccd2ad80
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-17 08:53:19 +00:00
Stephen Finucane
e4d621d24f zuul: Remove osc-upload-image, osc-promote-image jobs
We are no longer going to publish these images to Dockerhub, given
the recent changes to quotas there coupled with the fact that no one
appears to be using them [1]. The osc-build-image job is retained to
ensure our Dockerfile keeps working.

[1] https://lists.openstack.org/archives/list/openstack-discuss@lists.openstack.org/thread/BE7PPQL4DGNDZ2SIMUVSK67I5NF3TFCX/

Change-Id: I9d2ca8f90b8244a09832da673491312095520968
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-16 17:55:06 +01:00
Stephen Finucane
7d64003196 tests: Stop returning FakeResource in compute tests
This was still being used in places where we have our own API bindings
because SDK does not support the API. Those bindings should be returning
dicts, not FakeResource objects. Correct this, and in doing so fix the
bug this highlights in our cell-down output.

Change-Id: I6647d94fcf5ada8186edbf64c03abd3d8ae7ca56
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-14 16:43:22 +01:00
Stephen Finucane
abed52f106 tests: Remove sdk prefix
It is no longer necessary.

Change-Id: I6bcc14be90be7c93ec4729f241299d55885570fd
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-14 16:27:32 +01:00
Stephen Finucane
2c878ad2b7 tests: Remove dead code
None of these fakes are used anymore. Remove them.

Change-Id: I06721aa77f93b76b189901bbdc13a9825fe2fc3d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-14 16:27:31 +01:00
Stephen Finucane
b0fe724caf tests: Remove use of legacy resource helpers
This allows us to remove get_servers, create_servers, and
create_one_servers.

Change-Id: I31a86b6333fdc3da1b54407f077873511260a5df
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-14 14:10:55 +01:00
Zuul
db4739fc5c Merge "Require confirmation to reset server state." 2025-04-11 13:23:47 +00:00
Sean Mooney
25cd1178b3 Require confirmation to reset server state.
This change updates the server set state command to require confirmation
before it is applied. The same pattern as project clean is used and a
new --auto-approve flag is added to allow skipping the prompt.

Operators often use reset state in cases that are incorrect
this change updates the warning to be more explicit
about when and when not to use it.

Change-Id: Iab14739cf6043ad45ad49edff0580e81d75af2fd
2025-04-11 11:53:14 +01:00
melanie witt
d123be0819 Fix 'openstack keypair list --project <project>'
The --project option of 'openstack keypair list' is supposed to filter
keypairs by a project but has not been working and instead returns
keypairs from all projects.

The reason appears to be because it uses a request for a user list
filtered by project but tenant_id/project_id is not a valid filter for
GET /users.

This fixes the issue by requesting role assignments for the specified
project and then requesting keypairs for users with a role in the
project.

This change depends on a recent openstacksdk bug fix change
Ic552dee83d56278d2b866de0cb365a0c394fe26a which fixed the user_id query
parameter for the compute /os-keypairs APIs. The bug fix was released in
openstacksdk 4.4.0.

Closes-Bug: #2096947

Change-Id: Ibb5757766e3040e58d64388b95678fab9b2b6f23
2025-04-10 17:59:29 -07:00
Zuul
616d6f3a29 Merge "Add support for showing scheduler_hints in server details" 2025-04-10 18:37:26 +00:00
Stephen Finucane
11495e655a Don't warn about unsupported version with SDK-based commands
This doesn't make sense: SDK (and the server) will handle this for us.

Change-Id: I31b84e09eca0dc2bc5316d6727620346ae519512
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2106760
2025-04-10 18:21:17 +01:00
Rajesh Tailor
c66abfc76f Workaround for failing tests on openstacksdk change
The 'show-instance-action-finish-time' blueprint [1] adds support for
showing 'finish_time' for InstanceAction object.

This change adds 'finish_time' as hidden column, so it doesn't fail
tests.

We need to remove this from hidden_column list, once all the changes
related to blueprint are merged and show the field only if microversion
is >= 2.101

This is a workaround for failing tests on patch [2], as per suggestion
from Stephen.

[1] https://blueprints.launchpad.net/openstack/?searchtext=show-instance-action-finish-time
[2] https://review.opendev.org/c/openstack/openstacksdk/+/930562

Implements: blueprint show-instance-action-finish-time
Change-Id: Ib9294a603daed0fdb936be128dfba254b9108799
2025-04-09 12:23:38 +05:30
Douglas Viroel
c68622402e Add support for showing scheduler_hints in server details
Adds support for a new compute microversion that returns the
associated scheduler_hints in ``GET /servers/{server_id}``,
``GET /servers/detail``, ``PUT /servers/{server_id}`` and
``POST /server/{server_id}/action`` (rebuild) responses.

Change-Id: Ia5a4e0047b5123f2fb063cfc9ab1f58b2844308f
2025-04-08 19:27:29 +00:00
Zuul
7ecdb69f08 Merge "Refactor network fakes to sdk properties PART6" 2025-04-08 18:40:06 +00:00
Zuul
0874e2d33f Merge "Refactor network fakes to sdk properties PART 5" 2025-04-08 17:37:57 +00:00
Stephen Finucane
d96c81ff7f Refactor network fakes to sdk properties PART6
Included resources:
router
security_group
security_group_rule

Change-Id: I2423fc31d94f85aeefc7b0a205dfb38829417a29
2025-04-08 16:36:48 +00:00
Stephen Finucane
f870548c7f Refactor network fakes to sdk properties PART 5
Included resources:
qos_policy
qos_rule
qos_rule_type

Note: Parameters in unittests was modified
for compatibility with sdk

Change-Id: Iaa902d64ff1b29a07c28ed2100d437da506be475
2025-04-07 15:53:30 +01:00
Stephen Finucane
80eaa33ffe volume: Make better use of argparse
The latest in a series.

Change-Id: I8273c817e38120ba0b25aebdbfa1c2872222765e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-04 18:11:27 +01:00
Stephen Finucane
181bb194c7 image: Migrate 'create image' volume calls to SDK
Change-Id: Ie57a5c17a6df5a333abd6b11e28b65833740e102
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-04 18:11:27 +01:00
Zuul
30aa27b7f9 Merge "tests: Rename 'compute_sdk_client' -> 'compute_client'" 2025-04-03 18:09:11 +00:00
Zuul
dd8e4740ec Merge "compute: Migrate to 'compute' client alias" 2025-04-03 18:08:17 +00:00
Zuul
1e8d243986 Merge "Fix: extend in-use volumes check" 2025-04-03 16:40:17 +00:00
Stephen Finucane
dc68be6b7b tests: Rename 'compute_sdk_client' -> 'compute_client'
Resolve a TODO. Achieved using:

  sed -i 's/self.compute_sdk_client/self.compute_client/' \
    $(ag -w self.compute_sdk_client -l)

Change-Id: I76798058b9dee9fc7ef01ff8656543fbb1266d43
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-03 16:39:04 +01:00
Stephen Finucane
dae2539490 compute: Migrate to 'compute' client alias
This is no longer assigned to novaclient, meaning we can use it for SDK.

Change-Id: I43d9ede39d36cc29301f94fa462b9b9d9441807c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-03 16:39:03 +01:00
Zuul
54a5d2f40c Merge "Remove use of formatter function" 2025-04-02 14:40:12 +00:00
Zuul
01f9279dbf Merge "Imported Translations from Zanata" 2025-04-02 12:57:43 +00:00
Stephen Finucane
ac1ad1c4e4 Remove use of formatter function
We also update tests to use proper SDK fakes so we actually test this.

Change-Id: Ib98348cab613b7139f0faa0b5df90ff44353974f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-02 12:39:26 +01:00
Zuul
2148a86fc5 Merge "Remove use of formatter function" 2025-04-02 10:19:34 +00:00
OpenStack Proposal Bot
0554ff60b4 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I2493ee06a6d47791be683577f0a9b2c63199a67c
2025-04-02 03:07:33 +00:00
Zuul
ade7da8797 Merge "Prepare for osc-lib changes" 2025-04-01 17:57:57 +00:00
Zuul
4ba21fd6f4 Merge "pre-commit: Enable mypy" 2025-04-01 16:25:53 +00:00
Stephen Finucane
d95e23d92b Remove use of formatter function
Change-Id: I9ef88a4d69ffc3eaae183c77445ac10358d86337
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 16:42:13 +01:00
Zuul
8e95c0ed31 Merge "typing: Indicate another tuple to be extended" 2025-04-01 14:49:36 +00:00
Zuul
425e430c31 Merge "docs: Remove irrelevant TODO" 2025-04-01 14:01:24 +00:00
Zuul
1f25a2f935 Merge "volume: Remove Cinder v1 support" 2025-04-01 14:01:22 +00:00
Zuul
438878a3ed Merge "docs: Migrate remaining block storage commands to autocommand" 2025-04-01 12:44:07 +00:00
Zuul
c0521743ba Merge "Remove contributor specs" 2025-04-01 12:44:05 +00:00
Stephen Finucane
dc8596fe74 Prepare for osc-lib changes
Change-Id: I665cd61272f881dce2d387da6035a2f35c866add
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 13:39:50 +01:00
Stephen Finucane
ec4fd81c11 pre-commit: Enable mypy
To ease migration of various commands from OSC to SDK.

Change-Id: I4645237e8808239e4d605f7f45138449c9439949
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 13:14:47 +01:00
Stephen Finucane
62c8b8217e typing: Indicate another tuple to be extended
One has been introduced since Ie5907de8d60f2f39e98f6a88227cebb2e2ff565c
merged.

Change-Id: I37f7bf58a2cbecb69b370e832e56daa310cea3b6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 13:14:47 +01:00
Zuul
c9e4e5404f Merge "Permit use of tuple API_VERSIONS" 2025-04-01 12:02:24 +00:00
Zuul
77143f9bed Merge "typing: Resolve incompatible operand issues" 2025-04-01 11:50:55 +00:00
Zuul
28bd00a642 Merge "typing: Correct type for missing attributes" 2025-04-01 11:50:53 +00:00
Zuul
e6ae7d8533 Merge "typing: Remove use of optional imports" 2025-04-01 11:50:51 +00:00
Zuul
93da5f7af5 Merge "typing: Use consistent types" 2025-04-01 11:50:49 +00:00
Zuul
6e89f9da63 Merge "identity: Migrate 'endpoint' commands to SDK" 2025-04-01 10:55:58 +00:00
Zuul
514a46ee5d Merge "Remove tags from README" 2025-04-01 10:48:12 +00:00
Zuul
cf25526e94 Merge "Return the `port` column headers expected in the list command" 2025-04-01 10:48:10 +00:00
Stephen Finucane
662405e55c docs: Remove irrelevant TODO
cue is a dead project.

Change-Id: Ie860312a9ea481741bf5e7ab29610f621daba702
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 10:46:06 +01:00
Stephen Finucane
e6be9a3edf volume: Remove Cinder v1 support
The Cinder v1 API was removed in Queens [1]. Its replacement, the v2
API, has existed since Grizzly [2]. More importantly, the v1 commands
are implemented using python-cinderclient but support for the v1 API was
removed from python-cinderclient in Train [3], meaning none of these
have worked since then. Clearly if no one has noticed or cared in the 6
years or so since that happened, it's safe to say we can delete these
commands.

[1] 3e91de956e
[2] 75ca60f619
[3] 2189e5702b

Change-Id: Ibe1cd6461d2cb78826467078aa17272f171746aa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 10:46:03 +01:00
Stephen Finucane
3eb063d4f7 docs: Migrate remaining block storage commands to autocommand
Change-Id: I6924f7053e14e843420deea1a023201fad7d4999
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 10:45:32 +01:00
Stephen Finucane
0b9c998d8a Remove contributor specs
There is only one and it was never implemented. Remove the directory.

Change-Id: Ibfffe7936556a626b407deca0e8de17b45db5313
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 10:45:32 +01:00
Stephen Finucane
b2eccdcb1a Permit use of tuple API_VERSIONS
The values of these dictionaries are not used when SDK is in use,
which should soon account for all use cases. Eventually we should
probably look for plugins to return a proper class or typeddict but
that's a job for another day.

This began as a fix for in openstackclient/object/client.py which
referenced a non-existent class and quickly snowballed.

Change-Id: I7b807ec3a97124b35828ffdecbb36f6fde11e7b5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 10:36:02 +01:00
Antonia Gaete
7750fc1cf4 identity: Migrate 'endpoint' commands to SDK
Change-Id: I71b5ae8a4bbcb2fdebf894d8bd5cc8322c31bdb5
Depends-On: I599ff3e88d4e1e9ffafc638bb74186f2739b5a77
Depends-On: I9aa39810fe94f7ee9b68d34050f4adb9dbdfccb8
2025-03-31 16:58:27 -07:00
Stephen Finucane
9de592ebaf typing: Resolve incompatible operand issues
Change-Id: I7f3dd908053b9ace5206d0a1bd3b8258fd0264ef
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:52:16 +01:00
Stephen Finucane
e28046cc19 typing: Correct type for missing attributes
Change-Id: I55652220ecd663fa024937646dfef92595e1cd0f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:52:16 +01:00
Stephen Finucane
9435ef825a typing: Remove use of optional imports
Do them inline instead.

Change-Id: Icab1a0452249efc79f214c4d7b369d02291e94b4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:48:36 +01:00
Stephen Finucane
2c0a3ba137 typing: Use consistent types
Resolve 'Incompatible types in assignment' errors.

Change-Id: I1ea186ff766e0f72cac384fab22d1c2f82e02ef0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:48:36 +01:00
Stephen Finucane
7380fbe300 typing: Add types for empty dicts, tuples
In some cases, simply remove them.

Change-Id: I24a311a24eb533325dda83005777bcb2e0afc320
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:48:36 +01:00
Stephen Finucane
bdd55d989d typing: Indicate tuples to be extended
Change-Id: Ie5907de8d60f2f39e98f6a88227cebb2e2ff565c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:48:36 +01:00
Stephen Finucane
9c7a5d4e51 pre-commit: Bump versions
Apply manual changes required by ruff. Automatic changes were done
separately.

Change-Id: I7db65bd2ac3f31b0479699946398752d8d729338
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:48:31 +01:00
Zuul
ab2e68f407 Merge "Prepare for ruff bump" 2025-03-31 10:37:30 +00:00
Zuul
5918b6b478 Merge "[Neutron] Add "qos-policy" parameter to router creation command" 2025-03-28 19:27:30 +00:00
Brian Haley
107c6b143f Fix neutron typos and formatting
Just trying to make things consistent in the neutron files.

TrivialFix

Change-Id: I9c0ac838f5a956f55161e1636472cca761b14781
2025-03-26 20:02:25 -04:00
Rodolfo Alonso Hernandez
4dbfc47552 Return the `port` column headers expected in the list command
In [1], it was added the ability to print in the "port list" command
any field not defined in the hardcoded column set for this command.

But in [2], it was added a filter list in the API call in order to
reduce the CLI execution time. The unintentional drawback of this
optimization was that is no longer possible to print any field outside
the "port list" column set.

Because the optimization if preferred and it is always possible to use
"port show" to see all the port fields, the code added in [1] is
removed.

[1]https://review.opendev.org/c/openstack/python-openstackclient/+/522901
[2]https://review.opendev.org/c/openstack/python-openstackclient/+/754117

Closes-Bug: #2098980
Related-Bug: #1707848
Related-Bug: #1897100
Change-Id: Ia944b8e108c454219d642cfa595ffafdf060a57f
2025-03-26 15:57:12 +00:00
Jan Ueberacker
3483117259 Add filters to search for enabled/disabled users and projects
Change-Id: Ie7d84f9e0158018083af2156d02dc86fefd79256
Signed-off-by: Jan Ueberacker <jan.ueberacker@inovex.de>
2025-03-26 14:41:50 +01:00
Rodolfo Alonso Hernandez
07515cd160 [Neutron] Add "qos-policy" parameter to router creation command
This patch adds the parameter "qos-policy" to the router creation
command.

Closes-Bug: #2103774
Change-Id: I742b3273c5e9d3ec16e8018beddc8cdace8a57c6
2025-03-26 07:46:40 +00:00
Zuul
866009211f Merge "Fix networking quota usage show" 2025-03-25 13:13:29 +00:00
Slawek Kaplonski
6d27b2f2b6 Fix networking quota usage show
Quotas details returned from the Neutron service are in different format
then quota details returned from Nova and Cinder services. This patch
fixes helper function to convert data from Neutron to the same
format as data from Nova and Cinder is given.

Closes-Bug: #2102513
Change-Id: I18649f6c2ee179b64b7e605f4ea07d4b0c7a1635
2025-03-25 09:52:39 +01:00
Alfredo Moralejo
2e5a830276 Replace description-content-type by its underscore name
Since v78.0.0, setuptools no longer accepts options containing
uppercase or dash characters in setup.cfg [1].

[1] https://github.com/pypa/setuptools/blob/main/NEWS.rst#v7800

Closes-Bug: #2104030

Change-Id: Id88b9c73a4cd9511750f38da9393dae3adbc5c1e
2025-03-24 17:03:44 +01:00
Zuul
b01c138e9e Merge "Specifying project-domain for project" 2025-03-24 13:04:53 +00:00
Dmitriy Chubinidze
2883f3fb95 Specifying project-domain for project
The fix ensures that if a user wants to set a default project,
they must also provide the project domain. If it's missing,
an explicit error message is shown, making it clear that the
project domain is required.

Also adding some unit tests by modifying respective calls.

Change-Id: Ia6e921a53da55ab1bce85a42c8160872a9d47d64
Closes-Bug: #2102146
2025-03-23 09:38:24 +00:00
Zuul
f28f97f23f Merge "zuul: Make image job non-voting" 2025-03-21 17:16:02 +00:00
Zuul
9366405806 Merge "Update master for stable/2025.1" 2025-03-21 15:18:38 +00:00
Stephen Finucane
7ef588d695 zuul: Make image job non-voting
We may need to remove this soon enough, given the new Docker rate limits
that we keep bumping into.

Change-Id: Id4a9d8df770d107986b20e4a98835ee4e0b6117d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-21 15:03:44 +00:00
Zuul
71dbac498e Merge "Fix missing space in help messages" 2025-03-19 13:11:46 +00:00
Zuul
669a50be55 Merge "Update README for use python3" 2025-03-19 13:06:39 +00:00
Zuul
1763c11963 Merge "Fix image import --disallow-failure flag" 2025-03-19 13:06:38 +00:00
Stephen Finucane
49708f6d3f Remove tags from README
The tags framework has been discontinued [1].

[1] https://governance.openstack.org/tc/reference/tags/index.html

Change-Id: Ife108e6ae191641b56e872e4616a3f4ec78281e8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-19 12:33:52 +00:00
Stephen Finucane
290bc580e6 Prepare for ruff bump
Change-Id: Ia9c402edebc8537d5019d18920b6679b05ea4378
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-19 12:04:39 +00:00
OpenStack Release Bot
f2df31387b Update master for stable/2025.1
Add file to the reno documentation build to show release notes for
stable/2025.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2025.1.

Sem-Ver: feature
Change-Id: I2789e8605f5e9bae63382ca9e822bbc3e2241f36
2025-03-18 09:01:53 +00:00
Ghanshyam Mann
702a37c7ca Add libpcre3-dev in bindep.txt for pcre.h
Doc job is going to run on Ubuntu Noble[1]
and we need libpcre3-dev package for pcre.h

[1] https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/935459

Change-Id: I0fe73c02b093805d8eb1b15303f92633fad809cb
2025-03-17 09:23:09 -07:00
Pavlo Shchelokovskyy
1efca54465 Fix image import --disallow-failure flag
the flag should store False to 'allow_failure', not True.

Also, make the --allow-failure and --disallow-failure flags
mutually exclusive.

Change-Id: I03699e14d4d69d9f08caab647293732fc211dbad
2025-03-14 10:52:39 +00:00
Tobias Urdin
f1bd417861 Add device ID and device owner to port unset
This adds support to unset the device_id and
device_owner property on a port.

Change-Id: I43b1ea63e3a119f57162948e128a85f8ba323d41
2025-03-12 19:39:03 +00:00
Vladimir Kozhukalov
1458330d3b identity: Fix 'trust' commands to work with SDK
Closes-Bug: #2102039
Change-Id: I632937e06683cc76e78390a4e6f3de4e3c4f1f87
2025-03-11 12:31:09 -05:00
Rajesh Tailor
f65e4835d3 Fix missing space in help messages
This change fixes missing space in help messages to make those
consistent and pretty rendering when calling help.

Change-Id: I947374821a4dbb5e68651c0e72fc5fd2f938e6a1
2025-03-05 19:58:27 +05:30
Zuul
966aede8ab Merge "Add four new network agent types to the list command filter" 2025-02-28 01:43:25 +00:00
Zuul
4b7e32ca37 Merge "handle 'router create --flavor' option" 2025-02-25 22:48:45 +00:00
Tim Burke
1979c20ff0 Fix credential creation
openstacksdk's Credential expects user_id and project_id, not user and
project. Previously, we would send payloads like

   {'type': 'ec2', 'blob': '{"access": "s3-user1", "secret": "s3-secret1"}'}

which Keystone would reject with

   'user_id' is a required property

Change-Id: I0544bef7df9247395f0726ea075112d6ac992252
2025-02-25 10:30:22 -08:00
Rodolfo Alonso Hernandez
762a3b10d1 Add four new network agent types to the list command filter
Added four new network agent types to the list method filter:
* ``ovn-controller``
* ``ovn-controller-gateway``
* ``ovn-metadata``
* ``ovn-agent``

These agents are represented in the OVN network agent classes defined
in [1]. The OVN agent names are defined in [2].

[1]86f94de99a/neutron/plugins/ml2/drivers/ovn/agent/neutron_agent.py
[2]86f94de99a/neutron/common/ovn/constants.py (L91-L94)

Closes-Bug: #2097124
Change-Id: I117be7e60f67fdd94677cbaa65a3aff01e57bb5e
2025-02-24 10:58:48 +00:00
Zuul
d22b7732ad Merge "[Neutron] Support `uplink-status-propagation-updatable` extension" 2025-02-24 09:05:05 +00:00
Zuul
12e264adc6 Merge "[Neutron] "uplink-status-propagation" enabled by default" 2025-02-24 08:53:02 +00:00
Rodolfo Alonso Hernandez
0ba77e6727 [Neutron] Fix the "port show" command for trunk details
In [1], the "port list --long" command received a new column, showing
the trunk subports related to a parent port. The problem of this patch
is that the ``_formatters`` definition, that is shared with the "port
show" command too, is changed. The "trunk_details" information presented
in both commands differ:
* In the "port list" command, only the subports are presented, in order
  to print a list of dictionaries without showing the ``trunk_id``.
* In the "port show" command, it is presented all the trunk information,
  including the ``trunk_id``.

This patch includes functional tests to validate the fix.

[1]https://review.opendev.org/c/openstack/python-openstackclient/+/926611

Closes-Bug: #2098950
Change-Id: Ib1107fb3dbb025b39a7c55f90f5fe51ae433a72f
2025-02-20 01:07:39 +00:00
Rodolfo Alonso Hernandez
426abbdc68 [Neutron] Support `uplink-status-propagation-updatable` extension
Added ``--enable-uplink-status-propagation`` option and
``--disable-uplink-status-propagation`` option to ``port update``
command.

Now the Neutron extension "uplink-status-propagation-updatable" allows
to update the related value in a port. That was implemented in the
following patches (during 2025.1 Epoxy release):
* https://review.opendev.org/c/openstack/neutron-lib/+/927820
* https://review.opendev.org/c/openstack/neutron-lib/+/936234
* https://review.opendev.org/c/openstack/neutron/+/931641

Related-Bug: #1722720
Change-Id: I99cdcf21438d6d85092c995b50cb10b26ae7c059
2025-02-18 12:09:37 +00:00
Doug Goldstein
1f407afe1c
handle 'router create --flavor' option
The '--flavor' option appears in the usage and arglist but is not
actually parsed. The '--flavor-id' option is what is silently parsed.
Since the goal is to allow the name or the id, this adds the '--flavor'
option to being parsed.

Closes-Bug: 2091731
Change-Id: Id83facd3825f472e7d864427699bd072d1c08779
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
2025-02-15 14:04:28 -06:00
Rodolfo Alonso Hernandez
b50ac8d2a2 [Neutron] "uplink-status-propagation" enabled by default
Since [1][2], the port flag "uplink-status-propagation" is enabled
by default.

[1]https://review.opendev.org/c/openstack/neutron-lib/+/744208
[2]https://review.opendev.org/c/openstack/neutron/+/744210

Related-Bug: #1888487
Change-Id: I522707b36c73b3c5bfe0d644bd07774918660b68
2025-02-14 14:13:26 +00:00
Slawek Kaplonski
3412147372 Add "qinq-vlan" and "no-qinq-vlan" params to the "network create" cmd
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/939703

Related-Bug: #1915151
Change-Id: Icacf83c20c3650a9d75f665f020b8818e1b4a585
2025-02-13 10:10:42 +01:00
Slawek Kaplonski
e761ef8e32 Temporary ignore "is_vlan_qinq" column in the output
We need such temporary workaround until [1] in SDK will be merged, as
without that change here py{39,312}-tips jobs are failing on that SDK
patch.

[1] https://review.opendev.org/c/openstack/openstacksdk/+/939703

Related-bug: #1915151
Change-Id: Id39a6482de54fe78e26fa33c9252253886cf1f3d
2025-02-12 16:40:37 +01:00
Zuul
0c2dee5e1f Merge "Identity: Deprecate --region None in limits/registered limits" 2025-02-12 00:22:23 +00:00
Zuul
e27fd93226 Merge "Identity: Migrate 'role' commands to SDK" 2025-02-11 18:10:57 +00:00
Zuul
5de803b39f Merge "Show final image state after image create" 2025-02-10 11:57:11 +00:00
ArtofBugs
060d706bf4 Identity: Deprecate --region None in limits/registered limits
Change-Id: I37afac1185595216e868202c861d3de719b32073
2025-01-28 17:19:05 +00:00
Ivan Anfimov
3de1ac66e0 Update README for use python3
And small change for `long_description_content_type` missing.

Change-Id: I042a319bfc5009ce625565effa7ccf634222be28
2025-01-26 11:27:13 +00:00
Fernando Royo
d2d7219231 Get "security_groups" when port list
Neutron API is accepting 'security_groups' field  in
order to return the list of security_groups attached
to a port, but openstackclient is parsing the output
over a Openstack Port object that has security_group_ids
to map. This patch sends to the Neutron API the expected
field value and replace the output key to allow the
mapping just in case '--long' argument is passed.

Closes-Bug: #2095414
Change-Id: I188edc3c620ce29d7b16497ca24fd7d972a06618
2025-01-21 18:51:32 +00:00
Zuul
146a1814b6 Merge "Add the trunk subports information to the port list command" 2025-01-18 12:01:38 +00:00
Pavlo Shchelokovskyy
4f95e0aa18 Show final image state after image create
creating the image is a 2step process, first an 'empty' image is created
and then the data is uploaded.
Currently the output of the 'image create' command is that 'empty'
image, in `queued` status etc.
A more user friendly approach would be to make a second refresh call
to show the user image as it is after data was uploaded.

Change-Id: I2f78b113dcc3c941f8cf8dd9b63262971a780a39
2025-01-16 15:35:43 +00:00
ArtofBugs
8f1382eda3 Identity: Migrate 'role' commands to SDK
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/929578
Change-Id: I22254604705080095ac852a1e03506b1552a1fd2
2025-01-13 21:55:10 +00:00
Zuul
eb0dbd5c33 Merge "Fix: Volume backup restore output" 2025-01-07 18:35:53 +00:00
Zuul
6ce1f7730c Merge "identity: Migrate 'trust' commands to SDK" 2024-12-19 21:33:28 +00:00
Rodolfo Alonso Hernandez
2a0431e825 Add the trunk subports information to the port list command
Added the subports information to the port list command, when the
"--long" qualifier is specified.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/926609

Closes-Bug: #2074187
Change-Id: I8ef66c3415279caf0ebea4ba6232ca3696188de9
2024-12-18 15:04:54 +01:00
Zuul
a631014551 Merge "Fix volume backup show by name" 2024-12-17 19:09:39 +00:00
Zuul
4e8be5aa64 Merge "tests: Stop setting attributes on class" 2024-12-17 18:47:00 +00:00
Rajat Dhasmana
03e2fdd162 Fix: Volume backup restore output
Currently the volume backup restore command returns with error
even though the restore is initiated.
This patch corrects the response received from SDK and processes
it in a human readable form.

Change-Id: I7f020631fbb39ceef8740775fd82686d90a6c703
Closes-Bug: #2063335
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/931755
2024-12-17 17:46:35 +00:00
Zuul
c74af3f01e Merge "identity: Migrate 'credential' commands to SDK" 2024-12-16 20:45:20 +00:00
Zuul
fd232a43bc Merge "identity: Migrate 'service provider' commands to SDK" 2024-12-16 19:52:03 +00:00
Antonia Gaete
769bf87d0a identity: Migrate 'trust' commands to SDK
Change-Id: Idb1fda3428ccf3022ee03c8fb7e42c7121683181
2024-12-16 18:24:10 +00:00
Stephen Finucane
38407c6a78 tests: Stop setting attributes on class
For some reason we were setting a property mock on the FakeClientManager
class. In multiple places, no less. This has a nasty habit of causing
side-effects in other tests, depending on the order that tests run in.
Resolve this simply setting the attribute as we'd expect.

Change-Id: I8bf9055e3f5b885dd5a7a6d751b774934da4a7d7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-12-16 18:23:09 +00:00
Zuul
db3d4c98f2 Merge "requirements: Remove unused test deps" 2024-12-16 18:07:15 +00:00
Stephen Finucane
32bd5d3562 Adopt sdk_fakes for compute.test_server_volume
Change-Id: I5a82ff970ebb3622e6920cdb240a3c1dbc96e27d
2024-12-12 11:19:27 +00:00
Artem Goncharov
4cef5f5549 Adopt sdk_fakes for compute.test_server_group
Change-Id: I1c97a7b2e28233a3b345a81b62c01e74a0aec914
2024-12-12 11:19:20 +00:00
Stephen Finucane
38029c6988 Adopt sdk_fakes for compute.test_hypervisor
Change-Id: Ibed4390be61c98f8c9e348835493bc714f8b9e87
2024-12-12 11:19:02 +00:00
Artem Goncharov
776b7d0c66 Adopt sdk_fakes for compute.test_usage
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/882682
Change-Id: Ia8fd2ccfd1e86749fdeeb49c2d57de64635cbb82
2024-12-12 11:18:56 +00:00
Stephen Finucane
afc0d3c252 Adopt sdk_fakes for compute.test_service
Change-Id: I331283f42914b91bd80dfca354635214fb7ba8a7
2024-12-12 11:18:49 +00:00
Artem Goncharov
42b1698e5c Adopt sdk_fakes for compute.test_keypair
Change-Id: Ifb5df852a9ae6eea3fabce13d450b16cb8348315
2024-12-12 11:18:42 +00:00
Artem Goncharov
d175dea6bc Adopt sdk_fakes for compute.test_console
Change-Id: I6181009a8b2ae7e632214364527ccc6fdd03fff9
2024-12-12 11:18:34 +00:00
Stephen Finucane
329b351cb8 Adopt sdk_fakes for compute.aggregate
Drop fakes generation for compute aggregates in favor of sdk_fakes

Change-Id: I4965a5fe8fc3d70390ca0268716519b617ca24eb
2024-12-12 10:43:24 +00:00
Antonia Gaete
56baf50655 identity: Migrate 'service provider' commands to SDK
Change-Id: I7f5fba408b7c350bb0a279f8dd17bd7bae451774
2024-12-11 22:37:44 +00:00
Zuul
52b2944b78 Merge "identity: Migrate region commands to SDK" 2024-12-10 18:32:38 +00:00
Zuul
90148ffc45 Merge "quota: Catch correct exception type for Compute quotas" 2024-12-10 18:32:36 +00:00
Zuul
6579daeac7 Merge "tests: Add functional test for adding, removing SGs" 2024-12-10 14:03:51 +00:00
Zuul
83de58fa33 Merge "compute: Workaround bug #2089821" 2024-12-10 14:03:49 +00:00
Stephen Finucane
99cef9354b quota: Catch correct exception type for Compute quotas
There is a flaw (IMO) in the design of Nova's os-quota-sets API: despite
project IDs forming the identifier for an individual resource, we get a
HTTP 400 (Bad Request) error if you pass an ID that does not exist,
rather than the HTTP 404 (Not Found) we would expect.

Correct this, noting why we're doing what we're doing for readers from
the future (hi!). Note that HTTP 400 is unfortunately quite broad and
means we'll also catch things like invalid requests but the exception
may have been translated so we can't rely on a string match.

Change-Id: I720502930d50be8ead5f2033d9dbcab5d99a37a9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2091086
2024-12-09 15:49:40 +00:00
Stephen Finucane
e736394d1b tests: Add functional test for adding, removing SGs
The fix is in openstacksdk. Let's test it here though.

Change-Id: I661e6d66c8196e8c9ca8b9cda3d08e756e3d5877
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/936947
Related-bug: #2089821
2024-12-09 13:56:58 +00:00
Stephen Finucane
22b30b99ce compute: Workaround bug #2089821
By passing a dict instead of a single value, we force SDK to populate
the correct attribute on the object.

Change-Id: I9f4c5964dc0546215474c92db567966ffad68a1a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related-bug: #2089821
2024-12-09 13:56:58 +00:00
Rajat Dhasmana
03933e9a73 Fix: extend in-use volumes check
Currently we have 2 issues with extending volumes checks:

1. We don't specify explicitly that MV 3.42 needs to be passed for
in-use volumes
2. Any state of volume (error, attaching, detaching etc) can pass
this check by specifying MV 3.42

The fundamentally correct approach to these checks should be:

1. Only allow 'available' and 'in-use' volumes to be extended
2. Check MV 3.42 or greater is specified in case of 'in-use' volumes
otherwise fail

This approach is implemented in the patch.

Change-Id: I45ab9af953f7d060379f48ca429eaea7cfe857cc
2024-12-09 19:01:22 +05:30
Stephen Finucane
c888cf2556 network: Make better use of argparse
Change-Id: I7421a0ab957412a8283eee6ae9783dac9d3f6a4a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-11-29 10:33:36 +00:00
Stephen Finucane
5ef5cc9c82 compute: Add server create --no-security-group option
To allow users to create servers with no security groups associated with
the ports.

Change-Id: I91b1d9dd5c3fbba838640841d98341cd8ccb1b16
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-11-29 10:33:18 +00:00
Takashi Kajinami
ecc744a4fd Remove ceilometer service overrides
devstack no longer installs ceilometer services unlesss ceilometer
devstack plugin is enabled, so we can safely remove the options to
disable ceilometer services.

This allows us to remove references to removed services such as
ceilometer-api .

Change-Id: I4201878d0deba4490cf2a08bbabec8fe64474385
2024-11-25 00:41:46 +09:00
Antonia Gaete
4bdd51cbea identity: Migrate 'domain' commands to SDK
Change-Id: Ide9cb9491334e139482f8cf1ea1874d01da0884f
Depends-On: Id1b7b00fe5b96f0cc922716afabcc678193f0f57
2024-11-20 23:28:47 +00:00
Antonia Gaete
4c8290012d identity: Migrate region commands to SDK
Change-Id: I980693732d794f1ccbfc8d7f06d61b4a9824ef15
2024-11-20 23:26:30 +00:00
Zuul
6ff3a92089 Merge "Show Created At column for volume backups in v3" 2024-11-20 16:38:57 +00:00
OpenStack Release Bot
8f56d3f5e4 reno: Update master for unmaintained/2023.1
Update the 2023.1 release notes configuration to build from
unmaintained/2023.1.

Change-Id: Id29f0413825372df296cc123d63cc092fbba1821
2024-11-14 10:17:59 +00:00
Antonia Gaete
9c6df823e2 identity: Migrate 'credential' commands to SDK
Change-Id: I49391fec3d7b6a1b81438a2a311ac7b86173a6a4
2024-11-13 18:13:19 +00:00
Takashi Natsume
fb1f841d2d Replace deprecated datetime.utcnow()
The datetime.utcnow() is deprecated in Python 3.12.
Replace datetime.utcnow() with
datetime.now(datetime.timezone.utc).replace(tzinfo=None).

Change-Id: Ic20174a9c6cacac05471fa57b105c1f784a73057
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2024-11-13 15:48:59 +00:00
Stephen Finucane
58e21d8e2b requirements: Remove unused test deps
oslotest is not used anywhere, while requests is already a runtime dep.

Change-Id: I852b7d8664cddf22b1314b057c42930580a1f9f4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-11-13 12:14:04 +00:00
Stephen Finucane
8890981491 Skip tips jobs on pre-commit config update
We only need to care about the unversioned tips jobs since [1] will take
care of the others.

[1] https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/933197

Change-Id: I3d569dc496a995eee58fdbcf4a42a187143d1b24
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-11-12 14:10:50 +00:00
Zuul
79e01a5533 Merge "Add "trusted" attribute to the "port"" 2024-11-08 17:32:37 +00:00
Zuul
d17d99faa9 Merge "common: Use correct argument for volume limits" 2024-11-05 20:38:15 +00:00
Stephen Finucane
e5ccf1eb1c common: Use correct argument for volume limits
The sooner we have type hints in SDK, the better /o\

Change-Id: Iaf9596aea02f683c280ae68504a14d43dbd6134a
Closes-bug: #2077634
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-11-05 17:07:49 +00:00
Zuul
974cdd9a4e Merge "Fix ignored --user-domain in role assignment list" 2024-11-05 17:01:54 +00:00
Slawek Kaplonski
47144103ca Add "trusted" attribute to the "port"
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/927723

Related-bug: #2060916
Change-Id: I8e3d4ee2208ef6bb6c96ee430d7b550a0720431e
2024-11-04 09:12:43 +00:00
Takashi Kajinami
2e491191e5 Fix ignored --user-domain in role assignment list
Fix the wrong value assignment which made the --user-domain option
ignored. Unit tests are updated to verify usage of domain options to
avoid further regressions.

Also drop the redundant look up of domain id to avoid unnecessary API
call.

Closes-Bug: #2085604
Change-Id: I5112b8e831fb26eb6544615277f0d3fe4f15dc5a
2024-10-29 21:20:07 +09:00
Tobias Urdin
695d025f00 Show Created At column for volume backups in v3
The change in [1] erroneously only added the
created_at column for volume v2 API and not
also for the volume v3 API.

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/920003

Change-Id: Iae0b4f21cbc31ae7464a79c8f5e01446ca4ff098
2024-10-17 16:25:13 +02:00
Yosef Salmalian
db115c09a2 remove project from network flavor profile
Removing project from network_flavor_profile as neutron api
does not uses project.

Closes-Bug: 2046496
Change-Id: I77b0544cf8629fb0a5b9914361a007d28b2b5662
2024-10-16 10:19:59 +03:30
Stephen Finucane
7c6b47b451 clientmanager: Check for 'block-storage' service type
This is a fun one driven by two separate changes. We recently started
checking whether the volume service was available before setting quotas
in order to allow us to use quota set for other services [1]. This
merged a number of weeks ago and was included in 7.1.0. More recently,
we modified DevStack to stop publishing a service catalog entry with a
service type of 'volumev3', preferring instead to use the correct
'block-storage' service type. Taken separately, neither of these changes
would have caused issues. Together, they mean our lookups for the volume
service now fail and we can't set volume quotas.

Fix things by checking for the block-storage service type also. A future
change will raise a warning (later an error) if the volume service is
not found and you're attempting to set a quota since this is clearly a
mistake.

Change-Id: Ibbeef52225e18757cd28d0fbfb14c1ca06975b60
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2084580
2024-10-15 18:07:26 +01:00
Rajat Dhasmana
b6b18489b0 Fix volume backup show by name
When we show a volume backup by name, it calls the get_backup
method in SDK which is only used for getting a backup by ID.
This patch modifies the approach to call find_backup method
which first tries the find by ID and then find by name logic
eventually returning the backup details.

Story: 2011234
Task: 51127
Change-Id: I926d8de9810fcf2e5335bbe35aaab15e1e36a5cb
2024-10-07 13:25:14 +00:00
Zuul
8979c00150 Merge "Always resolve domain id" 2024-10-03 11:59:16 +00:00
Takashi Kajinami
c8326b5525 Always resolve domain id
The --user-domain option and the --project-domain option may take id or
name. In case name is given it should be translated to id.

Closes-Bug: 2083390
Change-Id: Idf3f113a74452daabc80660574030cb9b24b1a15
2024-10-01 15:37:27 +00:00
Zuul
ac59673b5d Merge "Add status filtering options to port list" 2024-09-30 17:38:14 +00:00
Alfredo Moralejo
52d56b3fd9 identity: in service set command, don't pass the enable option when it is None
Currently, it is passing None value which is not accepted by keystone
parameters validation:

BadRequestException: 400: Client Error for url: ... Invalid input for field 'enabled': None is not of type 'boolean'

Failed validating 'type' in schema['properties']['enabled']:
    {'enum': [True, False, None], 'type': 'boolean'}

On instance['enabled']:
    None

Closes-Bug: #2083021
Change-Id: Ia8772560deb54e71672102157659d4eb22e6ad59
2024-09-30 13:45:03 +02:00
Zuul
2f790c319d Merge "identity: Don't pass unset options when creating user" 2024-09-25 08:22:26 +00:00
Sylvain Bauza
58d1b06fdc evacuate SDK actually uses admin_pass param
Change I0cd86675a884e6c2cbd3a861b8e111f961f0f336 was incorrect,
the SDK param name is admin_pass.

Change-Id: Ibe22c3d7d7ba0f1a5178475143e35fee5cac2ca2
2024-09-18 08:46:44 +02:00
Zuul
b92291f0aa Merge "compute: Allow adding, removing multiple SGs" 2024-09-17 13:26:47 +00:00
Stephen Finucane
033793aa0e identity: Don't pass unset options when creating user
In change I06f3848812bce60c65909f1311f36b70eba427d4, we migrated the
'user *' commands from keystoneclient to SDK. One side effect of this is
that we are no longer able to rely on keystoneclient's 'filter_none'
helper method that filters out parameters that are set to None. As such,
we now need to do this ourselves. Eventually, it would be nice if SDK
provided such functionality itself.

The same change also introduced a bug where the '--domain' argument was
being used to lookup a project rather than the '--project-domain'
argument. This is also corrected.

Change-Id: I1204ca611a74d134c879467d6c2b73f16e043213
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2080600
2024-09-17 13:26:26 +01:00
zhangoic
9c223696a0 Add status filtering options to port list
The patch adds "--status" options to list command.

Change-Id: I710437f67e9432b2b6389986bc922eac4a60c934
Partial-bug: #1672680
2024-09-17 12:56:21 +01:00
Antonia Gaete
415f68016c identity: Migrate 'access rule' commands to SDK
Change-Id: Id5740cc61474650f22f9efe8d148c8c666c3b91e
2024-09-17 11:52:46 +01:00
Stephen Finucane
bbe04238a8 tests: Add functional test for access rules
Change-Id: I0131eab2e5395ed530c05a2e9c91b348a7a34c13
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-17 11:51:54 +01:00
Zuul
31251e33ec Merge "Handle NotFoundException when listing floating IPs" 2024-09-13 18:58:51 +00:00
Zuul
e46a7a2adc Merge "pre-commit: Migrate pyupgrade to ruff" 2024-09-13 17:35:54 +00:00
Zuul
eaec72e2ba Merge "pre-commit: Migrate bandit to ruff" 2024-09-13 17:35:52 +00:00
Zuul
f63784606d Merge "evacuate: Fix password parameter name for SDK" 2024-09-13 17:35:50 +00:00
Zuul
86720f8a95 Merge "tests: Remove aliasing from extensions test" 2024-09-13 12:36:49 +00:00
Zuul
108aeb0bdf Merge "Remove TestServer base class" 2024-09-13 12:36:47 +00:00
Dr. Jens Harbott
8932282952 evacuate: Fix password parameter name for SDK
The parameter is called admin_password on the SDK side.

Change-Id: I0cd86675a884e6c2cbd3a861b8e111f961f0f336
2024-09-13 13:22:26 +02:00
Nate Johnston
b0936c5b30 Handle NotFoundException when listing floating IPs
Asking for floating IPs on an undercloud results in a NotFoundException.
Make openstackclient handle it gracefully.

No test is added for this because it would need to be a scenario test -
deploying a cloud without the foalting IP extension loaded.  I don't
think this edge case is worth an entire new job just to exercise it.

Change-Id: I73b544853376d98ab0dbb14e32fefc43c1a8a179
Story: 2006863
2024-09-13 11:34:05 +01:00
Zuul
067261e80d Merge "Removed the emit_duplicated_warning() funtion." 2024-09-12 19:19:48 +00:00
Zuul
e319df4726 Merge "compute: Fix --host in server list for new openstacksdk" 2024-09-12 18:37:15 +00:00
Stephen Finucane
f98006ca9d pre-commit: Migrate pyupgrade to ruff
Change-Id: Ic50d2a5e0bc9dcdfe29f382607135cab510cd396
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-12 18:08:23 +01:00
Stephen Finucane
fc6852cd94 pre-commit: Migrate bandit to ruff
The name of the errors change and we need to move things around a
little, but it's otherwise a straight swap.

Change-Id: I0a19765ebeaa14c0534faa1542165b76ed2bf4e2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-12 18:08:23 +01:00
Zuul
e60ca0f898 Merge "Drop support for Python 3.8" 2024-09-12 16:28:24 +00:00
Mohammed Al-Dokimi
2bf123f315 Removed the emit_duplicated_warning() funtion.
Since this function is called once, I moved its implementaion to where
its called.

Story: 2010344

Change-Id: Iaf06def1a06ffbb605ee42569e6f87b409a72772
2024-09-12 14:42:57 +01:00
Johannes Kulik
ffa683ab4e compute: Fix --host in server list for new openstacksdk
With `openstacksdk` 3.2.0 the `host` attribute of an Instance got added
to the `Server` class [0]. With that change, listing servers with the `host`
attribute leads to a query-filter for `compute_host` as expected, but
`openstacksdk` will also filter for the `host` attribute locally after
the results are returned. Since `compute_host` being
`OS-EXT-SRV-ATTR:host` is not the same as `host, this means no results
are returned.

Since we want to keep the old behaviour of filtering by `compute_host`
i.e. the service host name, we need to switch to filter for
`compute_host`. This is already supported in older versions of
`openstacksdk`.

[0] 0f311ff3e2

Change-Id: I0cd32c5b7d6d4d21194f3efdcfb9b205dea6a91e
Closes-bug: #2074200
2024-09-12 12:51:36 +00:00
Zuul
c2d96c5938 Merge "pre-commit: Migrate from black to ruff format" 2024-09-11 21:16:47 +00:00
Zuul
6e1a5ed5a6 Merge "trivial: Remove unnecessary trailing comma" 2024-09-11 21:16:45 +00:00
Zuul
9fca2b51ee Merge "pre-commit: Migrate from flake8 to ruff" 2024-09-11 21:16:44 +00:00
Zuul
21a384a868 Merge "pre-commit: Bump versions" 2024-09-11 21:16:42 +00:00
OpenStack Release Bot
b0c08ae29a Update master for stable/2024.2
Add file to the reno documentation build to show release notes for
stable/2024.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.2.

Sem-Ver: feature
Change-Id: I5b2c70118df024dfc9236c7e1fa39554ffccf5e0
2024-09-11 16:07:20 +00:00
Zuul
73e9dd1934 Merge "quota: Allow 'quota set' to function without volume service" 2024-09-06 15:46:49 +00:00
Stephen Finucane
519fa7aabc pre-commit: Migrate from black to ruff format
Change-Id: I28ca7d31d30272002799f3e2832105dc67c60538
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 15:55:39 +01:00
Stephen Finucane
17e6545fd4 trivial: Remove unnecessary trailing comma
Change-Id: I62402145c17f96626ec6e29598e32dee03a6038e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 15:55:39 +01:00
Stephen Finucane
2ba90581d5 pre-commit: Migrate from flake8 to ruff
Well, mostly. We still keep our own flake8 hooks and the hacking hooks
enabled. Everything else can be handled by ruff.

Doing this enables a couple of hacking checks that were previously
unaddressed. It also highlights a few cases that flake8 missed. Both are
addressed.

Change-Id: If81c7055e9ef692425da2789bae18a96d04b104f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 15:55:13 +01:00
Stephen Finucane
869b07eded pre-commit: Bump versions
We also drop the default language setting: everything is Python 3
nowadays.

Change-Id: I9dc9573a86c93416d1bbbc782dac76ecdda6effd
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-08-29 10:58:38 +01:00
Zuul
9c5fd76d9e Merge "compute: Add 'uuid' column to aggregate list" 2024-08-27 17:21:35 +00:00
Zuul
50d1e0916b Merge "Add callback on plugin load failure" 2024-08-14 11:12:03 +00:00
Zuul
bc6cff777f Merge "compute: Make 'hypervisor show' a bit faster" 2024-08-12 16:45:25 +00:00
Zuul
6312a6f452 Merge "compute: Only pass admin_password on rebuild if set" 2024-08-12 16:44:11 +00:00
Zuul
0d570cd66a Merge "identity: Use previous naming for 'service show' fields" 2024-08-12 16:01:30 +00:00
Zuul
e97e59d22d Merge "identity: Use previous naming for 'application credential show' fields" 2024-08-12 15:49:39 +00:00
Zuul
1aa077efee Merge "Add Python 3.12 classifier" 2024-08-09 13:10:32 +00:00
Zuul
d385bd1e03 Merge "Show Created At column for volume backups" 2024-08-09 12:20:45 +00:00
Zuul
f2cf938979 Merge "Bump requests minimal version" 2024-08-08 17:18:03 +00:00
Stephen Finucane
25780e80ab identity: Use previous naming for 'service show' fields
We changed these in change I37d07a6c5cdc98680b8d65d596521cad2b049500 but
the '-c/--column' option provided by cliff currently requires an
explicit match on column names. Change them back for now. We can revert
this when cliff is a little bit smarter.

Change-Id: I9180922e9da5c22ae3d8878946d1bf1ec4b8c6e1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2076212
2024-08-08 10:54:10 +01:00
Stephen Finucane
0e731cd22f identity: Use previous naming for 'application credential show' fields
We changed these in change Iba3fee2672d32266623c6f367beaabe84bd3d24e but
the '-c/--column' option provided by cliff currently requires an
explicit match on column names. Change them back for now. We can revert
this when cliff is a little bit cleverer.

Change-Id: I6b4f1b793dc383856bfdf9a01514381be3cd2bf1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Related-bug: #2076212
2024-08-08 10:53:25 +01:00
Stephen Finucane
4a2fd82b07 compute: Make 'hypervisor show' a bit faster
In the event that a user provides a hypervisor name rather than an ID to
the 'hypervisor show' command, passing 'details=True' (the default) to
'find_hypervisor' will ensure we get the detailed response we need.
However, this comes at the cost of retrieving reams of additional
irrelevant data for all the other hypervisors. Rather than doing this,
use a summary view and then a second call to fetch only the hypervisor
we care about.

Change-Id: I92b53802e41a962c6f916c3a111dc2de7c12d0fc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2072965
2024-08-07 13:50:28 +01:00
Stephen Finucane
04ebe0853d compute: Add 'uuid' column to aggregate list
Change-Id: I15d4a2d5980c1ba3e00f7d1bd09f11d0f42564e1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2073542
2024-08-07 13:24:23 +01:00
Stephen Finucane
b8459c57c8 compute: Only pass admin_password on rebuild if set
In SDK change I3bc3150877c6c00aa9ec4355104308d7755aa1d4, we modified the
'rebuild_server' proxy method to use a sentinel 'unset' value so that we
could distinguish between fields that were not being changed and those
that were being changed to 'null'. However, we are currently passing the
'admin_password' field to the 'rebuild_server' SDK proxy command
regardless of whether it is set or not. Resolve this conflict.

Change-Id: If7b7585aadd43cdc6d2a9358f14223e43dc21a73
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2076232
2024-08-07 13:06:13 +01:00
Stephen Finucane
6693f555bc quota: Allow 'quota set' to function without volume service
Unlike cinderclient, SDK attempts to connect to a service as soon as you
create a client. A keystoneauth1.exceptions.catalog.EndpointNotFound
exception can be raised if this service does not exist in the service
catalog. Avoid this for the quota and limits commands by first checking
if the service is enabled.

In the process, we rework the 'is_volume_endpoint_enabled' helper we are
using to check for the existence of the service to *not* require a
volume client, since this was causing a chicken and egg issue for us
(and was also pretty much unnecessary).

Change-Id: I56e68f00ea221d689eb7f668e9e5ffa7d1a20184
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2076229
2024-08-07 11:56:07 +00:00
Zuul
a59262e44d Merge "Respect --skip-resource when deleting." 2024-08-01 13:21:54 +00:00
Joel Capitao
5238394e6a Bump requests minimal version
It's a follow-up of [1].
JSONDecodeError exception was implemented in requests
since 2.27.0 [2].

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/924927
[2] db575eeedc

Change-Id: I8a6a8ac064cb0703097ed686b1fcd2983181fcfa
2024-08-01 09:38:23 +02:00
Tim Bishop
1d4aabab2e
Respect --skip-resource when deleting.
When running project cleanup and using the --skip-resource flag, this
flag is only used during the --dry-run stage. This change ensures it is
also used when deleting the resources which fixes the bug mentioned below.

Closes-Bug: #2074109
Change-Id: I8e50fd14dcde069b932cc8ec4bb4fc809f7d2eb7
2024-07-25 20:20:56 +01:00
Stephen Finucane
aa88db9448 Add callback on plugin load failure
I have seen a few cases where import errors (distutils - I am looking at you)
result in an extension not being available, but there is no indication why this
is the case. We do configure logging, but this happens too late (as part
of the 'cliff.app.App.run' call to execute a command, which calls
osc-lib's 'configure_logging' but which happens long after we've tried
to import our plugins) to be of any use. Instead, make use of a callback
to make it more obvious.

Change-Id: Id68b06161e445b79fe43f463e06cda3c4771ef02
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-24 17:00:07 +01:00
Zuul
37a22cf84c Merge "Add tests for 'default security group rule create'" 2024-07-23 15:25:51 +00:00
Zuul
965c61c90c Merge "Add volume snapshot unmanage support" 2024-07-23 12:58:03 +00:00
Zuul
e650c3eeaa Merge "Add DeleteVolumeSnapshot class to v3" 2024-07-23 12:58:02 +00:00
Zuul
c47ccb9721 Merge "Followup: Reduce LOC in volume v3 service" 2024-07-23 12:58:00 +00:00
Stephen Finucane
7a92bc4abc Drop support for Python 3.8
This goes EOL in October. We don't want to be supporting it past then.
Drop it now.

Change-Id: I6166678a35092760718d4fcd0357e7195bbe8be0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-19 12:27:07 +01:00
Stephen Finucane
f885a47450 Add Python 3.12 classifier
We are testing this in CI and can support it going forward now. The
osc-tox-py310-tips job is removed in a favour of a new
osc-tox-py312-tips job.

Change-Id: I87a726cb65223cba9975d0505c13fe42dcd7fa14
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-19 12:24:47 +01:00
Zuul
b223156906 Merge "Remove python-novaclient" 2024-07-18 18:03:28 +00:00
Zuul
70fbf687cf Merge "quota: Migrate 'quota *' to SDK" 2024-07-18 17:53:24 +00:00
Zuul
2d59c675dd Merge "quota: Split up 'quota list' command" 2024-07-18 13:35:21 +00:00
Zuul
692b06dfd5 Merge "quota: Default network quotas to not force" 2024-07-18 13:35:19 +00:00
Stephen Finucane
f68000d772 tests: Remove aliasing from extensions test
This isn't necessary and makes migration of the compute client a little
more difficult.

Change-Id: Ib07e60171c43838935ea30f4916bf68d54cdc944
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-18 13:39:39 +01:00
Stephen Finucane
0d89f01448 Remove TestServer base class
Simplify this somewhat.

Change-Id: I4ece72344e0e671c2f190fa9200e91d72333e96d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-18 13:28:51 +01:00
Stephen Finucane
438e40db36 Remove python-novaclient
There are a few remnants left here but this is trivial to clean up now.

Change-Id: I517d906796338e64a31afa08b9ee6909b08e0115
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-18 13:28:51 +01:00
Stephen Finucane
ece30e8f70 compute: Allow adding, removing multiple SGs
We also ensure we call neutron rather than the deprecated nova proxy API
in the event that neutron is available.

Change-Id: I8315ea164fd3fa6c1d759f16677bfd6c24c4ef63
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-18 12:41:51 +01:00
Zuul
97bded1a3d Merge "quota: Add 'quota set --default' option" 2024-07-18 11:26:26 +00:00
Stephen Finucane
6127b44d0a quota: Migrate 'quota *' to SDK
This is done for both the compute and block storage services. The
network service was already using SDK.

Change-Id: Id7a6943b8b4d7d1330e7d7f13705f027d1b67189
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/923864
2024-07-15 18:19:43 +01:00
Zuul
45ac2b62fb Merge "quota: Remove deprecated quota options" 2024-07-15 16:17:47 +00:00
Zuul
cf81902402 Merge "quota: Move nova-network-related quota" 2024-07-15 16:02:25 +00:00
Zuul
716dff1052 Merge "tests: Remove references to novaclient methods" 2024-07-15 15:15:03 +00:00
Zuul
7219144dae Merge "network: Replace use of in-tree API client" 2024-07-15 15:01:18 +00:00
Zuul
e08cf1790f Merge "compute: Migrate 'server create' to SDK" 2024-07-15 15:01:16 +00:00
Zuul
c78cba654a Merge "compute: Prevent use of conflicting v*-fixed-ip for 'server create --nic'" 2024-07-15 13:12:58 +00:00
Zuul
1b8eabee4e Merge "compute: Migrate 'server evacuate' to SDK" 2024-07-15 13:05:00 +00:00
Zuul
f58f85857b Merge "compute: Migrate remaining server actions to SDK" 2024-07-15 13:04:59 +00:00
Zuul
c18eab5198 Merge "compute: Migrate 'server rebuild' to SDK" 2024-07-15 13:04:57 +00:00
Zuul
855686a881 Merge "compute: Avoid third API call during 'server show'" 2024-07-15 13:00:11 +00:00
Zuul
f1a3fc319d Merge "compute: Always use SDK client to display server" 2024-07-15 13:00:07 +00:00
Zuul
5898f13473 Merge "compute: Migrate 'server set', 'server unset' commands" 2024-07-15 13:00:02 +00:00
Zuul
816f4857dc Merge "compute: Migrate 'server migrate' to SDK" 2024-07-15 12:59:58 +00:00
Zuul
8b783fd8ad Merge "compute: Migrate 'server add/remove security group' to SDK" 2024-07-15 12:59:54 +00:00
Zuul
10b448351d Merge "common: Migrate 'limits show' to SDK" 2024-07-15 12:59:52 +00:00
Zuul
cd107ea7b6 Merge "docs: Fix indentation" 2024-07-15 12:46:12 +00:00
Zuul
2733b3413d Merge "identity: Migrate 'service' commands to SDK" 2024-07-12 14:07:22 +00:00
Zuul
7de15cee16 Merge "identity: Migrate 'application credential' commands to SDK" 2024-07-12 13:54:38 +00:00
Stephen Finucane
b4f30a1583 quota: Split up 'quota list' command
This is really three separate commands rolled into one. Split the logic
up more to simplify it somewhat.

Change-Id: Ief3c3c413f791dda076f90e5ec76a033d3a9e12b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-11 11:34:24 +01:00
Stephen Finucane
da7eda66e9 quota: Default network quotas to not force
The existing default behavior has been deprecated for over a 18 months
(change I25828a3d68e2e900f498e17a0d01fb70be77548e). It's time for a new
default.

Change-Id: Iaf4fa931dcbf16c22933f63629c6a4d443ac5310
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-11 11:34:02 +01:00
Stephen Finucane
7d8baa87bb quota: Add 'quota set --default' option
This should have been added as a counterpart to the 'quota show
--default' option way back when we added that. Better late than never!

Change-Id: I0e3719e585353664fea6f23ec658a330086db3df
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-11 11:21:24 +01:00
Stephen Finucane
ba2d2358e6 quota: Remove deprecated quota options
These are all deprecated for over 18 months (change
I0dd38e5cb252a01d5817ed168be040b21b35e348). It's time to remove them and
simplify this code.

Change-Id: I9ee3bfebbad21eec3eb1b475a813bcbc450edea4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>

Change-Id: Ibdd329a6db8bd176af065d7f5190f0901d3c3f8d
2024-07-11 11:10:11 +01:00
Stephen Finucane
f5f543b8de quota: Move nova-network-related quota
This was incorrectly grouped as a general compute quota, when in fact
it's a nova-network quota. Move it.

Change-Id: If93c95bc181ab766137b61943a09821810345300
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-10 12:16:16 +01:00
Stephen Finucane
75b9214f6c tests: Remove references to novaclient methods
These should have been cleaned up as we went but weren't. Fix things
now.

Change-Id: I80b29c0fd6e4f557c2efc45474279306f50c4fd7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-09 18:19:36 +01:00
Stephen Finucane
209f8e9e17 network: Replace use of in-tree API client
None of these are actually supported by openstacksdk (intentionally so)
so we add our own manual implementations.

Change-Id: Ifd24f04ae4d1e56e0ce5ba0afe63828403bb7a6f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-09 18:19:36 +01:00
Stephen Finucane
30a64579b6 compute: Migrate 'server create' to SDK
The final step. Future changes will clean up the remnants of the
novaclient usage. This is a rather large patch, owing to the number of
things that novaclient was handling for us which SDK does not, but the
combination of unit and functional tests mean we should be handling
all of these differences.

Change-Id: I623e8c772235438a3d1590e1bbd832748d6e62ea
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-09 18:17:22 +01:00
Antonia Gaete
bef8a7a630 identity: Migrate 'application credential' commands to SDK
Change-Id: Iba3fee2672d32266623c6f367beaabe84bd3d24e
2024-07-09 15:19:38 +00:00
Antonia Gaete
717f242881 identity: Migrate 'service' commands to SDK
Change-Id: I37d07a6c5cdc98680b8d65d596521cad2b049500
2024-07-09 15:09:37 +00:00
Stephen Finucane
d22f26446a compute: Prevent use of conflicting v*-fixed-ip for 'server create --nic'
Currently this check is handled by novaclient. In the future, we won't
have that so we need to do it ourselves. Do so now, fixing a typo along
the way and adding tests to prevent regressions.

Change-Id: Iaa9c087d846390b6a4f95ed3fa121dd8dc640903
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-09 14:35:05 +01:00
Stephen Finucane
e6dc0f39c0 compute: Migrate 'server evacuate' to SDK
Change-Id: I8ea2da0921c5fd306271f03fa733c0f9787afb82
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/918745
2024-07-08 16:07:07 +01:00
Stephen Finucane
b9b5e7615a compute: Migrate remaining server actions to SDK
Migrate the following commands:

- 'server delete'
- 'server rescue'
- 'server unrescue'
- 'server resize'
- 'server resize confirm'
- 'server resize revert'
- 'server migrate confirm'
- 'server migrate revert'
- 'server remove fixed ip' ('server add fixed ip' was already migrated)
- 'server ssh'

That leaves a few commands to migrate, all of which are called out with
TODOs.

Change-Id: Idb769a93609da522c458e719bc69a63ff2ab107b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 16:06:59 +01:00
Stephen Finucane
8d904a9efb compute: Migrate 'server rebuild' to SDK
Change-Id: Ic7cdb05327a4a74364f08451e531d02c631b7633
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/918730
2024-07-08 11:07:09 +00:00
Stephen Finucane
2057462120 compute: Avoid third API call during 'server show'
We can use a detailed list instead when looking up by name. We also
improve tests somewhat.

Change-Id: I18b38e7fbcac813190b304c4d67d8ea03d8c1a80
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 11:06:11 +00:00
Stephen Finucane
628ac48901 compute: Always use SDK client to display server
This affects the 'server create', 'server show', 'server rebuild' and
'server set' commands. We also fix a few mistakes around the fields
shown.

Change-Id: I9946e12146efff39f9ba1591c90a4a9bccd46919
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 12:00:49 +01:00
Stephen Finucane
bcaf2ab559 compute: Migrate 'server set', 'server unset' commands
Change-Id: I2c249e9ca3952100dcf7f97fcafa879b733d34c6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 10:30:44 +01:00
Stephen Finucane
c8621e5b8b compute: Migrate 'server migrate' to SDK
Change-Id: I56d31c2fd4f8bf19eedd8f9eecd8a41cdafc5b55
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 10:30:44 +01:00
Stephen Finucane
abef798f30 compute: Migrate 'server add/remove security group' to SDK
We need to work around SDK's (intentional) lack of support for Nova's
deprecated '/os-security-groups' API but it's nothing too crazy.

Change-Id: I03ca1a73f98aa77b288148607baff336dae69fb1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 10:30:44 +01:00
whoami-rajat
9d39437282 common: Migrate 'limits show' to SDK
This is done for both the compute and block storage services even though
the compute service hasn't supported rate limits since API v2.1 was
introduced [1].

[1] https://github.com/openstack/nova/commit/ca4ec762804

Change-Id: Idd9f4a1c23952a6087f08c03ac8b5bebd5a0c86d
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/918519
2024-07-08 10:30:36 +01:00
Stephen Finucane
55cbb84e60 volume: Migrate 'volume list' to compute SDK
Change-Id: Iae662aa6b391ba6ae5f569184c7d19fb3654be35
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 09:59:21 +01:00
whoami-rajat
9f30ee9af2 volume: Migrate 'volume attachment *' to SDK
This patch migrates the volume attachment create, get, list,
delete, update and complete commands to SDK.

Change-Id: Ib237d25cc1c3fc72946b9d088ff3447433162130
2024-07-08 09:59:21 +01:00
Stephen Finucane
402327f2e4 tests: Migrate to 'set_xxx_api_version' helpers
Clean things up somewhat.

Change-Id: I868f496fc8285a28e8fd551377f2ae6228051d19
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 09:59:21 +01:00
Stephen Finucane
88fffeabd7 tests: Add ability to configure fake server API version
This beats the horrible mess of mocks we have created for ourselves.

Change-Id: I8af3ce0a0b10f52e2124ec86f306327ff3474982
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 09:59:21 +01:00
Stephen Finucane
3f624295ec volume: Add v3-specific volume transfer module
This makes testing easier.

Change-Id: I515aa54750439a6c4ad5b16cffe004ba1c7cf5b2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 09:59:21 +01:00
Stephen Finucane
f1f390f2ae volume: add v3-specific volume type module
This makes testing easier.

Change-Id: If1ed8d5003160e45d503971ae722fd9983d3dd6d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 09:59:21 +01:00
Stephen Finucane
65cce3943a volume: Add v3-specific volume module
This makes testing easier.

Change-Id: I6b31026ae3c9dc66d828744534b35bb0a0d2ffbe
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 09:59:21 +01:00
Stephen Finucane
ca91c826e3 volume: Add v3-specific volume backup module
This makes testing easier.

Change-Id: I71a13b34a85350af17612e12c03e6df8cb041f86
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-08 09:59:20 +01:00
Zuul
a6dcb773f1 Merge "Fix: incremental volume backup" 2024-07-05 19:55:12 +00:00
Stephen Finucane
3f781cc3f9 docs: Remove references to novaclient
Change-Id: Ieb1dc77f311a2e279036587a1f8d575a387494d0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-02 17:52:02 +01:00
Stephen Finucane
0f006392ac compute: Migrate remaining tests to SDK objects
Change-Id: I33b80007777a0483964cc04357961bf0c5eda6e5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-02 17:52:02 +01:00
Stephen Finucane
7252a7a781 compute: Migrate 'host set' to SDK
This was the sole outstanding command to be migrated to SDK. We also
clean up the old in-tree wrappers we have in the process and add missing
error checks for the 'host list' and 'host show' commands.

Change-Id: I5635469b63ab3370fb5118e4f8a1758002381aa5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-02 17:52:02 +01:00
Stephen Finucane
0f07c97e84 compute: Migrate 'agent *' to SDK
These are not supported by SDK natively (intentionally so) so we use raw
HTTP requests to manage this migration.

Change-Id: I72fa0d6f87899537a24090995b1ba884bc5f9d4d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-02 17:52:02 +01:00
Stephen Finucane
e0f7306011 network: Migrate 'port list' to compute SDK
We use the compute client here to look up server IDs when filtering by
'device_id'.

Change-Id: I76515eaa4ce4e7c7d0173d2e0a91d7564ba7041a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-02 17:52:02 +01:00
Stephen Finucane
aa5eb881e5 compute: Migrate tests for ShowServer to SDK objects
This is a little more realistic. We fix a minor bug along the way and
start ignoring some newly added create-only fields.

Change-Id: I93eae610e16e2a3a859f684b889546ace3afa683
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2024-07-02 17:51:49 +01:00
Zuul
518420abe4 Merge "compute: Remove unnecessary try-except" 2024-07-01 22:38:55 +00:00
Rajat Dhasmana
205bac3caf Fix: incremental volume backup
The incremental volume backup stopped working after we moved from
cinderclient to SDK[1]. This happened because SDK accepts the
``is_incremental`` parameter[2] rather than the ``incremental`` parameter
which is actually passed in the API request and was previously a valid
parameter for cinderclient.

This patch fixes the issue by passing the ``is_incremental`` field instead
of ``incremental`` from the OSC side which adds the ``incremental`` parameter
in the API request.

Request body after the fix:

'{"backup": {"name": null, "description": null, "volume_id": "<vol-id>",
"force": false, "container": null, "incremental": true}}'

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/889748
[2] 10e5e20fc0/openstack/block_storage/v2/backup.py (L126-L134)

Closes-Bug: #2070080
Change-Id: I89bd3d2751267ec39f4dbd664b7873ab87a9ac6c
2024-07-01 21:11:46 +05:30
Stephen Finucane
21155be2e4 docs: Fix indentation
Additional paragraphs in a rST list should be indented by the same
number of characters as the first paragraph otherwise it renders as a
block quote. Correct this for the backwards incompatible changes guide.

Change-Id: I918c2a24aead4cc5a317201df9b12ce740612e5a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-07-01 12:38:42 +01:00
Stephen Finucane
40ce56201c compute: Remove unnecessary try-except
We don't need to transform one HTTP Forbidden-related error to another:
just use the original one. This also fixes an issue where we would end
up with an undefined variable (server_id) if a non-HTTP 403 exception
was raised, since that would be blindly ignored.

Change-Id: Icdd1764b6f2df4a635e3264ed8f93a115cc52ef2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-Bug: #2062010
2024-07-01 11:11:02 +00:00
Rajat Dhasmana
f52e888dab Followup: Reduce LOC in volume v3 service
This is a followup of[1] in which we are reducing LOC by removing
redundant definition of columns.

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/922865

Change-Id: I2992d3ab678e751726906926b680e4aa9ad1d502
2024-06-28 20:40:06 +05:30
Rajat Dhasmana
ca81b1acf0 Add cluster to volume service list
This patch adds the ``Cluster`` and ``Backend State`` columns to
the ``openstack volume service list`` command. Note that you need
to provide the appropriate microversion to show these columns.

Cluster: openstack --os-volume-api-version 3.7 volume service list
Backend State: openstack --os-volume-api-version 3.49 volume service list

Change-Id: Ie7727d0001307b5d5a40d7ea0348bdb9626f9e03
2024-06-27 19:37:15 +05:30
Brian Haley
75696f8f3f Add tests for 'default security group rule create'
A previous change fixed a bug with the custom SG rule
flag, but did not add any tests to verify all the
combinations of default and custom SG flags. Let's
add them now.

Change-Id: Id74552346cfa975e3dd5eb45b8f621b365e88463
Related-bug: #2054629
2024-06-26 16:36:32 -04:00
Rajat Dhasmana
4e94c415ed Add volume snapshot unmanage support
This patch adds support for unmanaging a snapshot with
``openstack volume snapshot delete --remote`` command.

Change-Id: I3caf3471a007fcb988835d495727bbc5c66f42f8
2024-06-25 01:51:50 +05:30
Rajat Dhasmana
49c42c73a2 Add DeleteVolumeSnapshot class to v3
This is done to support the snapshot unmanage command.

Change-Id: I174ad08c7c03fe7a9206d40645a6916f104212c6
2024-06-25 01:40:55 +05:30
Zuul
dd6ac285d5 Merge "Identity: Migrate 'role assignment' commands to SDK" 2024-06-17 11:41:01 +00:00
ArtofBugs
de9d0f9e1b Identity: Migrate 'role assignment' commands to SDK
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/913448
Change-Id: I579775d2dc4110951e934e00b51bf8d7546e207b
2024-06-13 16:00:54 -07:00
Stephen Finucane
887f1e9385 tox: Add testenv descriptions
Change-Id: I0a7880d72248e94690a973d3a1fd33c176ed658e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-06-12 14:40:50 +00:00
Zuul
19c053efb8 Merge "Add support for volume unmanage" 2024-06-11 15:11:11 +00:00
Rajat Dhasmana
fdc2763ac2 Add support for volume unmanage
This patch adds support for unmanaging a volume with the
``openstack volume delete --remote`` command.

Change-Id: Id71681e817f6e56b4ef553079f0bcfac8252d3cf
2024-06-10 20:48:30 +05:30
Brian Haley
5483370981 Remove admin only text from 'port create' help text
Specifying a MAC address is only admin only for
'port set' [0], remove it from the 'port create'
help text.

[0] https://docs.openstack.org/api-ref/network/v2/index.html#ports

Change-Id: Ic3296dd03676b460b3d08b1bbaae6f1d132e839d
2024-05-24 16:38:50 -04:00
Zuul
d9b95d776a Merge "Fix tests on Python 3.12" 2024-05-21 07:41:51 +00:00
Zuul
525fabe051 Merge "Drop direct dependency on simplejson" 2024-05-20 11:45:21 +00:00
Zuul
6dbf7afe1d Merge "Remove clients of retired projects" 2024-05-20 11:45:19 +00:00
Takashi Kajinami
cf6dd62dd1 Drop direct dependency on simplejson
The simplejson library is not included by the requirements but it was
directly imported. Drop the direct inclusion and use the alias in
the requests library to avoid ImportError caused by missing simplejson
in the environment.

Also fix the missing requests library in requirements.

Change-Id: I8713f45c5f2717cc53ba043aaeb479e72f641f78
2024-05-20 09:59:32 +09:00
Tobias Urdin
7eccd403c7 Show Created At column for volume backups
The ``volume backup list`` command does not show the
created_at column for backups which doesn't really
help the end-user since a critical part of a backup
is knowing when it was taken, and fast if there is
a rush doing recovery by restoring a volume from a
backup.

Change-Id: I8d8a7f36c468c9faa2c2c47bfa9ba9e1ca5b9858
2024-05-19 22:17:06 +02:00
Takashi Kajinami
bb459d49a8 Remove clients of retired projects
Murano[1], Sahara[2] Senlin[3], and Solum[4] are being retired because
of no activity and no maintainer.

[1] https://review.opendev.org/c/openstack/governance/+/919358
[2] https://review.opendev.org/c/openstack/governance/+/919374
[3] https://review.opendev.org/c/openstack/governance/+/919347
[4] https://review.opendev.org/c/openstack/governance/+/919211

Change-Id: I20a1f55840abad810517b4f583bb1040e63b6210
2024-05-17 00:50:09 +09:00
Rajat Dhasmana
00af14b3f2 Add DeleteVolume class to v3
This is done to support the volume unmanage command.

Change-Id: Ib59b1f599be152a25c4b6a31988c28079f552ba9
2024-05-15 11:55:50 +05:30
Rajat Dhasmana
cc7773f53b Add support for managing volumes
This patch adds support for the cinder manage command to
bring a volume under OpenStack management.

Change-Id: I12b63bfc4f0c9bc29cf9d4efd9a5cd038ec00af3
2024-05-15 11:53:27 +05:30
Rajat Dhasmana
0d9ace6425 Add CreateVolume class to v3
This patch acts as a base framework to add the parameters needed
for manage volume support.
This includes 2 changes:
1. Move get_parser and take_action code to common methods which
can be utilized by both v2 and v3
2. Make _check_size_arg as a static method and move it inside
CreateVolume class since it's not used by other classes.

[2] was initially thought to be a follow up change but since we
are implementing changes into the _check_size_arg method for v3,
it makes sense to just include it in CreateVolume class to avoid
adding a new additional method. Similar changes are done for v2
as well.

Change-Id: I9315e457ebd6c5ba4cc67452f92c9dc8c139ee3c
2024-05-15 11:46:12 +05:30
Stephen Finucane
4c31284936 Fix tests on Python 3.12
We were seeing the following test failures on Python 3.12:

  openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_all
  openstackclient.tests.unit.common.test_module.TestModuleList.test_module_list_no_options

Both failures were caused by missing attributes of 'sys', e.g.

  AttributeError: module 'sys' has no attribute 'builtin_module_names'

Fix this by exposing the real 'sys' module as part of our mock of
'sys.modules'.

Change-Id: I17391a46f08896f49dccaf75ad685dab1375a03d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-05-10 11:16:56 +01:00
Zuul
5e5b89f906 Merge "Router flavor_id can be a name" 2024-05-08 19:43:44 +00:00
Zuul
1ea291167b Merge "Improve output of 'server migrate --wait'" 2024-05-07 14:52:05 +00:00
Stephen Finucane
50c595b6e0 identity: Make better use of argparse
Change-Id: I50d2d28422e609656408b9b59f330d6a78314344
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-05-07 11:20:02 +01:00
elajkat
2e7ba5e3dd Router flavor_id can be a name
Change-Id: I72fc21a1adb4790a2a51e9b37744ee1ee3d01f32
Partial-Bug: #2020823
2024-05-06 13:36:04 +02:00
Stephen Finucane
0fd107e6c7 pre-commit: Add pyupgrade hook
Another day, another useful hook. We also ignore the preceding patch
that actually did the work, renaming the incorrect named file in the
process.

Change-Id: I412827761fbdeb36702ebaf5c1b727c62e629299
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-05-03 19:18:45 +01:00
OpenStack Release Bot
25f2e22429 reno: Update master for unmaintained/zed
Update the zed release notes configuration to build from
unmaintained/zed.

Change-Id: Ia39713784cb393f5d2371922eb314720131561f1
2024-04-29 10:48:50 +00:00
Zuul
3950b4f7ce Merge "tests: Fix trivial sorting issue" 2024-04-26 13:08:00 +00:00
Stephen Finucane
837a3dc015 tests: Fix trivial sorting issue
We've seen an ordering issue pop up occasionally in the CI. Resolve it.

Change-Id: I4dd10268b673c260ac0894fac92cd8bea9e626f4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-25 10:34:36 +01:00
Stephen Finucane
c5b772db76 trivial: Prepare for pyupgrade pre-commit hook
This change is entirely automated save for the update of some mocks from
'io.open' to '__builtins__.open').

We are keeping this change separate from addition of the actual hook so
that we can ignore the commit later.

Change-Id: I0a9d8736632084473b57b57b693322447d7be519
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-23 12:24:23 +01:00
Zuul
3de6969dbe Merge "tox: Remove bandit skips, run via pre-commit" 2024-05-03 17:36:21 +00:00
Zuul
7f42cb84b7 Merge "tox: Add functional-pyNN jobs" 2024-05-03 17:36:20 +00:00
Stephen Finucane
0646f9b4e4 tox: Remove bandit skips, run via pre-commit
Most of these skips were unnecessary. The few that did generate warnings
could be skipped.

We also set 'skip_install' since there's no reason to build the package
for linting purposes.

Change-Id: I9644e5c19720b9c41c60e0a5882b7cd7f6a71f7b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 13:17:15 +01:00
Stephen Finucane
648d8df578 tox: Add functional-pyNN jobs
Let's us test with specific Python versions. We also merge the
'functional-tips' target in.

Change-Id: I08e1b3e2f4be57aec0c1cd01274d86dfec769666
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2024-04-26 13:16:48 +01:00
Stephen Finucane
ee23995004 pre-commit: Bump versions
We fold in the new black changes also.

Change-Id: I326a0529b6b9f2aa9fbc33862567131839460797
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-23 12:22:26 +01:00
Bence Romsics
bbe686109d
Improve output of 'server migrate --wait'
We have seen users interpret the current output ('Complete') of
'server migrate --wait' as if it meant success as well and be surprised
when later they learned that the migration was complete and failed.

This change adds a pointer to the that output, how to actually check the
success/failure of a migration, hoping to eliminate this user confusion.

Change-Id: I09030705a39405366d6202a5ac743cc4d1ddd63c
2024-04-16 10:58:42 +02:00
Zuul
a79cb608b0 Merge "Add image metadef resource type association commands 'create', 'list', 'delete'" 2024-04-15 14:01:02 +00:00
Zuul
147503f3c6 Merge "Add NUMA affinity policy options "socket"" 2024-04-15 13:00:49 +00:00
Zuul
4d30527659 Merge "Add support for showing requested az in output" 2024-04-15 13:00:47 +00:00
Zuul
c99c189ac5 Merge "Update master for stable/2024.1" 2024-04-15 13:00:45 +00:00
Zuul
c13977fd68 Merge "image cache clear: fix value of default target" 2024-04-15 13:00:43 +00:00
Zuul
7e3664ff07 Merge "Adds CLI support for `glance md-object-property-show`" 2024-04-15 13:00:41 +00:00
Zuul
54bb7477f2 Merge "Do not sort subnet dns_nameservers field" 2024-04-15 13:00:39 +00:00
Zuul
e9aa6f57c5 Merge "Identity: Properly list users in a group in 'user list' commands" 2024-04-15 13:00:37 +00:00
Zuul
07b71fc99c Merge "Tox: Fix install commands for unit-tips and functional-tips" 2024-04-15 12:52:40 +00:00
Antonia Gaete
276dbb6f56 Add image metadef resource type association commands
'create', 'list', 'delete'

Change-Id: I2c860427b0b2693076cfe57841f0e512ad1f6388
2024-04-15 11:42:45 +00:00
Zuul
9db8902c2b Merge "tests: Remove use of unnecessary fake argparse Namespace" 2024-04-12 17:28:37 +00:00
Zuul
9ca9eba624 Merge "tests: Use consistent shortcut to fake identity client" 2024-04-12 17:09:15 +00:00
Zuul
34ae192332 Merge "refectoring: remove duplicate declaration" 2024-04-12 01:55:18 +00:00
Stephen Finucane
bb6b1e38cb tests: Remove use of unnecessary fake argparse Namespace
Change-Id: I135c24d0f6450d5af4e1860218bf3a65c09e36cc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-11 11:23:20 +01:00
Stephen Finucane
ea202fe77c tests: Use consistent shortcut to fake identity client
Change-Id: I72e016b8146e38948b6ae857bf7ec0b18f4e3663
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-11 11:23:16 +01:00
ArtofBugs
948b97d09e Identity: Properly list users in a group in 'user list' commands
Change-Id: Ia4457eaea5016b2e0325c6eb704d1592058e455e
2024-04-09 12:15:00 -07:00
Zuul
57c73101a2 Merge "refectory: remove unreachable code" 2024-04-09 18:38:16 +00:00
Zuul
7c18388235 Merge "Fix typo in the list of Glanceclient/OSC commands" 2024-04-09 18:38:14 +00:00
Zuul
9467b404c7 Merge "volume: Deprecate '--retype-policy' in favor of '--migration-policy'" 2024-04-08 12:36:54 +00:00
Zuul
1a38af53eb Merge "volume list: Don't call nova if no volume is attached" 2024-04-08 11:40:41 +00:00
Rajat Dhasmana
5a18f995a8 volume: Deprecate '--retype-policy' in favor of '--migration-policy'
The '--retype-policy' option is used in the 'volume set' command to
specify the migration policy during the retype operation. The
'--retype-policy' option does not convey the correct meaning of its
usage. The migration policy determines whether we are going to perform
the migration in the retype operation or not and is not related to the
actual retype which just changes the volume type of the volume.

Change-Id: I2ea8fd3f5277bb3422ccae915d05e8ad44ff1912
2024-04-08 11:37:42 +01:00
Zuul
51f173c8cc Merge "Add router default route BFD/ECMP options" 2024-04-05 15:55:03 +00:00
Zuul
79974668b8 Merge "Add support for managing external gateways" 2024-04-05 15:55:01 +00:00
ArtofBugs
a45a3642b5 Tox: Fix install commands for unit-tips and functional-tips
Change-Id: I352ea2b18a8bdb57cd3027c2024834db091a5643
2024-04-04 17:09:28 -07:00
ArtofBugs
680e3e3011 identity: Migrate 'user' commands to SDK
Change-Id: I06f3848812bce60c65909f1311f36b70eba427d4
2024-04-04 16:22:56 -07:00
Stephen Finucane
c86b9d8cc7 tests: Add identity v2, v3 FakeClientMixin
This ensures we are speccing the identity proxy API, as we did
previously for other services.

Change-Id: I4d090bab001f9b7e1d83ca8fee9e7e1117844cd8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-04 16:22:56 -07:00
Zuul
948034e6c1 Merge "router: Use plural form for storage of `--fixed_ip` argument" 2024-03-26 17:34:43 +00:00
Zuul
5f4236d7db Merge "Parse external-gateway argument in separate helper" 2024-03-26 17:34:41 +00:00
Zuul
6373c91a77 Merge " Bug Fix, Default SG Rule Custom SG" 2024-03-19 14:44:00 +00:00
OpenStack Release Bot
cb539bab24 Update master for stable/2024.1
Add file to the reno documentation build to show release notes for
stable/2024.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.1.

Sem-Ver: feature
Change-Id: I13bb45d30d3dff73ca48ad8a2ed8bdc982b62d86
2024-03-18 14:04:27 +00:00
Cyril Roelandt
0970dd4096 image cache clear: fix value of default target
When using the "openstack image cache clear" command, the "clear_cache"
method from the OpenStack SDK is used. It expects its only argument to
be one of "both", "cache" or "queue". However, when passing neither
"--cache" nor "--queue", it is currently passed None as a value. Fix
this by specifying "both" as the default value to be passed.

Change-Id: I17c6e3d435a84b4ba453845086ff3fe272b54f58
2024-03-14 04:03:08 +01:00
Youngjun
a4db11c62e refectoring: remove duplicate declaration
Change-Id: I0d9e3d25bc42df56be31defaea13bbe7aaa21caa
Signed-off-by: Youngjun <yj.yoo@okestro.com>
2024-03-13 10:04:04 +09:00
Cyril Roelandt
76f234eba9 Fix typo in the list of Glanceclient/OSC commands
Change-Id: I9c5cf24e51fa8d4ab1428280f25408391c8556c8
2024-03-12 19:58:33 +01:00
Youngjun
9e4dbd1d82 refectory: remove unreachable code
Change-Id: If12a550451f5aafe3e2fb5aaa0257319ea908fe3
Signed-off-by: Youngjun <yj.yoo@okestro.com>
2024-03-12 16:41:17 +09:00
Zuul
2f9a523765 Merge "reno: Update master for unmaintained/victoria" 2024-03-07 10:13:15 +00:00
Zuul
7e7fb3923d Merge "reno: Update master for unmaintained/wallaby" 2024-03-07 10:13:13 +00:00
OpenStack Release Bot
772c27658c reno: Update master for unmaintained/xena
Update the xena release notes configuration to build from
unmaintained/xena.

Change-Id: I5ffcd8daa4822fddaf48877fc1201847ec5e9340
2024-03-07 08:46:19 +00:00
OpenStack Release Bot
ff4737c1e5 reno: Update master for unmaintained/wallaby
Update the wallaby release notes configuration to build from
unmaintained/wallaby.

Change-Id: I925f6c38bcfe315edfed129dea76d092ec9110b9
2024-03-07 08:45:23 +00:00
OpenStack Release Bot
da09a7c519 reno: Update master for unmaintained/victoria
Update the victoria release notes configuration to build from
unmaintained/victoria.

Change-Id: Ic41670b3f6c9a1b78074319f445e468827590b68
2024-03-07 08:44:17 +00:00
Frode Nordahl
7184e876a5
Add router default route BFD/ECMP options
Add the `--enable-default-route-bfd`, `--disable-default-route-bfd`
`--enable-default-route-ecmp` and `--disable-default-route-ecmp`
options for `router create` and `router set` commands.

Related-Bug: #2002687
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
Change-Id: Ia5a196daa87d29445dc5514dcb91544f9d470795
2024-03-05 16:14:56 +01:00
Dmitrii Shcherbakov
16c695045c
Add support for managing external gateways
This change implements the logic to call the new API for managing
external gateways.

Relevant Neutron core change:
https://review.opendev.org/c/openstack/neutron/+/873593

Co-Authored-by: Frode Nordahl <frode.nordahl@canonical.com>
Related-Bug: #2002687
Change-Id: Ib45f30f552934a0a5c035c3b7fadfc0d522219ba
2024-03-05 16:14:56 +01:00
Frode Nordahl
58ad3cefa7
router: Use plural form for storage of `--fixed_ip` argument
The variable already takes multiple values, let's make it obvious
just by reading the code.

Related-Bug: #2002687
Change-Id: I294ee710d989d7a3a54331fca424e84708a2faab
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
2024-03-05 16:14:19 +01:00
Frode Nordahl
f696aee81d
Parse external-gateway argument in separate helper
This is to prepare for subsequent patches that will add support
for managing multiple gateways.

Related-Bug: #2002687
Change-Id: Ic088dca0b7cd83bd7568d775b4e70285ce72411d
Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
2024-03-05 11:26:15 +01:00
Rodolfo Alonso Hernandez
966051cfe2 Add NUMA affinity policy options "socket"
Added a new port NUMA affinity policy option called "socket".

Depends-On: https://review.opendev.org/c/openstack/neutron/+/910594

Related-Bug: #2052786
Change-Id: Icff9070db68ba83b47b344d56ee93b235383b2f2
2024-02-24 11:15:45 +00:00
James Black
93b73e9b29 Bug Fix, Default SG Rule Custom SG
Currently the Default setting for CustomSG Rule
is set to True, this means all new SGs inherit
these rules, with no way for user to override
this behavior.

Closes Bug: #2054629

Change-Id: Icef7c91654dbced76a5492437e723c4e2a0f3102
2024-02-23 08:31:25 -08:00
Mridula Joshi
2a90a6f07b Adds CLI support for `glance md-object-property-show`
This patch adds a command "image metadef object property show" which
describe a specific metadata definitions property inside an object.

Change-Id: I738e2e3c27c9819290d5a2a8781878b81f03b5f9
2024-02-15 14:16:34 +00:00
Brian Haley
75ed315885 Do not sort subnet dns_nameservers field
When using table output format, the dns_nameservers field
of a subnet is sorted, but it should not be as the order
is important.

Created an UnsortedListColumn() class in subnet.py so the
output is correct.

Updated the unit test accordingly to verify the order is
correct when an entry is removed.

Change-Id: I60a15a944f83549738305dd025db38ff8e165be7
Closes-bug: #2053201
2024-02-14 17:28:04 -05:00
Zuul
2eea916b35 Merge "Adds CLI support for `glance md-object-update`" 2024-02-14 12:01:10 +00:00
Mridula Joshi
3cd5ad2c1b Adds CLI support for `glance md-object-update`
This patch adds a command "image metadef object update" which
update metadata definitions object inside a namespace.

Change-Id: I2dd8f54f9224abda5adc7a1b6a1c270c49d473a7
2024-02-13 18:28:00 +00:00
Stephen Finucane
c128ae1969 trivial: Don't ignore missing resources
An openstacksdk 'find_foo' proxy method will return None by default if a
resource is not found. You can change this behavior by setting
'ignore_missing=False'. We were doing this in most, but not all cases:
correct the issue.

In the event of calling 'image delete' with multiple images, it will no
longer fail on the first missing image and will instead attempt to
delete remaining images before failing.

Change-Id: I1e01d3c096dcaab731c28e496a182dd911229227
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-02-13 16:33:56 +00:00
Zuul
99c7f583df Merge "pre-commit: Bump linter versions" 2024-02-07 19:51:19 +00:00
OpenStack Release Bot
07c05d8ae5 reno: Update master for unmaintained/yoga
Update the yoga release notes configuration to build from
unmaintained/yoga.

Change-Id: Id5ecff72f0a7ebdcab32964480dc351b96beb8b0
2024-02-05 16:14:41 +00:00
Zuul
0e5802c945 Merge "trivial: Fix typo" 2024-02-02 12:38:41 +00:00
Zuul
c8ecba2a9e Merge "image: Fix the default description of image visibility" 2024-02-02 11:23:51 +00:00
Stephen Finucane
d0f81f5717 trivial: Fix typo
Change-Id: I936cc07af38bdd5d389cc5edafa93861f8fac3a6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-02-02 10:14:29 +00:00
Zuul
c29e05764b Merge "Add "hardware_offload_type" attribute to "port"" 2024-01-30 12:16:43 +00:00
Zuul
f0f811ce4b Merge "[codespell] fix typos in doc,tests and help messages" 2024-01-30 09:34:00 +00:00
Zuul
a00cc44acc Merge "doc: Drop tripleoclient" 2024-01-30 09:31:45 +00:00
Zuul
6e246f1566 Merge "doc: Remove RSD subcommand" 2024-01-30 09:31:43 +00:00
Zuul
b30135457a Merge "doc: Remove Searchlight subcommands" 2024-01-30 09:31:42 +00:00
Zuul
432f1dee73 Merge "doc: magnumclient provides a OSC plugin" 2024-01-30 08:11:49 +00:00
Takashi Kajinami
49ad528266 doc: magnumclient provides a OSC plugin
The magnumclient library now provides an OSC plugin. So update
the document accordingly.

Change-Id: Ie828f005a38a511bb0f34ab86cbf97e4a3aae2fe
2024-01-29 23:20:07 +00:00
Zuul
5435f11dd0 Merge "image: Trivial fixes" 2024-01-29 19:41:46 +00:00
Stephen Finucane
8a63b51039 image: Trivial fixes
Mostly stylistic, with the exception that we now allow deleting multiple
metadef properties in a given namespace.

Change-Id: Ib0c243f0d647ce74c0165ee666beed6eb5d5c5a7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-01-29 13:53:34 +00:00
Rafael Weingärtner
2ed10e9a72 Introduce schema_version in the federated attribute mapping API
Depends-On: https://review.opendev.org/c/openstack/keystone/+/739966
Change-Id: I276ebd49094368dd823e50ff11a6e65fa2a6dcfb
2024-01-29 08:50:48 -03:00
Zuul
dc8d9d3541 Merge "Adding CLI command for `glance member-get`" 2024-01-26 17:37:15 +00:00
Zuul
9cb8e4c3b5 Merge "Explicitly specify namespace fields for output" 2024-01-26 17:37:11 +00:00
Rodolfo Alonso Hernandez
0725bb474c Add "hardware_offload_type" attribute to "port"
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/892771
Related-Bug: #2013228

Change-Id: I2c6fd434be4ae8cc41edf45fefe150a41cbfe0bd
2024-01-24 14:33:23 +00:00
Rajesh Tailor
a1f7bd28e6 Add support for showing requested az in output
This change adds support for showing the availability zone
requested during instance create in server show and server
list --long output.

Depends-On: https://review.opendev.org/c/openstack/nova/+/904568
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/904490
Change-Id: I1772e06b4f043ef3118f036f3908ec70515144bd
2024-01-24 19:08:29 +05:30
Zuul
03da934605 Merge "Revert "Temporarily drop aodhclient from doc build"" 2024-01-23 17:47:41 +00:00
Stephen Finucane
9c2e5d5648 pre-commit: Bump linter versions
We also migrate to the native hacking pre-commit hook.

Change-Id: Idb5a825c20cb7f189997a4d6c3a9a88218fdb335
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-01-23 11:47:52 +00:00
Takashi Kajinami
03044eaf11 doc: Add manilaclient as a OSC plugin
The manilaclient library now provides OSC plugin for share API access.

Change-Id: I0afdf4d48e16191283916065719ba7cf623e7377
2024-01-22 10:01:13 +09:00
Takashi Kajinami
f2387601ee Revert "Temporarily drop aodhclient from doc build"
This reverts commit 860d636047.

Reason for revert:
The issue with aodhclient and latest pyparsing was fixed by [1].

[1] 3a36ed1774ba0bbb3ad6a3716c6c014246bc9613

Change-Id: I461edafc5be7b3afbde485f1620bff71e178b078
2024-01-21 14:20:52 +00:00
Takashi Kajinami
d4acd4b6d3 doc: Drop tripleoclient
The TripleO project has been deprecated and its master is no longer
maintained. The complete project retirement is now on-going.

Change-Id: If7b390fc2230c16ef138ceb4a7bc5d97dcf790e6
2024-01-21 13:16:24 +00:00
Takashi Kajinami
82c3474323 doc: Remove RSD subcommand
The python-rsdclient library hasn't been updated for 5 years and is no
longer maintained.

Change-Id: Ia378a9001836bbaa4f679dddf1ed743e4332a72e
2024-01-21 22:12:08 +09:00
Takashi Kajinami
810f691904 doc: Remove Searchlight subcommands
... because the project was retired. These were overlooked during
cleanup[1].

[1] a79e7db4ae

Change-Id: I8eeeb3ea8c49ed3c9405f54f0dd3be0402cd2a8a
2024-01-21 13:02:56 +00:00
Zuul
50544ae78b Merge "compute: Fix formatting of 'server show'" 2024-01-18 14:12:32 +00:00
Mridula Joshi
1517f4af21 Explicitly specify namespace fields for output
Rather than excluding the few fields we don't want, explicitly indicate
the ones we do want.

Note that this is a problem in the tests for virtually all commands
that will be seen as the SDK continues to evolve and new fields are
added to existing resources.

Change-Id: Ia8d487e1e7804fa177fce46497c0202aed8acb08
2024-01-16 15:14:55 +00:00
Ghanshyam Mann
37b4201428 Update python classifier in setup.cfg
As per the current release tested runtime, we test
python version from 3.8 to 3.11 so updating the
same in python classifier in setup.cfg

Change-Id: Ic137b2eecee65d43afeca2c936e195a8652237af
2024-01-11 15:37:00 -08:00
Zuul
4bafc32616 Merge "Fix clearing of dns_domain and description on a network by setting to empty strings" 2024-01-10 18:31:42 +00:00
Zuul
b740f2f6bd Merge "Correct error message for "create server --wait"" 2024-01-10 16:09:48 +00:00
Bence Romsics
cc2a0bab24 Correct error message for "create server --wait"
Error message should say "Error creating server" and not "unshelving".

Change-Id: I49dc6160f47a13d38128b3da1ba16437bd089c86
Closes-Bug: #2048896
2024-01-10 14:19:35 +01:00
Brian Haley
e7bc3d9b82 Fix --use-prefix-delegation subnet create argument
The --use-prefix-delegation argument when creating a
subnet should not take an argument of True/False, it
should simply trigger the code to set subnetpool_id
value to 'prefix_delegation'. Change action to correct
this.

Added unit test to cover missing checks.

Related-bug: #2028159
Change-Id: Ib7ee80100327b8611d4a354c7f4eb0e696c953da
2024-01-09 17:23:03 -05:00
Mridula Joshi
93b2e66d2d Adding CLI command for `glance member-get`
This patch adds a command ``image member get`` which displays
a particular member associated to the image.

Change-Id: I48d3151f8e204e1eb5cfff67ce1e333d1cfb9322
2023-12-20 05:03:40 +00:00
Zuul
d09aec3459 Merge "trivial: Place positional opts last" 2023-12-14 16:17:03 +00:00
Zuul
c75a5a8373 Merge "network: Clarify purpose of default sg rules" 2023-12-14 16:17:01 +00:00
Stephen Finucane
be3d438ed2 trivial: Place positional opts last
Change-Id: I5479e71223c8c224e0bba387348e740c997cc7bf
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-14 12:31:26 +00:00
Stephen Finucane
1b6b639c9f network: Clarify purpose of default sg rules
These only apply to newly created default security groups i.e. when you
create a new project. They do not apply to existing default security
groups.

Change-Id: Ie01bf47dd8a0392354d17d984b41c1fad504e659
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-12-14 12:30:03 +00:00
Rajat Dhasmana
ea254061c8 Doc: Fix volume snapshot commands
The snapshot commands use the "volume " prefix which was missing
from the doc. This patch adds it.

Change-Id: I2acf28eff78fb8419a4c4f00395355a6ca44a576
2023-12-13 15:10:25 +00:00
Pavlo Shchelokovskyy
f3207bdf3f Fix availability zone list command
there are two problems currently:
- SDK's `availability_zones()` returns a generator that raises errors
  only when actually accessing its items
- the error raised is the sdk exception, not nova one, and thus is not
  being handled correctly

As a result, currently nova AZs can not be listed by non-admins.

Story: 2010989
Task: 49220
Change-Id: Ia299faea85857d3fc3a9b539800f3483f84ccbc0
2023-12-07 16:24:34 +00:00
Rajat Dhasmana
c657047d7e volume list: Don't call nova if no volume is attached
Currently 'openstack volume list' calls nova to resolve server UUIDs
to server names. This is not required if:
1. no volume is attached to an instance
2. no volume exists in deployment

This patch fixes this by checking volume statuses and, if any volume has
status 'in-use', we will call nova to resolve server names.
Note that we don't check for 'reserved', 'attaching', 'detaching'
states since those are transition states and doesn't guarantee that
the volume is actually attached to the instance.

Change-Id: Ic4d89db69244d3fba44d4b69c79b3e7632ee3d53
2023-12-06 17:39:03 +05:30
Zuul
2642b070db Merge "compute: Add 'server create --server-group' option" 2023-12-05 18:43:15 +00:00
Zuul
2957f28ff1 Merge "tests: Enable logging fixture" 2023-12-05 18:43:13 +00:00
Zuul
ca0473815f Merge "tests: Remove prints" 2023-12-05 18:43:11 +00:00
Zuul
ac2bd42372 Merge "test: Ignore 'OS_' environment variables" 2023-12-05 18:43:02 +00:00
Zuul
b458e78694 Merge "tests: Remove unused flag" 2023-12-05 18:43:01 +00:00
Zuul
519596dcb7 Merge "parseactions: Use ArgumentError, not ArgumentTypeError" 2023-12-05 18:42:59 +00:00
Zuul
b1548d9f3c Merge "Remove unnecessary file" 2023-12-05 18:35:48 +00:00
Zuul
2d32d87c16 Merge "Use CommandError, not SystemExit, to exit" 2023-12-05 18:35:47 +00:00
Zuul
0ac2e2f630 Merge "compute: Address bug in shelve offload logic" 2023-12-05 18:15:08 +00:00
Zuul
1da22d0de4 Merge "tests: Handle missing extensions in network tests" 2023-11-29 18:19:43 +00:00
Florian Streibelt
ce0765facb
Fix clearing of dns_domain and description on a network by setting to empty strings
After setting a default dns_domain on a network

 openstack net set --dns-domain 'example.com.' <NETWORKID>

the setting could not be reverted back to an empty string using

 openstack net set --dns-domain '' <NETWORKID>

and the call also does not emit any error.

The same is true for the description of a network.

Reason was using the parsed argument directly as a condition instead of
comparing against None -- dropping the empty string as valid value.

The name parameter already accepted an empty string.

This change also adds a testcase for dns_domain, description and the
network name parameter, checking if the empty string is forwarded.

Change-Id: Ia7b9738205002b028c19e4f397411c86469cba1a
2023-11-24 12:36:07 +01:00
Zuul
127b49d45e Merge "tests: Check for DHCP agents first in DHCP test" 2023-11-22 13:46:42 +00:00
Zuul
19896ec720 Merge "Adds command `image metadef object delete`" 2023-11-22 11:05:26 +00:00
ArtofBugs
6d3490ed7c tests: Handle missing extensions in network tests
Some tests still assume extensions are enabled; those tests are now skipped if the extension is not enabled. Change I25b8811fe09f2a4a9fc20ca5459f5a404b88a337 addressed some but not all of these.

Change-Id: If36550650f143a7efe4190e60961c51a8cd20fb3
2023-11-21 09:50:51 -08:00
Stephen Finucane
e44d8017ec tests: Check for DHCP agents first in DHCP test
If there are no agents with type=dhcp, the neutron-dhcp-agent service is
likely not enabled on the deployment.

Change-Id: I1253f35e71cf996c559f2a2d8d1d8cde6b41a519
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-21 10:31:01 +00:00
Rajesh Tailor
71839eb5fa [codespell] fix typos in doc,tests and help messages
Change-Id: I4823782daa1af3872bc22603147e3073152cc777
2023-11-21 11:31:07 +05:30
Mridula Joshi
5d1afcee68 Adds command `image metadef object delete`
Change-Id: Ib94b7ba625ca0679ae4ae841e217ea251baff371
2023-11-17 10:46:35 +00:00
Stephen Finucane
e9d3a7bb13 test: Ignore 'OS_' environment variables
Our functional tests are inherently dependent on 'clouds.yaml' files.
The presence of 'OS_*' environment variables can cause weird test
failures. Simply don't pass them through to our test environment.

Change-Id: I7d24cdff5f1f5798118816b12d7398b87a5f5ed4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:41:13 +00:00
Stephen Finucane
c08d6e0391 parseactions: Use ArgumentError, not ArgumentTypeError
If you use the former, you get a pretty error message when there's a
failure. If you use the latter, you get an ugly traceback when used with
the '--debug' flag.

Without this change:

  $ openstack flavor create ... --property '' foo
  ...
  Traceback (most recent call last):
    File "/tmp/venv/lib/python3.11/site-packages/cliff/app.py", line 402, in run_subcommand
      parsed_args = cmd_parser.parse_args(sub_argv)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 1862, in parse_args
      args, argv = self.parse_known_args(args, namespace)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 1895, in parse_known_args
      namespace, args = self._parse_known_args(args, namespace)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 2107, in _parse_known_args
      start_index = consume_optional(start_index)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/argparse.py", line 2047, in consume_optional
      take_action(action, args, option_string)
    File "/usr/lib64/python3.11/argparse.py", line 1971, in take_action
      action(self, namespace, argument_values, option_string)
    File "/tmp/venv/lib/python3.11/site-packages/osc_lib/cli/parseractions.py", line 45, in __call__
      raise argparse.ArgumentTypeError(msg % str(values))
  argparse.ArgumentTypeError: Expected 'key=value' type, but got:
  clean_up CreateFlavor: Expected 'key=value' type, but got:

With this change:

  $ openstack flavor create ... --property '' foo
  ...
  usage: openstack flavor create [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN]
                                 [--noindent] [--prefix PREFIX] [--max-width <integer>]
                                 [--fit-width] [--print-empty] [--id <id>]
                                 [--ram <size-mb>] [--disk <size-gb>]
                                 [--ephemeral <size-gb>] [--swap <size-mb>]
                                 [--vcpus <vcpus>] [--rxtx-factor <factor>]
                                 [--public | --private] [--property <key=value>]
                                 [--project <project>] [--description <description>]
                                 [--project-domain <project-domain>]
                                 <flavor-name>
  openstack flavor create: error: argument --property: Expected 'key=value' type, but got:
  clean_up CreateFlavor:

Change-Id: I9e78b35ad9d016d7a33655141ec579397c5344c0
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:33:19 +00:00
Stephen Finucane
3057997cae Remove unnecessary file
This is testing things now found in osc-lib. Remove it.

Change-Id: Iccbd540fa340c77a957486d16d352d3fe4c3ddb2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:29:06 +00:00
Stephen Finucane
432698fea2 Use CommandError, not SystemExit, to exit
Change-Id: Id2bcc18420b17cf3afed5584ef5104c3ef413830
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:28:49 +00:00
Stephen Finucane
885f5912eb compute: Address bug in shelve offload logic
We were reusing a variable from a previous loop, which meant this would
never work with multiple servers. Correct the mistake.

Change-Id: I52246e183fb2cf0d855d92058dd305b48783589d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-15 11:26:02 +00:00
Stephen Finucane
900fad5360 tests: Remove unused flag
Nothing is setting 'merge_stderr'. It looks like a carry-over from the
legacy clients.

Change-Id: I32b65830e11b27ba83dfba002bf996af561b0768
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-14 12:19:06 +00:00
Stephen Finucane
89a8f72960 tests: Enable logging fixture
Quieten the output of our test runs significantly.

Change-Id: Ie32c919bb987eb0b9bc4c5b2ec54ee20a6841c03
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-11-13 17:31:07 +00:00
Stephen Finucane
d0d4077e1d tests: Remove prints
Change-Id: I35adac1199769fd73978b6457044191d02bb5bd4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-13 17:31:07 +00:00
Stephen Finucane
1678f87d7a tests: Handle missing extensions in network tests
This is mostly a case of skipping tests where the extension is missing,
but some tests are updated to remove a reliance on optional tests.

Change-Id: I25b8811fe09f2a4a9fc20ca5459f5a404b88a337
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-12 10:35:38 +00:00
Stephen Finucane
c251cb89a5 tests: Fix API extension check
The check for extensions was not using a machine readable format for
output. This meant an API check could match on a substring, e.g. a check
for 'qos' would match on 'qos-specs'. Address this issue by switching
our command invocation to use JSON output and migrating the check
function from the general base class to the networking base class.

Change-Id: Idc6dc54503031ddf3e148f50ed53ad8898f7a7e3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-12 10:34:41 +00:00
Zuul
7dbe6e6d3d Merge "tests: Centralise check for networking service" 2023-11-10 13:55:41 +00:00
Stephen Finucane
20490dcd10 tests: Centralise check for networking service
No point duplicating this across functional tests.

Change-Id: I9502be8b4e718885c6f854c7f5b19f6cacf51055
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-10 10:06:58 +00:00
Zuul
1ac5d63c53 Merge "Adds command `image metadef object list`" 2023-11-08 18:01:44 +00:00
Zuul
8aee1a2889 Merge "Adds command `image metadef object show`" 2023-11-08 18:01:42 +00:00
Zuul
71f232aafa Merge "Add "image metadef property set" command" 2023-11-08 10:46:35 +00:00
Mridula Joshi
4bb6efa8f8 Adds command `image metadef object list`
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/858350
Change-Id: I0691f7519e8fb9f01836e6232e0bcebd2c428ac3
2023-11-08 10:44:31 +00:00
Masayoshi Mizuma
a3730afe2e image: Fix the default description of image visibility
The default image visibility was changed to 'shared' in API v2.5. Fix
the help information of image visibility, centralizing options in the
process.

Change-Id: Ib3017fc4f618c1e14e3b26b616ff9374d0e24eaa
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-08 10:41:07 +00:00
Zuul
c09c1fbf51 Merge "Add "image metadef property delete" command" 2023-11-08 10:35:38 +00:00
Mridula Joshi
78ef009a3a Adds command `image metadef object show`
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/858350
Change-Id: I97bcb0ccee9d25fb26475ec9e10660556e6072a6
2023-11-08 09:57:02 +00:00
Zuul
0439f17ed3 Merge "image: Add support for cache commands" 2023-11-07 09:31:24 +00:00
Zuul
e54bdfbba3 Merge "Adds command `image metadef object create`" 2023-11-07 09:31:21 +00:00
Zuul
0b78dfe30b Merge "Add pagination helpers" 2023-11-07 08:47:24 +00:00
Zuul
30462f57d4 Merge "Removed start, end time format. Before fix, openstack usage list command resulted 'str' object has no attribute 'isoformat' error." 2023-11-07 08:38:13 +00:00
Zuul
ce63fd88da Merge "volume: Migrate 'volume group snapshot' commands to SDK" 2023-11-04 00:10:08 +00:00
Stephen Finucane
c7e3529dea Add pagination helpers
Add some pagination helpers to configure pagination parameters for
various commands. Two pagination schemes are supported, based on what we
currently support across OSC commands: marker-based pagination and
offset-based pagination.

Change-Id: I551bb4c3ff0568c6df5244a1d0f0669497bee58f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-11-03 23:16:18 +00:00
Stephen Finucane
7708106cf0 compute: Add 'server create --server-group' option
Add an alias for requesting a server group. This is more syntactic
sugar, though it comes with the added bonus of letting users request a
server group by name instead of just ID.

Change-Id: I3d9a7ce04a02fdf374b7a8082618eccdea8c3217
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-02 17:48:03 +00:00
Zuul
8b253cbda8 Merge "Update the docker image to python3.11" 2023-11-01 10:49:31 +00:00
Mridula Joshi
f8c708900c Adds command `image metadef object create`
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/858350
Change-Id: Ie74231c823d6128d149d5f01c90a66ed3afa3d1a
2023-11-01 07:15:59 +00:00
Clark Boylan
4673c89154 Update the docker image to python3.11
OpenDev is trying to get consumers of these images to update to newer
iterations so that old images can be dropped from the build list. OSC
is successfully running voting python3.11 unittest jobs at this point.
This should make it safe to update the Docker container image for OSC
to python3.11 without risk of regressions.

Making this update should bring some (small) performance updates as
py311 is generally quicker than py310. As mentioned before it will also
allow OpenDev to reduce the set of images that are being built.

Change-Id: I01e3c9e27f92205979ea6562b23f0f7f3b431728
2023-10-31 18:44:00 +00:00
Zuul
dfcb8b0ee7 Merge "trivial: Make better use of argparse" 2023-10-31 15:00:24 +00:00
Zuul
5883bcecd4 Merge "volume: Add alias for volume type AZs" 2023-10-31 15:00:20 +00:00
Zuul
e13f948ae5 Merge "volume: Add aliases for common volume type props" 2023-10-31 15:00:18 +00:00
Zuul
456c66ff63 Merge "volume: Allow filtering volume types by properties" 2023-10-31 14:53:36 +00:00
Zuul
d735b6cc07 Merge "volume: Support same_host, different_host hint as list" 2023-10-31 14:53:35 +00:00
Zuul
8b019fa7ea Merge "Update from storyboard to launchpad pt. 2" 2023-10-31 12:57:08 +00:00
Zuul
c258d196a4 Merge "Migrate resource filter commands to SDK" 2023-10-31 10:25:55 +00:00
Zuul
43cec266d9 Merge "Add "image metadef property create" command" 2023-10-31 09:28:54 +00:00
Zuul
b6baa2e398 Merge "Add "image metadef property show" command" 2023-10-31 09:28:52 +00:00
Zuul
e76a66657f Merge "Add "image metadef property list" command." 2023-10-31 09:28:47 +00:00
Dr. Jens Harbott
692ee752b6 Update from storyboard to launchpad pt. 2
This was missed in [0]. Also update the mailing list link after it moved
to mailman3.

[0] Iaf93c892d211fd7465395d8830f56c2977a88f8b

Change-Id: I91168713a854be0c4348bab3fa34f4b1a924f451
2023-10-31 10:19:43 +01:00
Zuul
5711998603 Merge "Switch back to Launchpad" 2023-10-31 08:58:30 +00:00
Johannes Kulik
60a0e379a4 volume: Support same_host, different_host hint as list
When creating a volume, the scheduler hints can be supplied as strings.
The "same_host" and "different_host" hints can also be supplied as a
list if affinity/anti-affinity to multiple volumes is requested [0]

The previously-used `KeyValueAction` only supplies strings as values - the
last one if multiple --hint contain the same key. An alternative already
used in `CreateServer` would be `KeyValueAppendAction`, but only a subset of
the scheduler hints accept lists, so we cannot use that in general.

Therefore, we create `KeyValueHintAction`. It contains both a
`KeyValueAction` and a `KeyValueAppendAction` object and calls the
appropriate action based on the beginning of the given values as defined
in `APPEND_KEYS`.

[0] d96b705774/cinder/api/schemas/scheduler_hints.py (L31-L65)

Change-Id: Ida7f4662dc9fea24510758541fd4f2622b73bf31
2023-10-31 09:22:25 +01:00
Rajat Dhasmana
ae10851a68 Migrate resource filter commands to SDK
This patch migrates ``block storage resource filter list`` and
``block storage resource filter show`` commands to SDK.

Change-Id: Ibc50963954418aab0be35e120f8dcfadbe4020b8
2023-10-30 12:06:14 +05:30
cw0306-lee
6b9f40576d Removed start, end time format. Before fix, openstack usage list command resulted 'str' object has no attribute 'isoformat' error.
story: 2010943
task: 48951
Change-Id: I9ee3384cc6df9ca768ac664f01472244dd8e3267
2023-10-30 14:17:39 +09:00
Zuul
53e7d713f0 Merge "Migrate volume backend commands to SDK" 2023-10-27 17:35:06 +00:00
Stephen Finucane
2a2a6e1781 trivial: Make better use of argparse
Change-Id: Ib76c0d18bf5e44bfb4dcd9d729d9a1c5635cdba7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-10-27 17:58:36 +01:00
Stephen Finucane
a3410cd4f7 volume: Add alias for volume type AZs
Another quality of life improvements. The key for this one is weird and
the whole thing is a little more involved, hence why it's kept separate.

Change-Id: I75aa85f27905104dc84fffe823c01b4c90a6a822
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-10-27 17:58:13 +01:00
Stephen Finucane
e0c7cef434 volume: Add aliases for common volume type props
Add aliases for the enabling multiattach, caching and replication via
extra spec properties. These are useful since the syntax for setting
each of them is a bit weird and frankly not very discoverable.

Change-Id: I08b51224c66a34a9dcfcffc95847e61d9aac0e7e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-10-27 17:57:39 +01:00
Zuul
491e5b9e9a Merge "tests: Add compute v2 FakeClientMixin" 2023-10-27 16:38:55 +00:00
Zuul
f576cb62b6 Merge "tests: Use consistent shortcut to fake compute client" 2023-10-27 16:38:53 +00:00
Zuul
14a4f89030 Merge "tests: Add volume v1, v2, v3 FakeClientMixin" 2023-10-27 16:23:55 +00:00
Zuul
dd5a21ff02 Merge "tests: Use consistent shortcut to fake volume client" 2023-10-27 16:23:53 +00:00
Zuul
b884e83e37 Merge "tests: Use central SDK client fake" 2023-10-27 16:20:27 +00:00
Stephen Finucane
67bec7785c volume: Allow filtering volume types by properties
Starting in volume API microversion 3.52, it is possible to filter
volume types by extra specs (a.k.a. properties). Even non-admins can do
this for so-called "user visible" extra specs. Make it possible to do
this.

While we're here, the test file is renamed to match the name of the
module under test.

Change-Id: Ia9acc06c0c615bf24e12b63146ea97ac2505f596
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-10-27 16:37:15 +01:00
gtema
5d1d6b5a06 Switch back to Launchpad
Change the links to issue tracker.

Change-Id: Iaf93c892d211fd7465395d8830f56c2977a88f8b
2023-10-25 18:56:25 +02:00
Slawek Kaplonski
7b99b57165 Add support for default security group rule CRUDs
Change-Id: I1c18c2ec5eb4923e1ab8b3fc6199ef6f329b4a4d
2023-10-19 16:04:22 +02:00
Cyril Roelandt
705ecef7a9 Add "image metadef property set" command
Change-Id: I8fbe8ef5b5119fb500df0ed1b6e645ea00eadf01
2023-10-18 14:02:34 +00:00
Cyril Roelandt
9094e540b5 Add "image metadef property delete" command
Change-Id: I2e13b26139424c421ae609804c546a6b42add5a4
2023-10-18 13:27:02 +00:00
Cyril Roelandt
d9c4c43a40 Add "image metadef property create" command
Change-Id: Icb4fab0aef13b28212771da3a3b7c4a0775bb38e
2023-10-18 13:26:15 +00:00
Cyril Roelandt
190f06a963 Add "image metadef property show" command
Change-Id: I326735014dfcb4477b109a99aa31f71b07b91c7b
2023-10-18 12:39:39 +00:00
Cyril Roelandt
5fb922e469 Add "image metadef property list" command.
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/857727
Change-Id: I8f6692e779c4721225052d348b4b947a545bd6c0
2023-10-18 12:39:35 +00:00
Rajat Dhasmana
39a084f91c Migrate volume backend commands to SDK
This patch migrates following volume backend commands to SDK:

volume backend capability show
volume backend pool list

Change-Id: Idded38a5f87d51574426c4ac10c806af52984b7c
2023-10-12 01:14:35 +05:30
Zuul
0fb1cae1a8 Merge "Fix "server create"command with --boot-from-volume" 2023-10-11 15:59:24 +00:00
Zuul
98fbc56603 Merge "Fix --security-group for port list" 2023-10-11 15:59:22 +00:00
Mridula Joshi
c628c2dcd3 image: Add support for cache commands
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/874372
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/874940
Change-Id: I96b95cb93d298602b6d4b0cd35a213478babff5f
2023-10-10 09:28:12 +00:00
Stephen Finucane
912a21a8fd tests: Add compute v2 FakeClientMixin
This ensures we are speccing the compute proxy API.

Change-Id: I7adbf2666d71f222fbd9c1479216f72cb9893348
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
187a454ec0 tests: Use consistent shortcut to fake compute client
This removes the need for a number of base test case subclasses. We use
'compute_client' rather than 'client' to avoid conflicts with clients
for other services.

Change-Id: I430214cd79eca481bd8d8c53bf97eaede6766eb4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
98fb1678bc tests: Add volume v1, v2, v3 FakeClientMixin
This ensures we are speccing the image proxy API, as we did previously
for the network tests in Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758.

Change-Id: I132ccd1170cc903f6edc505926b071170aeaa08c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:32 +01:00
Stephen Finucane
4cabf6f7a2 tests: Use consistent shortcut to fake volume client
This removes the need for a number of base test case subclasses. We use
'volume_client' rather than 'client' to avoid conflicts with clients for
other services.

Change-Id: I28d78f32142bb3a3fde0ba1780c504adc31cc77c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:14:30 +01:00
Stephen Finucane
02cc064258 tests: Use central SDK client fake
Avoid double mocking.

Change-Id: Ic8fadd41f3687eabd3a149681effae6883edb12e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-29 10:12:19 +01:00
Zuul
3c10b01480 Merge "Update branch regexes for tips jobs" 2023-09-28 09:48:22 +00:00
Dr. Jens Harbott
2e09b2bf3e Update branch regexes for tips jobs
Using negative lookahead is deprecated, let the jobs be run simply only
on the master branch for now.

Change-Id: Ia53fffb0a3f61cbf85edd96fbeeb5138a88d4d0a
2023-09-20 07:08:09 +02:00
Christian Rohmann
98b949646c Add is_incremental to ListVolumeBackup
It's of interest which backups are incremental or full. Returning this
information as a column to the list of backups.

Change-Id: I766330228634d5db678df11c23877077a3635372
2023-09-19 22:10:04 +02:00
Zuul
619925e45f Merge "Remove use of oslo.utils" 2023-09-19 13:14:12 +00:00
Zuul
5f4082d046 Merge "Add a warning for resizing servers booted from volumes" 2023-09-19 13:14:06 +00:00
Zuul
7c0bdd5e7e Merge "volume: Deprecate '--detailed' options" 2023-09-19 13:11:32 +00:00
Zuul
cab84d6760 Merge "tests: Explicitly specify port fields for output" 2023-09-19 13:11:31 +00:00
OpenStack Release Bot
2737e063b5 Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: I608edcb863038522677beb8bd2e1eb98c1eec363
2023-09-15 16:03:09 +00:00
Stephen Finucane
fb2e0ced6e tests: Explicitly specify port fields for output
Rather than excluding the few fields we don't want, explicitly indicate
the ones we do want. We were already in-effect doing this in our tests,
so this is simply moving the definition from tests to the main code.

Note that this is a problem in the tests for virtually all commands
that will be seen as the SDK continues to evolve and new fields are
added to existing resources. This is a problem that be solved over
time though, rather than in a big bang commit.

Change-Id: Iaa64e97450f5c73cab2e2c3b0c741aec1495b4f1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-12 08:33:20 +00:00
Stephen Finucane
08551106e6 Remove use of oslo.utils
While a relatively small library, this is one import that we really
don't need. Remove it.

Change-Id: I726f3c3548cbd896588ef0613222e36c529f5bcc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-11 11:02:55 +01:00
Stephen Finucane
8735b862c5 volume: Deprecate '--detailed' options
We use flags, not options with boolean-like values, for boolean
parameters. The affected commands were only introduced recently so this
should have minimal fallout.

Change-Id: I700733e750bff539806af167c9d47cec769c3343
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-09-11 11:02:55 +01:00
Zuul
08faf81d0d Merge "tests: Add image v1, v2 FakeClientMixin" 2023-09-06 12:29:14 +00:00
Zuul
6ae38b2888 Merge "tests: Use consistent shortcut to fake image client" 2023-09-06 12:26:00 +00:00
Zuul
98c62dfbe0 Merge "tests: Remove FakeImagev1Client, FakeImagev2Client" 2023-09-06 12:16:35 +00:00
Zuul
09eb21ea35 Merge "tests: Add network v2 FakeClientMixin" 2023-09-06 12:08:34 +00:00
Zuul
6423b61326 Merge "tests: Use consistent shortcut to fake network client" 2023-09-05 19:35:50 +00:00
Zuul
d69d738c74 Merge "tests: Remove FakeNetworkV2Client" 2023-09-05 19:30:07 +00:00
Zuul
9e2316fd06 Merge "Remove project purge image commands" 2023-09-05 19:30:05 +00:00
Zuul
876c120a9c Merge "Migrate 'extension list' to SDK" 2023-09-05 19:30:04 +00:00
Zuul
5ab1b13d5e Merge "Migrate 'availability zone list' to SDK" 2023-09-05 19:30:02 +00:00
Zuul
16bdb17fee Merge "tox: Bump min_version to 4.3.0" 2023-09-01 10:43:30 +00:00
Zuul
94caaa487d Merge "Migrate backup commands to SDK" 2023-09-01 02:45:27 +00:00
Artem Goncharov
c7c79c9fe4 Propocol release versions properly
On the index page we stopped updating versions table since train. Add
missing entries.

Also small rephrasement in the into on backwards compatibility not to
stick with an ancient release name.
Set oldest release on unreleased page correspondingly.

Change-Id: I4a442708a5b47f573cd2333545531499b9eae0f1
2023-08-31 09:51:41 +00:00
Artem Goncharov
010ef0fdf5 Fix ReleaseNotes build
for some reason (clearly another change somewhere in the Sphinx)
extlinks extension used in the releasenotes is failing when extlink
caption is not having substitues same as in the link itself.

>     title = caption % part
>             ~~~~~~~~^~~~~~
> TypeError: not all arguments converted during string formatting

Now the extension supports setting link capturion to None which works as
we need.

Change-Id: Ie1a61e9b3ee5d727d59525efe34aea696538e2b3
2023-08-31 10:45:01 +02:00
Stephen Finucane
e1a86368bd tests: Add image v1, v2 FakeClientMixin
This ensures we are speccing the image proxy API, as we did previously
for the network tests in Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758.

Change-Id: I09539cbf35444272fb3aaabfecd5d731d1ecc4a8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
28b1267921 tests: Use consistent shortcut to fake image client
This removes the need for a number of base test case subclasses. We use
'image_client' rather than 'client' to avoid conflicts with clients for
other services.

Note that this highlights a minor bug with the 'volume create' command
when using the v1 block storage API and creating a volume from an image.
This is corrected, though it can be assumed that no one is actually
using this code path to say it hasn't been reported in the few years
since the bug was introduced in Ussuri.

Change-Id: I571be27f68bb7669dcb883f3b4799731b4a35479
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
a823228527 tests: Remove FakeImagev1Client, FakeImagev2Client
These no longer makes any sense since all image calls use the SDK proxy
API now.

Change-Id: I48e1d90f9c0dfa904fe37caa0de60d20945f1118
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
a39bde5c3a tests: Add network v2 FakeClientMixin
This ensures we are speccing the network proxy API. Future changes will
do the same for the image proxy API and eventually the compute proxy API
(once everything has been converted).

Change-Id: Ic203964c7dede7dd80ae2d93b8fa1b7e6634a758
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
b25742499a tests: Use consistent shortcut to fake network client
This removes the need for a number of base test case subclasses. We use
'network_client' rather than 'network' for consistency with other
services.

Change-Id: I61f7c43341acf19ae16d06db34e18970297fbb93
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
84dd5b0018 tests: Remove FakeNetworkV2Client
This no longer makes any sense since all network calls uses the SDK
proxy API now.

Change-Id: I0d57d7561b697270b24acd7b8ff62db73a83f49a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
601d9717c2 Remove project purge image commands
This was still using glanceclient-style calls despite us having switched
all image command to SDK way back in 5.2.0 (Ussuri). It therefore hasn't
worked since then, so we remove without deprecation.

Change-Id: Ibea79ea10bb272cba194debfe4bcbaeebf3875b7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:52:23 +01:00
Stephen Finucane
b87b57551b Migrate 'extension list' to SDK
Migrate the block storage aspects of this command to SDK. This means the
'extension list' command, like the 'availability zone list' command
previously, is now using SDK entirely.

While we're here, we also make some fixes to the unit tests for the
network and compute aspects of the command. While we migrated the
network and compute extension commands from neutronclient and novaclient
respectively some time back, we never fully updated the tests. Do this
now.

Change-Id: I631a6a09dfd9d614b1dd7b322dcee8490a52cc43
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/885132
2023-08-28 13:51:34 +01:00
Stephen Finucane
44cf963d8e Migrate 'availability zone list' to SDK
This is a bit of an odd one. Because this is a "common" command, there
are three clients in play here: a compute client, a block storage
client, and a networking client. The networking aspects of this command
are already using SDK though the tests were mistakenly using a fake
version of the legacy neutron client (albeit one with the correct SDK
properties). We were still using legacy clients for the other two.
Correct the networking tests and migrate the compute and block storage
aspects of the command.

Change-Id: I292e1a712bca97e1270e8a97606e02a8a44c2954
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-08-28 13:51:33 +01:00
Zuul
78988d1786 Merge "Add --skip-resource option to project cleanup" 2023-08-26 12:44:20 +00:00
rladntjr4
89e5d67a16 Fix "server create"command with --boot-from-volume
This patch modifes the "server create --boot-from-volume" command
without image option print "'NoneType' object has no attribute 'id'"

story: 2010892
task: 48669
Change-Id: I566f81c285d4ebc1e23ea0762d67492fb6b3bcbe
2023-08-25 23:09:28 +09:00
Stephen Finucane
564e4f76fb volume: Migrate 'volume group snapshot' commands to SDK
Change-Id: Ie49e1f4b63de8b3bc699f7a9ef6eaa72801b9d05
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/892974
2023-08-25 15:09:00 +01:00
Zuul
fd4ed3be8e Merge "doc: Split image command documentation" 2023-08-25 12:08:21 +00:00
Zuul
8a070b852d Merge "docs: Add examples of common auth methods" 2023-08-25 12:08:19 +00:00
Zuul
d10185380b Merge "volume: Make better use of argparse" 2023-08-25 12:08:16 +00:00
Zuul
356bc2566e Merge "volume: Add 'volume type set --private/--public'" 2023-08-25 12:08:10 +00:00
Zuul
0183e7203c Merge "docs: Migrate volume commands to autoprogram-cliff" 2023-08-25 12:08:09 +00:00
Stephen Finucane
194f59bea3 tox: Bump min_version to 4.3.0
tox 4 is significantly faster when it comes to creating virtualenvs and
is far better and detecting e.g. changes to requirements. tox 4.3.0
includes many of the fixes for bugs introduced by tox 4.0 and is a good
default candidate.

Change-Id: I0bb7f75ed3e03965ecd4d260c1299b46dcbf4b1b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-08-25 11:35:16 +01:00
Zuul
29f2444866 Merge "Add the flavor-id option to router create" 2023-08-22 16:05:20 +00:00
Jan Hartkopf
f29e3ccc37 Add --skip-resource option to project cleanup
Story: 2010370
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/878646
Change-Id: I9eb10cfd8612fa9faf2a734a517078b12a9ca3c3
Signed-off-by: Jan Hartkopf <jhartkopf@inovex.de>
2023-08-21 11:47:24 +02:00
Miguel Lavalle
f8f174c458 Add the flavor-id option to router create
The --flavor-id option is added to the router create command. The
flavor_id attribute has been supported by the Neutron API for router
POST operations since a long time ago [0].

Partial-Bug: #2020823

[0] https://review.opendev.org/c/openstack/neutron-lib/+/494289

Change-Id: If88499533a92c09e67b0827d1d64156682a3bb8e
2023-08-17 10:03:28 -05:00
whoami-rajat
bfd6170b03 Migrate backup commands to SDK
This patch migrates the following backup commands to SDK:

* Create Backup
* Show Backup
* List Backup
* Restore Backup
* Delete Backup

Change-Id: Icfadd65b92f4cd343bc327d33e29767bc9b969f9
2023-08-17 11:04:46 +05:30
Rodolfo Alonso Hernandez
335bfdc38f Check the default role list before adding a new one
The default role list now adds "manager" by default. This new
default role was added in Keystone 24.0.0.0rc1, that includes
[1].

[1]https://review.opendev.org/c/openstack/keystone/+/822601

Story: #2010923
Task: #48787

Change-Id: I3eeca1a0296137eef777770bff4993a56e2fcc5c
2023-08-16 00:30:30 +00:00
Mridula Joshi
18a6199ed0 Adding image stores info command
This is an equivalent for ``glance stores-info``.

Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/883493
Change-Id: I15d2c2c523ace1cfb32045328ecee8ce8beea63f
2023-08-10 07:34:19 +00:00
Zuul
7dc1276f40 Merge "Adding `image delete --store and image import info` commands" 2023-08-09 19:01:35 +00:00
Zuul
afdec1d2ca Merge "Add image metadef resource type command 'list'" 2023-08-09 19:01:33 +00:00
Mridula Joshi
b347347986 Adding `image delete --store and image import info` commands
Change-Id: Ia5fc44c6738f8ee3a0781d824c7f7fa458185e0c
2023-08-07 17:13:33 +00:00
Zuul
9846092b33 Merge "Neutron port hints" 2023-08-07 13:27:49 +00:00
Chengen Du
2ae621f098 Add a warning for resizing servers booted from volumes
Story: 2010858
Task: 48521
Change-Id: Ib72da4d2c2b4bfbbdbc1e8302b65d240e4e1d459
2023-08-01 17:36:00 +08:00
Zuul
7ea78b6ef6 Merge "Migrate 'volume summary' command to SDK" 2023-07-24 12:29:14 +00:00
Tony Breeds
deab1a7ad8 Update the underlying python containers to "3.10-bookworm"
The existing 3.9 is based on debian buster and isn't getting security
updates ... or any updates really.  This change updates to a base
container that will get updates for a while.

I picked 3.10 rather than 3.11 as 3.10 is part of the bobcat[1]

[1] https://governance.openstack.org/tc/reference/runtimes/2023.2.html

Change-Id: I606389a81ab189b1abf2c700acf5c5543a09165a
2023-07-18 20:24:53 +10:00
Stephen Finucane
c05be82de0 docs: Add examples of common auth methods
Took me a bit to figure out how to do token auth today. Document it.

Change-Id: I3edce59efd5ca5a6e31eef8c7cf3cf255234c82e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-07-10 13:50:34 +01:00
Stephen Finucane
9cd6204a5d doc: Split image command documentation
This document is growing a bit too big now.

Change-Id: Iadf7f28d2307d1598e378bd49a09e75e1235d779
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-07-06 17:35:56 +01:00
Antonia Gaete
52bf194741 Add image metadef resource type command 'list'
This patch will add ``image metadef resource type list`` using
SDK, output matches glance client output.

Change-Id: I29850abdbb06d5a4eaf8a9a60f565b46f4009f85
2023-07-06 17:27:21 +01:00
Zuul
46431ed203 Merge "Allow multiple --remove-tag in project set" 2023-07-05 11:07:48 +00:00
whoami-rajat
4dfbc5011e Migrate 'volume summary' command to SDK
This patch modifies the existing volume summary call from
cinderclient to SDK.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/884397
Change-Id: I364211a597b6ec155b154fa9d3c67239e750b5ad
2023-07-05 10:04:01 +00:00
Stephen Finucane
717837153b tests: Use a new project for quota tests
These mess with quotas on the main project, which can have knock-on
effects for other tests. Use a new project.

Change-Id: I687ec3a0985eab4d01c918dae73d2fbdc7ac25fa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-06-09 14:35:58 +01:00
Jake Yip
b4ba04698b Allow multiple --remove-tag in project set
The help text for this arg says 'repeat option to delete multiple tags'.
Fix to reflect what docs says.

Also add missing test for this argument.

Change-Id: Ib1069ce7a441c1ff10d2dca05095eb6bf53e7fb6
2023-06-08 18:22:48 +10:00
Zuul
a0971501a9 Merge "tox: Disable E501" 2023-06-06 17:24:00 +00:00
Douglas Mendizábal
bc60e3bb90 Fix "access rule" commands to only use ID
This patch modifies the access rule commands to use only the resource
ID.  The previous logic incorrectly assumed that access rules have a
"name" property, which resulted in unexpected behaviors.

For example, "access rule delete {non-existent-id}" now results in a
"not found" error instead of sometimes deleting an unrelated rule.

Story: 2010775
Task: 48163
Change-Id: Ib5c3b7f86acf1dfe7cc76dfa99fa4c118388bd71
2023-06-05 12:03:15 -04:00
Stephen Finucane
3ba55118eb tox: Disable E501
This is more trouble than it's worth now. Black takes care of this for
us. I wish I'd decided this before the blackify series :(

Change-Id: Ifee786c96b6f0bcd96008fed2b3ed3257d02c07c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-31 17:39:59 +01:00
Bence Romsics
22d1a26d1d Neutron port hints
Introduce the hints port attribute that allows passing in backend
specific hints mainly to allow backend specific performance tuning.

Enable:
  openstack port create --hint ALIAS=VALUE
  openstack port set --hint ALIAS=VALUE
  openstack port unset --hints

Required neutron extension:
  port-hints
  port-hint-ovs-tx-steering

Valid hint aliases and values:
  ovs-tx-steering=hash
  ovs-tx-steering=thread

The same hints in JSON format, as expected by the Neutron API:
  {"openvswitch": {"other_config": {"tx-steering": "hash"}}}
  {"openvswitch": {"other_config": {"tx-steering": "thread"}}}

Change-Id: I4c7142909b1e4fb26fc77ad9ba08ec994cc450b2
Depends-On: https://review.opendev.org/c/openstack/neutron/+/873113
Partial-Bug: #1990842
Related-Change (server side): https://review.opendev.org/c/openstack/neutron/+/873113
Related-Change (spec): https://review.opendev.org/c/openstack/neutron-specs/+/862133
2023-05-24 13:08:15 +02:00
Zuul
f3a51b0051 Merge "trivial: Remove duplicate definitions" 2023-05-18 12:33:01 +00:00
Zuul
90fe18e51b Merge "Dropping the use of 'addFixedIp' server action" 2023-05-18 11:52:56 +00:00
Stephen Finucane
e984ca18a4 trivial: Remove duplicate definitions
These are already set in the 'TestServer' super class.

Change-Id: I90cfd9ff004c59cadc3e760eb120a460687701fe
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-18 10:14:12 +00:00
Zuul
4a62c73992 Merge "volume: Add 'volume qos set --no-property' option" 2023-05-17 23:20:28 +00:00
Zuul
d0a17d48a9 Merge "compute: Fix bug with start/stop server" 2023-05-17 23:20:17 +00:00
Zuul
a2728356af Merge "Allow server rebuild --wait for SHUTOFF servers" 2023-05-17 23:20:11 +00:00
Zuul
938850bae1 Merge "Migrate 'volume revert' command to SDK" 2023-05-17 17:09:20 +00:00
Stephen Finucane
e91844dd0e Dropping the use of 'addFixedIp' server action
Dropping the use of 'AddFixedIp' server action entirely in favour of
creating an interface with a fixed IP using the 'os-interface' API. The
reason for doing this is because this mechanism allows us to request an
explicit fixed IP.

Adds back support for using the --fixed-ip-address argument for users
who use older nova-api versions.

Change-Id: Ieac4b0fbcb38fe7207eaaa6a79e0c6770ee11d80
2023-05-17 17:47:05 +01:00
Stephen Finucane
f43e2ed20d compute: Fix formatting of 'server show'
In change Ic253184ee5f911ec2052419d328260dc4664b273, we switched to
using the SDK for the 'server show' command. There were a couple of
issues with this change, which we address here:

- openstacksdk uses different names for fields than the nova API. We
  opted to output both the original names and the openstacksdk aliases
  in the output. With testing, however, it's become obvious that the
  resulting output is very long and rather unfriendly from a UX
  perspective. We opt to only show fields with their original names.

- A number of fields included in the output are only valid in requests
  and will never be present in responses. These are removed.

- A number of fields are not present in later API microversions or are
  only present under certain conditions. These are removed from output
  when not included in responses.

- The image and flavor fields both had errant logic that resulted in
  unnecessary or incorrect information being show. This logic is
  corrected.

With these changes, the output now resembles the output seen before the
migration to openstacksdk. In the future we may wish to build on this
further and switch from a blacklist model (removing the fields we do not
wish to show from output) to a whitelist model (specifically stating
which fields to show) but that's a change for another day.

Change-Id: I7e3eaa0149bff202c8fd4538356cbc75b4f7e708
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-17 17:24:44 +01:00
Stephen Finucane
6e773f68cf docs: Migrate volume commands to autoprogram-cliff
There are a few outstanding commands. Migrate them in one fell swoop. We
do lose a small bit of information about commands that are only
supported in block storage API version 2.0 or later, but who cares about
block storage API version 1.0 these days?

On a related note, we also use the 'openstack.volume.v3' entrypoint
rather than the v2 one since that's more relevant nowadays and the code
is pretty much identical.

Change-Id: Ide9d65596847d3f855981ff4ec57eeaeea6667a7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-17 16:50:23 +01:00
Stephen Finucane
629eb33c4d volume: Add 'volume qos set --no-property' option
Supporting "--no-property" option will apply user a convenient way to
clean all properties of volume qos in a short command. The patch adds
"--no-property" option in "volume qos set" command and update related
test cases and docs.

Change-Id: I1fb5b4f0a923bbf557a3af3f63809bde9e84ffd4
2023-05-17 16:50:16 +01:00
Stephen Finucane
6dcef7c3ec volume: Make better use of argparse
Change-Id: Ifeab60aaf18a9163465d4968c53e3ed66dad769b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-17 16:38:56 +01:00
Takashi Kajinami
83f5c8033f volume: Add 'volume type set --private/--public'
We also rename the test file and fixup some of the tests.

Change-Id: I3731255648dc91c023a1390c3b37e68b6608f850
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
Story: 2008478
Task: 41518
2023-05-17 16:38:38 +01:00
Stephen Finucane
0a63f8603e compute: Fix bug with start/stop server
A mistake was introduced during the conversion from novaclient to SDK in
change I5ebfa6b2468d5f20b99ea0eab1aea9377be09b8c. Fix the issue and add
functional tests to prevent it being reintroduced.

Change-Id: I6b314eab31bcf452e88b8b6a239ac2e296497cb9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Story: 2010750
Task: 48004
2023-05-17 15:59:33 +01:00
Pavlo Shchelokovskyy
417a7ad203 Allow server rebuild --wait for SHUTOFF servers
currently the command is waiting only for ACTIVE server status,
but if the server was SHUTOFF before, it will be SHUTOFF after
rebuild as well, so the command is stuck in waiting forever.

Additionally, we now also pre-validate the server status on client side,
and raise an error if the server to be rebuilt is not in ACTIVE, ERROR
or SHUTOFF state.

Change-Id: If90a4bbba9a7ecd972f8b594c52fee4f75a0ae5e
Co-Authored-By: Oleksiy Molchanov <omolchanov@mirantis.com>
Story: 2010751
Task: 48005
2023-05-17 11:38:37 +00:00
Stephen Finucane
31ae635ffe tests: Use SDK objects where expected
We had not migrated a number of tests to use SDK objects instead of fake
novaclient-like objects when migrating the commands themselves. Address
this now.

Change-Id: Ib0da07fd9d793968b111986bd36a6d4311469d4e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-16 16:55:08 +00:00
Stephen Finucane
19be070204 tests: Remove unnecessary nesting of compute resources
Change-Id: I27326b8f2e0d84d3ef2c2fbdcb5c96a5ac1d79e4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-16 16:21:44 +01:00
Stephen Finucane
347b444feb tests: Reorder compute fakes
This will make future changes slightly less complex.

Change-Id: Ia69fd9d05796cce5ed48a8d12902cb54caec9779
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-16 16:21:02 +01:00
whoami-rajat
aaeda25e28 Migrate 'volume revert' command to SDK
This patch modifies the existing revert volume to snapshot call
from cinderclient to SDK.

Change-Id: Iaa9708ebae5d6ab3dfc73e4e2376af32ed098688
2023-05-16 17:38:10 +05:30
Stephen Finucane
3c9afe69bb pre-commit: Enable black
Since our pep8 tox env now runs pre-commit, we can ensure that black
styling will be maintained.

Change-Id: Ifad1d67a83c4979b4f4de71de0124613d1133560
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
229791cdb4 Ignore black changes
Add a .git-blame-ignore-revs file to ignore the black changes. File was
generated with the following command:

   git log --pretty=format:"%H  # %s" --no-merges --grep='Blacken'

Change-Id: I4c5c06a8d194cce4d490dc2b01040c68853451c2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
d3f4a3d7f5 Blacken everything else
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I356643d06b2cd408ccaedfe02b858aea55388949
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
a6f81a736c Blacken openstackclient.api
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I1df5bc4c35f02147fe5ac5b4073f0e01e7d51c2f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
7d80f9e962 Blacken openstack.common
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: Ifcb3c798666d74d596b8ecb3d6d507f782de7ba5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
7ca43885c2 Blacken openstackclient.image
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I6420ec6fd550903b03083b9b1f8391511913c86f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
329296cedd Blacken openstackclient.object
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I6658e76d7d1f93149f24fcab28d593195b37779f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
aed521d426 Blacken openstackclient.identity
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I2eeade1ce6653be8e9179ecc40105182c5ff5f16
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
6475dc58e8 Blacken openstackclient.network
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I8048746dbc2ef0cb582f68934734db4c1153d779
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
35ba1d8f13 Blacken openstackclient.volume
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: Ic318617c67ab7ce6527f9016b759a1d4b0b80802
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
28ffa2bf9f Blacken openstackclient.compute
Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: I9af45c062d179ab3dc2a5e969e1c467932753a2b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:30 +01:00
Stephen Finucane
5cb16aebcc Use pre-commit for 'pep8' tox target, bump versions
We want to bump the versions of hacking, but doing so requires changes
in two places: '.pre-commit-config.yaml' and 'tox.ini'. This is silly:
we can simply use tox to handle pre-commit and leave all other
dependencies to pre-commit. Do this, migrating bandit to pre-commit and
bumping the other dependencies in the process.

We remove the 'fast8' target and tool, since pre-commit is plenty fast
here.

Change-Id: Ifdc582ecc3b4479ea9ed9abcb16577c6e8b2f5c1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:51:00 +01:00
Stephen Finucane
379db31ea2 Address pre-commit issues
We'd like to use pre-commit as our 'pep8' target. Before we do that, we
need to address some issues that have crept in over the time since
pre-commit was first added.

Change-Id: I3bb383a00a44007eaa241e037e38aea16bd517b2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-05-10 10:48:53 +01:00
Zuul
43f0e1090a Merge "compute: Generate SSH keypairs ourselves" 2023-05-04 15:06:03 +00:00
Zuul
83016780c7 Merge "Silence warnings from openstacksdk" 2023-05-03 16:51:35 +00:00
Stephen Finucane
2454636386 compute: Generate SSH keypairs ourselves
Starting with the 2.92 microversion, nova will no longer generate SSH
keys. Avoid breaking users by generating keypairs ourselves using the
cryptography library, which was already an indirect dependency through
openstacksdk.

Change-Id: I3ad2732f70854ab72da0947f00847351dda23944
Implements: blueprint keypair-generation-removal
2023-05-02 12:18:52 +01:00
Zuul
a2f877f70c Merge "Migrate 'server event *' commands to SDK" 2023-04-21 17:30:11 +00:00
Huda Irshad
737540cca0 Migrate 'server event *' commands to SDK
This one is tricky since the ServerAction resources includes a nested
ServerActionEvent resource which requires a custom formatter in order
for things to render as expected.

Change-Id: I3d24851303222af9efcee8d7e1565278b1018efd
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
2023-04-20 12:09:59 +01:00
Artem Goncharov
a675c61e46 Fix pep issue in the network service provider
pep gods started complaining (correctfully) about spacing in the old
command. Apply `black -l 79` on the file to make it looking nice and
passing checks.

Change-Id: I716f6a1496fc552b32809c7eb744283f3a3cd5a4
2023-04-20 11:15:37 +02:00
Mridula Joshi
16c78fef15 Adding `image import` command
Change-Id: I7254d30431894879c8bd20e2263d83b12c99d5c8
2023-04-12 09:42:43 +00:00
Stephen Finucane
23da7b73a2 Silence warnings from openstacksdk
OSC has historically relied on project-specific clients like novaclient
for library bindings. These did not support auto-negotiation of
versions. Instead, users were advised to set the requested microversion
to e.g. '2.latest' to opt into the latest API version supported by the
client.

We're slowly migrating everything to SDK which *does* support
auto-negotiation (well, of sorts). This makes versions like '2.latest'
unecessary and SDK correctly warns the user about this.

  You have a configured API_VERSION with 'latest' in it. In the context
  of openstacksdk this doesn't make any sense.

Unfortunately, we have not yet migrated all commands to SDK, meaning we
have a mix of SDK and legacy client-based commands. So long as there are
any command using the legacy client, we can't insist on users removing
this configuration. This makes the warning both annoying and something
the user can't do anything about. We also don't want to remove the
warning from SDK so instead we opt to filter it out, along with all
other warnings from openstacksdk (which similarly a user can't do
anything about).

Change-Id: If8a7cf9bc876f84864d66f5aed5f2f61c5d0696a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-04-11 16:45:56 +02:00
Stephen Finucane
864f51f427 compute: Migrate 'reboot server' to SDK
Change-Id: Ibad4078f680d3b2615b9ca6f6c72c4fd28030b55
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-04-04 13:40:38 +01:00
Zuul
5282bd2622 Merge ""hypervisor list --matching" showed the wrong result" 2023-04-04 08:10:09 +00:00
Zuul
72034196ca Merge "Add an updated tips job running on py310" 2023-04-04 08:10:07 +00:00
Zuul
ad992486fb Merge "Remove unused helpers for legacy novaclient" 2023-04-03 20:36:15 +00:00
Zuul
5d2687bfc4 Merge "Switch server shelve, unshelve to SDK" 2023-04-03 20:36:13 +00:00
Zuul
eafe579534 Merge "compute: Switch server restore to SDK" 2023-04-03 20:36:11 +00:00
Dr. Jens Harbott
00af88cf74 Add an updated tips job running on py310
Change-Id: Iadc32b4e8ea10561784208cdc8bf05ff3b3ca59d
2023-03-31 19:19:20 +02:00
Zuul
0a9a1753b5 Merge "Remove unnecessary 'self.methods'" 2023-03-30 19:05:04 +00:00
Zuul
17d03f49aa Merge "Switch server start, server stop to SDK" 2023-03-30 19:05:02 +00:00
Zuul
4e9181aa1e Merge "Switch server lock, unlock to sdk" 2023-03-30 19:05:00 +00:00
Zuul
55f2819cef Merge "Show Network QoS rules one per line" 2023-03-29 14:31:25 +00:00
Rodolfo Alonso Hernandez
f1cf3a10b5 Show Network QoS rules one per line
The command "network show qos policy <qos>" now shows the QoS rules
printed one per line.

Example: https://paste.opendev.org/show/bgam6amfLUVheAMhDxB3/
Change-Id: I65a99da16056902a822804e29b2dd9376a72e091
2023-03-28 18:18:49 +02:00
devMuscle
e74f2d94fe "hypervisor list --matching" showed the wrong result
Previously, using the "--matching" option shows empty results.
Previously, the "--matching" option called the "find_hypervisor method",
so we used to call the "hypervisor method"
like any other "--limit, --marker" options.

Depending on the nova api version, the api that is basically
called is as follows
2.53 >= : /os-hypervisors/detail?hypervisor_hostname_pattern=$HOSTNAME
2.53 < : /os-hypervisors/{pattern}/search

Hypervisor Type and Host IP are not returned
when using microversion 2.52 or lower

Co-authored-by: Jipyo Hong <hongsbien@naver.com>
Co-authored-by: Jieon Lee <dlwldjs7544@naver.com>
Co-authored-by: YoonSoo LIM <msdbtjd123@naver.com>

story: 2010670
task: 47726
Change-Id: I7b47acf48def7d4c5f4b74e4dba1c23d8ac7abf2
2023-03-26 14:06:36 +09:00
yaeeee
4e5e3cff5d Docs: Update glance command mapping
Update missing command in glance Mapping Guide.

List of updated command
[Glance CLI / OSC]
md-namespace-create / image metadef namespace create
md-namespace-delete / image metadef namespace delete
md-namespace-list / image metadef namespace list
md-namespace-show / image metadef namespace show

Co-authored-by: sujin01 <a5870771@gmail.com>
Co-authored-by: heesom <heesom.hs@gmail.com>
Co-authored-by: mpicea <jjh77745997@gmail.com>

Change-Id: I4d50b0ae820ea0c8feb1719bbbd9eb06d22cbe20
2023-03-25 10:53:23 +00:00
Johannes Kulik
aa227f8d16 Fix --security-group for port list
"openstack port list --security-group <id>" was using a filter that
didn't exist in `openstacksdk`: "security_groups". Up until version
1.0.1, `openstacksdk` did not support filtering `Port` objects by
security groups. Later versions will support the filtering (via [1]),
but the filter is called the same way the attribute on the `Port` object
is called: `security_group_ids`.

We're not bumping the `openstacksdk` version here, because the feature
we're using [1] is merged too recently and a bump of min requirements
thus unlikely. `openstackclient` continue to work with older versions of
`openstacksdk` - the "--security-group" filter will just do nothing like
before.

[1] https://review.opendev.org/c/openstack/openstacksdk/+/866008

Change-Id: I07088484592e99ce0a12b67d68a3e47ae7c7af81
2023-03-20 15:19:46 +01:00
Zuul
65b667af20 Merge "Add auto-approve option to project cleanup" 2023-03-20 12:07:44 +00:00
OpenStack Release Bot
5eb89e4ca1 Update master for stable/2023.1
Add file to the reno documentation build to show release notes for
stable/2023.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.1.

Sem-Ver: feature
Change-Id: I248bcb0342afb8276ba9605963287f620b62b6c5
2023-03-09 16:42:30 +00:00
Zuul
05d34ffce9 Merge "zuul: Merge osc-functional-devstack-base into only child" 2023-02-23 21:40:10 +00:00
Zuul
7c85f840f6 Merge "Add missing documentation for state options for "image set"" 2023-02-22 12:53:01 +00:00
Zuul
43f04c874f Merge "Drop default from ask_user_yesno question" 2023-02-22 12:32:22 +00:00
Zuul
cfd728108c Merge "Wait for volume being available to set bootable or readonly" 2023-02-22 12:32:20 +00:00
Zuul
a7e091c329 Merge "Update 'host list' and 'host show' command to use sdk" 2023-02-22 12:32:18 +00:00
Zuul
14dff075ff Merge "Fix really long help strings" 2023-02-22 12:32:16 +00:00
Zuul
02acd27c6a Merge "Add port ranges on floating ip portforwardings cli" 2023-02-22 12:32:14 +00:00
Zuul
3478873cff Merge "volume: Remove duplication from 'consistency group create' opts" 2023-02-22 12:32:11 +00:00
Zuul
365a7a24f5 Merge "Deprecate positional args for 'volume group create'" 2023-02-22 12:32:09 +00:00
lsmman
e53f706d0b Add missing documentation for state options for "image set"
The current "image set" with the state option behaves as follows: if you
use --project, it updates the membership status of the given project.

When this command was first added, it had the following description:

  If --project is passed, update the membership status for the given project

However, the description was missed when moving the documentation for
which command to the parser for each command method in commit f055fe67c.
Correct this oversight.

Co-authored-by: JAE YONG LEE <jaeljy135@gmail.com>
Change-Id: I18a29a19ce973971f68a52cbf4020cfa324c7a35
2023-02-22 10:14:21 +00:00
Stephen Finucane
5f19711720 zuul: Merge osc-functional-devstack-base into only child
Since we removed the osc-functional-devstack-n-net job in change
I76efeccec04937c3a68108e2654872e00fadcec4, there's no need to maintain
separate osc-functional-devstack-base and osc-functional-devstack jobs.
Merge them.

Change-Id: Id3dcd3c4f9f47a4020faf0787f44bd5509a2b5a2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-22 10:03:54 +00:00
Zuul
36ba614ba9 Merge "doc: Update nova command mapping" 2023-02-22 10:03:02 +00:00
matbu
5c9c1c77a0 Wait for volume being available to set bootable or readonly
This patch add a check to be sure that the volume created is in a
available state before trying to set bootable or readonly flag.

Story: 2002158
Change-Id: I8db71fd8cf5bd14eb67880f76d2e9135edeb3ed2
2023-02-22 09:52:43 +00:00
Zuul
861e1a8eee Merge "Finish switching server migration to sdk" 2023-02-21 13:28:47 +00:00
Zuul
8786767851 Merge "tests: Use fake SDK Migration object" 2023-02-21 13:28:44 +00:00
Zuul
dfe2bc9fbd Merge "compute: 'server volume update' -> 'server volume set'" 2023-02-21 13:28:40 +00:00
Zuul
2249d0026d Merge "Switch server volume update to sdk" 2023-02-21 13:28:37 +00:00
Zuul
fa90ad1392 Merge "Switch list server volume to sdk" 2023-02-21 13:28:35 +00:00
Stephen Finucane
674e4e620b doc: Update nova command mapping
There are a number of commands we're never going to implement:

  host-evacuate
  host-evacuate-live
  host-servers-migrate
    As noted in Dan Smith's blog [1], these are wrapper commands or meta
    operations that call a particular action - namely 'evacuate',
    'live-migration', and 'migrate' in old novaclient parlance - for
    each server on a particular host.

    These commands have historically been confusing. The underlying
    server commands have been implemented as 'server evacuate', 'server
    migrate --live', and 'server migrate', respectively. If a user wants
    to call these for each server on the host, they can do so with a
    little bit of shell scripting (hint: you want 'server list --host')
    or use something more suitable for this kind of task such as Puppet
    or Ansible.

  host-meta
    As above, this is equivalent to calling 'meta' for all servers on
    the host. Combine 'server set --property' with 'server list --host'
    instead (or use Ansible).

  instance-usage-audit-log
    This corresponds to the '/os-instance_usage_audit_log' API which is
    intended for use by OpenStack Telemetry. There's no user-facing
    application of this.

The remaining entries are updated to include their implementations. We
simply missed updating the mapping doc when implementing them.

With this, the OSC implementation of the nova API is *documented* as
being complete, as opposed to merely actually being complete 😉

[1] https://www.danplanet.com/blog/2016/03/03/evacuate-in-nova-one-command-to-confuse-us-all/

Change-Id: If08d501dd66c561956266d3b3f21dfd3559d8394
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-21 12:31:11 +00:00
Stephen Finucane
0d57f3f367 Deprecate positional args for 'volume group create'
There are now many ways to create a new volume group, thus the
positional arguments don't make sense. Deprecate them.

Change-Id: Id0b212426861719db1812b7d07b82613cf591de4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-17 13:50:50 +00:00
whoami-rajat
ec01268ea9 Add options to create volume group from source
This patch adds ``--source-group`` and ``--group-snapshot`` options
to the ``volume group create`` command to allow creating group from
a source group or a group snapshot.

Change-Id: I87482a5dd43c519dfdcf981635aa879914a70a5c
2023-02-17 12:17:22 +00:00
whoami-rajat
73b4ce88eb Add block storage manageable list commands
This patch adds the ``block storage volume manageable list`` and
``block storage snapshot manageable list`` commands that
allow operators to list the volumes and snapshots on a
particular host or cluster for management under OpenStack.

Change-Id: I328dada5a0dc4e9e44c0d51db5cf3f224e27f88f
2023-02-17 10:03:01 +00:00
whoami-rajat
2be3596779 Add block storage cleanup command
This patch adds the ``block storage cleanup`` command that
allow operators to cleanup resources (volumes and snapshots) with
failed operations by requesting services in other hosts in the
same cluster to cleanup resources of a failed service.

Change-Id: I1375223f525021db5201fa0a9f9a647d17dd01f7
2023-02-17 10:02:22 +00:00
whoami-rajat
a9e3049e9c Add block storage log level {list, set} commands
This patch adds the ``block storage log level list`` and
``block storage log level set`` commands that allow
operators to list the current log levels of cinder services
and also enables them to set a particular log level.

Change-Id: I16cd8084fb505a9e68a35a936ef3b8b1f3cdc712
2023-02-16 04:33:40 +00:00
whoami-rajat
e7ebf7544b Add volume revert command
This command allows users to revert a volume to a given snapshot.

Change-Id: If35ee394d654f5264558a281c835affff524ca50
2023-02-16 04:33:40 +00:00
Dr. Jens Harbott
7506eb8e0c Add auto-approve option to project cleanup
Sometimes it is useful to be able to use the project cleanup function in
scripts and having to add "echo y | openstack" isn't really nice.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I3ded9982769b4568b6dcfc49bc31ba67a6227839
2023-02-15 09:42:45 +01:00
Stephen Finucane
4106926fa6 volume: Remove duplication from 'consistency group create' opts
The '--consistency-group-source' and '--consistency-group-snapshot' opts
are unnecessarily verbose. Shorten them to '--source' and '--snapshot',
respectively, maintaining aliases to avoid breaking users.

Change-Id: I2b6656a8a09d953eb4406f1d4fd1e804743a8963
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-14 16:42:22 +00:00
Zuul
1e0880eda8 Merge "Add volume summary command" 2023-01-31 12:43:33 +00:00
Zuul
f9b025e4cb Merge "Move network trunk commands from python-neutronclient" 2023-01-31 12:40:59 +00:00
Zuul
f1da522cc3 Merge "image: Add support for additional image import methods" 2023-01-25 18:04:00 +00:00
elajkat
7f1c21b27a Move network trunk commands from python-neutronclient
Network trunk commands originally were added to python-neutronclient,
although we can long consider these operations core Networking operations.
This patch is not a blind copy but also changes the original code to use
openstacksdk python bindings instead of the binding code in
python-neutronclient as that is already deprecated.

Change-Id: Ic4bc35c296a95d5dae92e9fc1cab3a3fa8f103cd
Related-Bug: #1999774
2023-01-16 14:07:55 +01:00
whoami-rajat
77266bd9c3 Add volume summary command
This patch adds the ``volume summary`` command which shows the total
size, total count and metadata of all volumes.
This command is available from microversion 3.12 and the metadata
info is available from microversion 3.36.

Change-Id: I6472337e8b1dc91aad5fbe416673a5d5a5d5fa88
2023-01-13 21:18:15 +05:30
Stephen Finucane
88672d22c4 tests: Use fake SDK Migration object
We missed this when migrating the 'server migration list' command
across.

Change-Id: Ide05a0289020764829f1dbc416be5336fdf37d84
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-01-04 13:20:29 +00:00
Jiri Podivin
7985d49689 Excluding test code from coverage reports
Coverage report should not include statiststics on test modules
which is not only unnecessary, but also pollutes the coverage
statistics and pollutes the final report.

Requesting the path to tests to be omitted in .coveragerc resolves the issue.

Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Change-Id: Ifedaa1c8bfab23d92958e58c69c03e778454a408
2023-01-04 11:00:47 +00:00
Dr. Jens Harbott
69182a04b2 Drop default from ask_user_yesno question
There is no default for ask_user_yesno() since an empty answer instead
just repeats the question. Drop the unnecessary parameter.

Change-Id: I207bccbcbd31f831765e74a20c503b695790c0f5
2022-12-27 13:03:14 +01:00
Dr. Jens Harbott
5501ac7d1d Fix tox v4 compatibility
Various changes to tox.ini to support v4

Change-Id: Iee2bceb78f5b03c559f23b99cde57fd598ce981a
2022-12-26 15:56:28 +01:00
Zuul
1c2191bf3a Merge "Add plugin doc page for cyborg" 2022-12-20 15:03:25 +00:00
Zuul
a8d1ee709e Merge "Add qos rule type filtering" 2022-12-20 13:36:46 +00:00
Zuul
21c3c33087 Merge "image: Fail if we can't find an image" 2022-12-20 13:36:43 +00:00
Zuul
1d96a899f8 Merge "docs: Fix typos" 2022-12-20 13:20:13 +00:00
Zuul
a805f7ebb1 Merge "image: Rename import" 2022-12-20 13:20:11 +00:00
Shogo Saito
7f89b109cf Add plugin doc page for cyborg
This patch add cyborg (accelerator) doc page.

Change-Id: I0f3e5419ce522e620be805c0fcd829c8dfb2e317
2022-12-20 12:33:00 +00:00
Harsh Mutha
ecc6aeeede Update 'host list' and 'host show' command to use sdk
Change-Id: I3813ff604ba46112ebd358509ea4f28ee38ca3ee
2022-12-20 12:11:13 +00:00
Stephen Finucane
1701768c2d Remove unused helpers for legacy novaclient
These are no longer used.

Change-Id: I9514e98a5549130c12f3b785e90debf3437e6933
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-19 17:25:25 +00:00
Stephen Finucane
f56f0e333e Switch server shelve, unshelve to SDK
This one is a little more complicated because we support waiting.

Change-Id: I5bd65b44c23bfee1e0144dbd060563ecc3cfb942
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-19 17:25:23 +00:00
Stephen Finucane
004b2ab2fb compute: Switch server restore to SDK
Change-Id: I8df9711b736991c01136988aa06c8540d640f52f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/868108
2022-12-19 17:02:48 +00:00
Stephen Finucane
29fafabeed Remove unnecessary 'self.methods'
This was used by 'run_method_with_servers', not the SDK-equivalent.

Change-Id: Ia3333a95e406f430beb4f2cfb887e81ab7b72cfe
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-19 16:56:45 +00:00
Thrivikram Mudunuri
9241514137 Switch server start, server stop to SDK
Switch the server start and server stop commands from novaclient to SDK.

Change-Id: I5ebfa6b2468d5f20b99ea0eab1aea9377be09b8c
2022-12-19 16:56:20 +00:00
suneethravi
ce8171bad9 Switch server lock, unlock to sdk
Switch server lock commands from novaclient to SDK.

Change-Id: I042db99c9d7a0d8d207f8cdf69d786bd4fe904e7
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/867890
2022-12-19 16:55:46 +00:00
Zuul
b2c9a4cd40 Merge "Switch server dump create to using sdk" 2022-12-15 20:14:43 +00:00
Stephen Finucane
e0577e7ebe compute: 'server volume update' -> 'server volume set'
We use 'set', not 'update', in command names. An alias is provided.

Change-Id: I7864599e06df055999b975aabf101611cd482753
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-15 18:22:08 +00:00
Zuul
e00400eff5 Merge "Use the SDK in server migration list" 2022-12-15 18:05:11 +00:00
Ritvik Vinodkumar
25b4714f1c Switch server volume update to sdk
Switch the server volume update command from novaclient to SDK.

Change-Id: Ib9876775bcf8268344da1a58ab0dd1695cb83ece
2022-12-15 17:54:06 +00:00
Zuul
d297f11b87 Merge "Add baremetal agent type list filtering" 2022-12-15 17:45:33 +00:00
Zuul
db6909bc63 Merge "Add image metadef namespace command" 2022-12-15 17:45:31 +00:00
Zuul
a103b6ca34 Merge "Use the SDK for server show" 2022-12-15 17:45:29 +00:00
Zuul
3f7663a00e Merge "Fix parameter handling in server add fixed ip cmd" 2022-12-15 17:45:27 +00:00
Zuul
34bf2533a7 Merge "Updating the glanceclient reference doc" 2022-12-15 17:45:25 +00:00
Zuul
3aff444386 Merge "Migrate hypervisor stats commands to SDK" 2022-12-15 17:45:23 +00:00
Zuul
240bbe7239 Merge "Create a functional test case for hypervisor list and show" 2022-12-15 17:45:19 +00:00
Ritvik Vinodkumar
d47e432005 Switch list server volume to sdk
Switch the server volume list command from novaclient to SDK.
Modified functional test for server add/remove volume.

Change-Id: I5b4ab7d0275aec2e02451c5371319ac350af6a5f
2022-12-15 17:39:16 +00:00
Diwei Zhu
c47998c59a Switch server dump create to using sdk
Change-Id: I8e2a4651bff1f739fa98533cd47074b143b2e3d6
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
2022-12-15 17:19:44 +00:00
Violet Kurtz
d1c1c36af1 Finish switching server migration to sdk
Change-Id: Ic0e6dfdc986989599bfc73b8c274631232161c25
2022-12-14 22:07:47 +00:00
Thobias Salazar Trevisan
794334ec24 Fix server list error with --long and -c options
Using options --long and -c and specifying same columns added
by --long option, it passes duplicated column names to prettytable and
report the following error:

Field names must be unique!

This patch removes duplicated columns.

Change-Id: I9c0bd09c50dac568ca1980a6b53a6c544b85c2aa
2022-12-14 15:19:08 -03:00
Ariel-Berkowicz
318df521ed Create a functional test case for hypervisor list and show
This functional test case for hypervisor list and show makes sure it
works with the openstackclient sdk.

Change-Id: Ibaeaf68d6056fcf904b546f30287c65173b5a368
2022-12-14 16:50:42 +00:00
Stephen Finucane
b52ae93cd2 Fix functional-tips job
A recent change to cliff [1] means we're now stripping periods when
generating the summary line of command help strings. Account for this.

[1] https://review.opendev.org/c/openstack/cliff/+/867274

Change-Id: I45b39b9fe38914497505f157e91d84cd2f84f547
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-14 10:39:44 +00:00
Ariel-Berkowicz
992cfdfb57 Migrate hypervisor stats commands to SDK
Change-Id: I43b2071f5108c28f6881c8e99d4b06e87c83ddfa
2022-12-12 18:58:16 -05:00
Stephen Finucane
5afe48040c Fix really long help strings
Each command should have a summary line followed by a longer
description, if needed. Some commands were not following this. Fix them.

Change-Id: If1ce7654037d192626460f34c069ea0979919b9b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-12 18:04:01 +00:00
Dr. Jens Harbott
f23322c5ef Fix parameter handling in server add fixed ip cmd
The fixed_ip_address parameter needs to be passed in a hash with key
"ip_address" in order to be processed by the server, the previous arg
was simply being ignored.

Added a functional test for better coverage.

Closes-Bug: 1998927

Change-Id: I6956d2642d8e80fc10c3739f0a571aa7ba276b1a
2022-12-12 12:27:48 -05:00
Daniel Wilson
70dbb01ea3 Use the SDK for server show
Use the SDK for the server show command. This change modifies a helper
function that is used by server show as well as other commands that
print information about an individual server. The helper still uses
novaclient APIs when additional OpenStack requests are needed since some
of its callers are still using the nova client.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/864340
Change-Id: Ic253184ee5f911ec2052419d328260dc4664b273
2022-12-11 18:04:29 -05:00
Rodolfo Alonso Hernandez
bfab0199be Add qos rule type filtering
Added two new filter flags to ``openstack network qos rule type list``:
- "--all-supported", to return any QoS rule type supported by at least
  one loaded driver.
- "--all-rules", to return all QoS rule types supported by the current
  version of Neutron server, regardless of the loaded drivers.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/827671
Depends-On: https://review.opendev.org/c/openstack/neutron/+/827683

Related-Bug: #1959749
Change-Id: Ie0622e79ecf7dadd6560fea142352f5a2ed66b74
2022-12-10 17:01:11 +01:00
hoosa
38f972fa63 Add image metadef namespace command
add image metadef namespace create, delete, set, show command

Change-Id: I35b1cb8ff2b1735ae3a1b405d8f2071fe449ea6e
2022-12-07 21:35:39 +09:00
Mridula Joshi
576e9a01a5 Updating the glanceclient reference doc
Added the missing commands from glanceclient, updated the OSC
equivalent and removed the deprecated commands.

Change-Id: I3cee7882f6712e80c6f6e568337c1f96439aa1a5
2022-12-06 07:45:34 +00:00
Zuul
29129a7715 Merge "image: Add 'image import' command" 2022-12-05 12:59:52 +00:00
Zuul
8248efa8d9 Merge "compute: Allow users to manually specify bootable volumes" 2022-12-05 12:59:46 +00:00
Zuul
5b42583cb1 Merge "tests: Add test for multiple blocks devices" 2022-12-05 12:59:43 +00:00
Zuul
747811fad5 Merge "docs: Document how we manage API versions" 2022-12-05 12:30:01 +00:00
Zuul
65484b5a28 Merge "docs: Describe common actions found in OSC" 2022-12-05 12:29:58 +00:00
Stephen Finucane
4cf22b3d76 docs: Fix typos
Change-Id: I902e8b35d4423f91dd8cdeecbcc7e60af877da75
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-05 10:18:56 +00:00
Zuul
10453e085f Merge "Revert "Don't look up project by id if given id"" 2022-12-02 14:21:51 +00:00
Zuul
3cb4e9c714 Merge "tests: Convert network tests to use 'parse_output'" 2022-12-02 14:21:49 +00:00
Zuul
f9d2d69ed2 Merge "tests: Convert compute tests to use 'parse_output'" 2022-12-02 14:21:47 +00:00
Zuul
cc481f568b Merge "tests: Convert identity tests to use 'parse_output'" 2022-12-02 14:21:45 +00:00
Zuul
a5f207b657 Merge "tests: Convert volume tests to use 'parse_output'" 2022-12-02 14:21:43 +00:00
Zuul
5aecefe911 Merge "tests: Convert image tests to use 'parse_output'" 2022-12-02 14:21:40 +00:00
Zuul
70f05a6610 Merge "Use the compute SDK in server list" 2022-12-02 14:21:38 +00:00
Stephen Finucane
91277e7e51 compute: Allow users to manually specify bootable volumes
When creating a server with an attached volume, you can specify a block
device with a 'boot_index' of '0' and this will become the bootable
device. OSC allows users to do this by using either the '--volume'
option or a combination of the '--image' and '--boot-from-volume'
options, but we should also allow them to do it the "hard way" via the
'--block-device' option. For example:

  openstack server create \
    --block-device uuid=0a89ecd8-1fe2-45f0-94da-7789067911c9,boot_index=0 \
    --block-device uuid=589266ef-fd88-46e9-b7b2-94503ce8f88f,boot_index=1 \
    ... \
    my-server

Make this possible.

Change-Id: Ia48449fecbc590346630807b1c7da40102d53b33
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2010376
Task: 46617
2022-12-01 15:24:08 +00:00
Stephen Finucane
e7bc68735f tests: Add test for multiple blocks devices
The 'server create' command should support multiple '--block-device'
parameters. Prove it.

Change-Id: I1bd83287efdbbe11774053b694bae99b6a4ebdf5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-01 15:13:17 +00:00
Stephen Finucane
799a073b68 image: Fail if we can't find an image
Whenever we attempt to find a provided image, we generally want to fail
fast if they can't be found. This wasn't happening. Fix it.

Change-Id: Ibea38354a78381cb87d287f03726ecd03ecd246d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-01 10:04:02 +00:00
Stephen Finucane
a538104a94 image: Rename import
This makes the code a little clearer.

Change-Id: Ib552d510ca484571e59363ef15fe5e2cc0a2f4e1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-12-01 10:02:44 +00:00
Stephen Finucane
6dea276e5a image: Add support for additional image import methods
These are now supported in openstacksdk so we can use them.

Change-Id: Ie3107ba2155f9008e6065171298f85978957a172
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/openstacksdk/+/864029
2022-11-30 17:15:29 +00:00
Stephen Finucane
85254fbeb4 Revert "Don't look up project by id if given id"
This reverts commit 042be7c7fe. This
solution worked but it was confusing. The issue that the author was
seeing was presumably due to users not being able to list projects but in
theory the 'openstackclient.image.common.find_project' function that was
being called here should have already handle this. It transpires however
that there was a bug in this and we weren't correctly handling HTTP 403
errors correctly. This bug has since been fixed in change
I2ea2def607ec5be112e42d53a1e660fef0cdd69c meaning this change is no
longer necessary. Remove it and simplify the code somewhat.

Change-Id: I108efec2c8deda50fcb9cc84f313602bed2ac15c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-30 12:35:17 +00:00
Daniel Wilson
86c5470134 Use the SDK in server migration list
Update server migration list to use the OpenStack SDK instead of
directly using the nova interface.

Change-Id: I40dc95ee47e7c33ebf596f8ad437228b4bb0ab33
2022-11-30 12:18:31 +00:00
Stephen Finucane
199ba0bcf8 docs: Document how we manage API versions
Document that microversion auto-negotiation is acceptable. Heck, it's
downright desirable.

Change-Id: Ib256e064d1e8b6dc8273e482276dce243f9991cb
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-30 12:07:33 +00:00
Stephen Finucane
bb5b290478 docs: Describe common actions found in OSC
Off the back of a recent post to openstack-discuss [1], list the common
actions used in OSC along with some conditions around their expected
use and implementation.

[1] https://lists.openstack.org/pipermail/openstack-discuss/2022-November/031284.html

Change-Id: Id6610d678e7b3b12afdd89a674fbbe7090f64444
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-30 12:07:33 +00:00
Daniel Wilson
c97f73ce2a Use the compute SDK in server list
Update server list to use the compute component of the OpenStack SDK
instead of directly using the nova interface. This change depends on SDK
version 0.102.0 for automatic client-side query filters.

Change-Id: Ib9985812bfd98320b75f3a82bb594a0daa6e4d93
2022-11-29 20:24:45 -05:00
Zuul
6cd72f6182 Merge "Adding volume backend commands to volume v3" 2022-11-29 23:03:59 +00:00
Zuul
0a9533709f Merge "Improve server dump create helptext" 2022-11-29 20:52:23 +00:00
Zuul
6413b25dec Merge "Add note about microversion 2.87 in server rescue help" 2022-11-29 20:49:50 +00:00
Zuul
92a1c854bb Merge "Add test for creating volume from source" 2022-11-29 20:49:48 +00:00
Stephen Finucane
50aed3fea2 tests: Convert network tests to use 'parse_output'
Change-Id: I93e2a4e0a4c7ec07da0c78a171f3d787125af053
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:21:29 +00:00
Stephen Finucane
874519e980 tests: Convert compute tests to use 'parse_output'
Change-Id: Ib5b2f46639f14877a9ec295b26cae01a05395d4d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:21:29 +00:00
Stephen Finucane
6daa6be392 tests: Convert identity tests to use 'parse_output'
Change-Id: I10711b911986af0348946f6254cf36773110b0ab
2022-11-29 16:21:29 +00:00
Stephen Finucane
686fabef31 tests: Convert volume tests to use 'parse_output'
Change-Id: Iec8ca873f6bc3993e0ba557f68895d9aefb6f9c6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:21:29 +00:00
Stephen Finucane
dc03ce98de tests: Convert image tests to use 'parse_output'
Change-Id: I5f256d466d503d70d1f380016f9c8f5a0d9e395f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-29 16:20:03 +00:00
Ilya Popov
f0f54f0100 Adding volume backend commands to volume v3
Task: 46959
Story: 2010454
Change-Id: I6ed5f54079b88bc9fdfa24474a480a2786eda745
2022-11-29 16:44:59 +03:00
Stephen Finucane
948198643f docs: Typo fix
Change-Id: I2d55747b1226207946f80f04b80b4685e3eea3f9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-25 17:28:50 +00:00
Stephen Finucane
abf1a7cc4b docs: Small cleanup of human interface guide
Before we add more content.

Change-Id: I6cf28bdd217326db991466a21221b685124d4b99
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-24 13:02:10 +00:00
whoami-rajat
4710cbeca6 Add test for creating volume from source
This patch adds a test to create a new volume from source.
We also include code changes to pass the right size i.e. either
size passed by the user via --size argument or the source volume
size. This case is already handled at the API layer[1] but it
helps being consistent with passing the right size value as in case
of creating a volume from snapshot or backup.

[1] 7c1a5ce7b1/cinder/api/v3/volumes.py (L381-L382)

Change-Id: Idc71636dad6bb678fe24f19b0836d2e9bd92d7d2
2022-11-23 14:20:06 +05:30
whoami-rajat
96162c24ea Change --size helptext to include backup
Followup from [1]. Modifying help text of --size
argument to include --backup option.

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/864893

Change-Id: I12cf60079ebcfe1cd059602fbfc1a13c8fe86803
2022-11-22 21:20:19 +05:30
whoami-rajat
bd0727c4f8 Add option to create volume from backup
Support for creating a volume from backup was added in
microversio 3.47. This patch adds a --backup option
to the volume create command to add that support.

Change-Id: Ib26d2d335475d9aacbf77c0fd7b7cda2ba743943
2022-11-21 20:30:09 +05:30
Zuul
56b0f6de0e Merge "image: Add 'image stage' command" 2022-11-16 12:38:10 +00:00
Zuul
222ea8def2 Merge "image: Simplify handling of data provided via stdin" 2022-11-16 12:37:58 +00:00
Zuul
a2706f5a80 Merge "image: Ignore '--progress' if providing image data from stdin" 2022-11-16 12:27:47 +00:00
Zuul
e708ddc2a3 Merge "Moved hypervisor to the SDK" 2022-11-16 11:18:32 +00:00
Zuul
06afa9b8cf Merge "Use the compute SDK in usage commands" 2022-11-16 09:46:59 +00:00
Zuul
d09aef5a01 Merge "compute: Add missing microversion check for networks" 2022-11-16 09:43:55 +00:00
Zuul
16f18d4a80 Merge "compute: Fix '--network none/auto' handling" 2022-11-16 09:20:21 +00:00
Jadon Naas
348eb79632 Docstring fix for CreateVolumeAttachment class
The command "volume attachment create" has a typo in the docstring.
The docstring says to use "server add volume", but the command is
actually "server volume add". This
change fixes the typo in the docstring.

Task: 46781
Story: 2010401
Change-Id: Ie19a24ead100dd9177669653a7a9997772ef4538
2022-11-10 11:51:18 -05:00
Zuul
50015b9608 Merge "tests: Convert more functional tests to use 'parse_output'" 2022-11-10 13:10:21 +00:00
Zuul
d5b6f5a183 Merge "tests: Move json decoding to base test class" 2022-11-10 13:00:50 +00:00
Violet Kurtz
006e35509d Moved hypervisor to the SDK
Change-Id: Ie955fb4d27c30e044626732a1f3e0f141cb85aa5
2022-11-09 19:33:54 +00:00
Stephen Finucane
4eea3408dc image: Add 'image import' command
Note that we require some additional functionality in SDK for this to
work properly, but it's a start.

Change-Id: I87f94db6cced67f36f71685e791416f9eed16bd0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Stephen Finucane
1fb8d1f48b image: Add 'image stage' command
This is the equivalent of the 'image-stage' glanceclient command.

Change-Id: I10b01ef145740a2f7ffe5a8c7ce0296df0ece0bd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Stephen Finucane
3d9a9df935 image: Simplify handling of data provided via stdin
This was unnecessarily complex.

Change-Id: I8289d5ce7356d8bc89425590a7f71bca91a6d396
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Stephen Finucane
bafece762a image: Ignore '--progress' if providing image data from stdin
You can provide data via stdin when creating an image. Using this with
'--progress' makes no sense and causes an error currently. Fix this.

Change-Id: I3c2d658b72a7c62931b779b0d19bb97f60a0c655
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-09 16:51:54 +00:00
Maksim Malchuk
b7d01833d0 Add baremetal agent type list filtering
This change adds and ability to filter out the baremetal nodes in
'network agent list' command.

Related-Story: 2008590
Related-Task: 41746
Related-Bug: #1658964
Change-Id: I01ffbd82662abbc1c2f56eb8f1e700f392bc063c
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2022-11-09 17:38:06 +03:00
Zuul
31881c0b2b Merge "zuul: Remove nova-network tests" 2022-11-08 19:48:42 +00:00
Stephen Finucane
38e39b6dc1 tests: Convert more functional tests to use 'parse_output'
Change-Id: I1d968181eb196c6df4583c772c67ed58bc7ba585
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-08 16:39:05 +00:00
Stephen Finucane
a244bb84e0 tests: Move json decoding to base test class
We do this everywhere. Add a simple knob to simplify the pattern. Only
one use is migrated initially. The rest will be done separately.

Change-Id: Ic3b8958bd4fb1459a8ac3adaff216c2a26628491
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-08 16:39:02 +00:00
Stephen Finucane
ffb69116b3 compute: Add missing microversion check for networks
The 'auto' and 'none' network allocation policies are only supported on
compute API microversion 2.37 or later. Enforce this in the code.

Change-Id: I90f8fb1e61ead4bd406ea76bbeb731b913805b13
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2010385
Task: 46657
2022-11-08 11:28:31 +00:00
Stephen Finucane
ed0d568b94 compute: Fix '--network none/auto' handling
This should lookup a network called 'none' or 'auto', not do the
equivalent on '--nic none' or '--nic auto'. Correct this.

Change-Id: I3c5acc49bfe8162d8fb6110603da56d56090b78f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2010385
Task: 46658
2022-11-08 11:25:19 +00:00
Zuul
681934a96a Merge "compute: Add '--no-network', '--auto-network' flags" 2022-11-08 10:48:36 +00:00
Stephen Finucane
1d71479a4c zuul: Remove nova-network tests
nova-network has been removed from nova for a very long time now and
we've no way to test it in CI save for installing old versions of
OpenStack. We don't care about this enough to do that, so just remove
the thing.

In the vein of things that have been removed, we also remove
configuration that was supposed to enable cinder's v1 API but doesn't
since the related knob was removed over 5 years ago [1].

[1] 3e91de956e

Change-Id: I76efeccec04937c3a68108e2654872e00fadcec4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-11-08 10:20:30 +00:00
melanie witt
d7aa53b9a2 Add note about microversion 2.87 in server rescue help
The ability to rescue a volume-backed server was added in compute
microversion 2.87 [1].

This adds a note to the command help to improve user experience.

[1] https://docs.openstack.org/nova/latest/user/rescue.html

Change-Id: I5f40c3ca28e13bd1f979bc5f8c337302a3b9a5be
2022-11-07 22:54:55 +00:00
Zuul
70de31755d Merge "Run swift in -tips job" 2022-11-07 22:53:03 +00:00
Zuul
837cbfbcdb Merge "quota: Deprecate "force" behavior for network quotas" 2022-11-05 09:24:51 +00:00
Zuul
b0b47472d8 Merge "quota: Fix issues with delete quota command" 2022-11-05 09:24:49 +00:00
Zuul
ae5f20c1ab Merge "tests: Remove unnecessary nesting of volume resources" 2022-11-05 09:10:14 +00:00
Zuul
495e7fa907 Merge "tests: Remove duplicate FakeImagev1Client" 2022-11-05 09:10:11 +00:00
Zuul
841c54229d Merge "tests: Move fake clients to top of file" 2022-11-05 09:09:23 +00:00
Zuul
c458ad4692 Merge "quota: Trivial style fixups" 2022-11-05 09:09:21 +00:00
Zuul
6898bc0ae3 Merge "quota: Deprecate 'quota show --class', 'quota set --class' arguments" 2022-11-05 09:09:19 +00:00
Zuul
1e37c12b16 Merge "quota: Allow showing project-specific quotas" 2022-11-05 09:09:16 +00:00
Stephen Finucane
a7975c4200 compute: Add '--no-network', '--auto-network' flags
These are aliases for '--nic none' and '--nic auto', respectively.

Change-Id: I7b4f7e5c3769a813bd8b2b9cd6090c6fe501e13d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-10-26 17:12:57 +03:00
Artom Lifshitz
e76609650f Improve server dump create helptext
The `server dump create` command instructs Nova to trigger a crash
dump in the guest OS. Assuming the guest supports this, the resulting
dump file will be located in the guest, in a location dependent on the
guest OS. Explain all that in the helptext.

Story: 2010384

Change-Id: If940ed5cce6c5ab4193ab1494738149370da9aad
2022-10-26 09:50:44 -04:00
Zuul
a03b2352d9 Merge "Added "openstack image metadefs namespace list" command" 2022-10-26 11:31:12 +00:00
Zuul
27479104e7 Merge "volume: Volume names are optional" 2022-10-26 10:11:28 +00:00
Areg Grigoryan
a726d84f4b Added "openstack image metadefs namespace list" command
Change-Id: Ibc064566478818bd70e7e6550095d24a05e1bb0e
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/854612
2022-10-26 12:26:10 +03:00
Daniel Wilson
ce4cbeab67 Use the compute SDK in usage commands
Update usage list and usage show to use the compute component of the
OpenStack SDK instead of directly using the nova interface.

Change-Id: I1c4d2247c9c1a577ed9efad7e8332e7c9b974ad5
2022-10-25 22:51:48 -04:00
Zuul
ccd9356550 Merge "quota: Add 'quota show --usage' option" 2022-10-12 11:22:09 +00:00
Zuul
351b2b1074 Merge "quota: Simplify logic used to list, show quotas" 2022-10-12 11:14:20 +00:00
Stephen Finucane
09ff9a0f4c quota: Deprecate "force" behavior for network quotas
In change Idc1b99492d609eb699d0a6bef6cd760458a774f6, we added a
'--check-limit' option to enable "no force" behavior for network quotas.
This was already the default for compute quotas. Provide a path for
harmonizing the behavior of the two options by instead using a
'--no-force' option which will become the eventual default for the
network quotas also.

Change-Id: I25828a3d68e2e900f498e17a0d01fb70be77548e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-10-11 16:52:08 +01:00
Stephen Finucane
2da4aa99aa quota: Fix issues with delete quota command
We were passing a project object rather than just the ID. Also correct a
typo in the call to delete network quotas.

Change-Id: I2292db7932ec01026f0e54014e3d02218792617a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-10-11 16:41:28 +01:00
Zuul
8be0c641e1 Merge "quota: Add support for detailed volume quotas" 2022-10-07 17:05:55 +00:00
Zuul
eac38feef0 Merge "quota: Add 'quota delete' command" 2022-10-07 16:37:20 +00:00
Zuul
7d67a0be7f Merge "doc: Update cinder command mapping" 2022-10-07 16:32:15 +00:00
Zuul
71ef203cc6 Merge "Remove invalid note from requirements files" 2022-10-05 17:08:23 +00:00
Zuul
03051ce697 Merge "Bump python-novaclient version" 2022-10-05 17:08:21 +00:00
Zuul
f1cb66a476 Merge "Fix server evacuate command" 2022-09-30 13:12:07 +00:00
Zuul
adac63efe1 Merge "Speed up standard flavor list command" 2022-09-30 13:12:00 +00:00
Zuul
ec43d63182 Merge "docs: Add missing command mappings" 2022-09-30 12:31:55 +00:00
Zuul
bd4e67452e Merge "compute: Only retrieve necessary images" 2022-09-30 12:31:53 +00:00
Zuul
36f58c2ad7 Merge "Add authorization_ttl for identity providers" 2022-09-30 12:31:51 +00:00
Zuul
5826802793 Merge "Fix wrong assertion methods" 2022-09-30 12:23:19 +00:00
Zuul
cd27f0dd48 Merge "Improve help text for network create --external" 2022-09-30 12:23:17 +00:00
Zuul
26946d5670 Merge "Add trustor and trustee filtering to trusts list" 2022-09-30 12:23:14 +00:00
Zuul
5043626c80 Merge "config: Also mask non-prefix config" 2022-09-30 12:10:36 +00:00
Zuul
38dda16639 Merge "network: Add tenant project filter for RBAC list" 2022-09-30 12:10:29 +00:00
Zuul
db3610b533 Merge "remove unicode prefix from code" 2022-09-30 12:01:24 +00:00
Zuul
c7bb7f806c Merge "Fix missing closing brackets in metavar" 2022-09-30 12:01:22 +00:00
Zuul
217654e16c Merge "Replace assertItemsEqual with assertCountEqual" 2022-09-30 12:01:19 +00:00
Zuul
46ead4abea Merge "image: Add 'image task list' command" 2022-09-30 11:59:21 +00:00
Zuul
97af1b661e Merge "image: Add 'image task show' commands" 2022-09-30 11:59:18 +00:00
Stephen Finucane
1aaaa6f1d1 tests: Remove unnecessary nesting of volume resources
Change-Id: I210ce7534d161e89115e5cb96e42ab7f27170aa1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 11:42:07 +00:00
Stephen Finucane
d7f431be50 tests: Remove duplicate FakeImagev1Client
I guess this was defined to avoid a circular import. There are easier
ways to do this.

Change-Id: Iab215a53691298413ea9d10def792008ab9edbce
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 11:41:57 +00:00
Stephen Finucane
e2940eea18 tests: Move fake clients to top of file
These are important and they're easier to identify at the top of the
file than nested deep inside.

Change-Id: I1569c855fadfe4cdacf83ee07d08922bf3edefbc
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 11:41:48 +00:00
Stephen Finucane
1ff839da76 quota: Trivial style fixups
Change-Id: I4522b54676033dced2b47477238ceb551e11d04a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 12:40:18 +01:00
Stephen Finucane
b62021260c quota: Deprecate 'quota show --class', 'quota set --class' arguments
This doesn't do anything special in nova and cinder and is not supported
in neutron. For the 'quota show' command, people should use the
'--default' argument instead.

Change-Id: I0dd38e5cb252a01d5817ed168be040b21b35e348
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 12:40:18 +01:00
Stephen Finucane
00e7019022 quota: Allow showing project-specific quotas
Add '--compute', '--network' and '--volume' options to the 'quota show'
command, along with a default '--all' option, allowing us to restrict
quotas shown to an individual service.

Change-Id: I122b765df01887b8d916ee6567ffb7768fcb4392
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 12:40:18 +01:00
Stephen Finucane
04e68e0d5a quota: Add 'quota show --usage' option
Provide an more sane way to get usage information for a particular
project's quotas. This requires using the 'Lister' command type since
the 'ShowOne' command type only allows for simple key-value pair output.

We also add a note indicating that the '<project>' argument is optional.

Change-Id: Ic7342cf08f024cc690049414c5eef5b9a7594677
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 12:40:15 +01:00
Stephen Finucane
47e667e71d quota: Simplify logic used to list, show quotas
This is prep work for some changes we're introducing in a later change.

Change-Id: I27a59bc1d57e6815fb166fb99ea2af88f08b68a9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 12:33:29 +01:00
Pavlo Shchelokovskyy
4592d2c78f Fix server evacuate command
I don't think it has ever worked in fact..

The server.evacuate() in novaclient returns not a Server() instance,
but a TupleWithMeta() object, that has no .to_dict() method [0]
used in _prep_server_detail() function.

[0] https://review.opendev.org/c/openstack/python-novaclient/+/276639

Change-Id: I22f9ac072eb1b0bfd1263a256e9bea4500c03290
Story: 2010204
Task: 45928
2022-09-30 11:04:45 +00:00
Pavlo Shchelokovskyy
ec8dba29f9 Speed up standard flavor list command
currently this command tries to fetch extra_specs for any flavor
that does not have them (which is quite usual), regardless if the
command was even asked to display them (--long) at all.
This significantly slows down this command as it makes a lot of
unnecessary REST calls, one per each flavor to fetch extra_specs for.

With this patch, client only attempts to fetch flavor extra_specs if
the user actually called the client with --long.

Change-Id: Ia36414d891a41b641d7a9a04f0a1e7d43cfee351
Story: 2010343
Task: 46484
2022-09-30 11:53:00 +01:00
Stephen Finucane
44443f7856 quota: Add support for detailed volume quotas
We were stating that this was not supported. That is not true. Correct
the oversight.

Change-Id: Ib9d9db641a18e142be0a1eccff783e7cccdf2db5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 10:55:47 +01:00
Stephen Finucane
45bec041b2 quota: Add 'quota delete' command
We had previously indicated that people use 'quota set' for unsetting a
project's quotas, however, there was nothing that actually allowed us to
do this. Correct that oversight.

Change-Id: I04057e766b8ccf94bf219972249b68dc2bb796d4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 10:54:11 +01:00
Stephen Finucane
bfdf900d0a doc: Update cinder command mapping
I had incorrectly marked the 'api-version' command as WONTFIX. Turns out
we already support this, albeit via keystone as opposed to a
cinder-specific API.

Change-Id: I804ef1ca5a0f4df844d8c2229688c4edbac45aa9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-30 10:53:31 +01:00
Bence Romsics
390f8135bd Improve help text for network create --external
Change-Id: Ie802fbb8a35e53dcb79b5581f64caa2db1609480
Closes-Bug: #1990285
2022-09-26 12:40:08 +02:00
OpenStack Release Bot
00d8d945a1 Switch to 2023.1 Python3 unit tests and generic template name
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for antelope. Also,
updating the template name to generic one.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: Ie3677749177a32507007833717b9bc484ce2c493
2022-09-23 14:15:54 +00:00
OpenStack Release Bot
1b0d2dde13 Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: Ie570af5ce752d91190ebf6aa3c5ff2329afa36d3
2022-09-23 14:15:52 +00:00
Takashi Natsume
ff273909da Fix wrong assertion methods
Change-Id: Iebf4840662e87e59a06b56f1b5248728cba03c24
Story: 2010288
Task: 46261
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-09-23 10:49:43 +00:00
Stephen Finucane
c9d445fc4b image: Add 'image task list' command
This replaces the 'glance task-list' command.

  $ openstack image task list

We also indicate that the 'image task create' command will never be
implemented. This is an admin-only API that isn't really intended to be
used by humans thus it does not need an OSC command implementation.

Change-Id: Id8a943a5443782fc70c0fbf3639f5aa17b9d30af
2022-09-21 10:43:35 +01:00
lsmman
d163a20904 image: Add 'image task show' commands
This replaces and the 'glance task-show' command. For example:

  $ image task show <TASK_ID>

Change-Id: I74cb23e436c373fe238804b903bbeb28f643d5af
2022-09-21 10:34:15 +01:00
Dr. Jens Harbott
28ac0141b5 Run swift in -tips job
Since there is only py3 left, swift has learned to live with it, so we
might as well test it.

Change-Id: Iab5232858e4a67e356680d169a885875d574c3cc
2022-09-20 20:20:11 +02:00
Takashi Natsume
7e5b528e2e Replace assertItemsEqual with assertCountEqual
The assertItemsEqual were replaced with assertCountEqual in
I0bbffbec8889b8b3067cfe17d258f5cb16624f38.
However the following changes add assertItemsEqual after that.

* I1095100efb27b8559412469f0a9d07fc0a3db9d5
* Ic230c2c5cda8255d8f2c422880aeac81670b2df3
* Ica3320242a38901c1180b2b29109c9474366fde0

So Replace assertItemsEqual with assertCountEqual again.

Change-Id: I11ff1748225e434f64dbaf7b88dc80ba28a5e2a0
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-09-19 01:14:50 +00:00
zeze
a9b9252da3 Adding missing command mapping in docs
nova command: version-list
openstack command: versions show --service compute

cinder command: version-list
openstack command: versions show --service block-storage

glance command: member-list
openstack command: image member list

Change-Id: I3c68dbd47dc92ed190ae9abaa90dfcddef072728
2022-09-16 01:28:46 +09:00
Stephen Finucane
3fc585332f volume: Volume names are optional
Who knew?

Change-Id: I1c1a811c0db59250e8a20a87f25c2662bc3ab3e8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-09-14 13:44:02 +01:00
whoami-rajat
4024bdb393 compute: Add support for microversion 2.93
Add '--reimage-boot-volume' and '--no-reimage-boot-volume parameters'
to the rebuild command to allow rebuilding of volume backed instances.

Change-Id: I4a6e30b2cf12f32202a2d9ef1ced347e1dd139f3
2022-09-14 11:24:10 +01:00
whoami-rajat
1f63034441 compute: Require image when rebuilding a volume-backed server
A volume-backed server will have no image attribute (or rather the image
property will be set to the empty string). As such, if you want to try
rebuild you will need to specify an image [*]. Enforce this.

[*] Before microversion 2.93, this must be the same image. However, we
don't touch on that here. This will be addressed later.

Change-Id: I6842dabd7acb4e3a78f894e55e616625757eb6a4
Story: 2010297
Task: 46290
2022-09-14 11:22:43 +01:00
elajkat
c6065c7a47 Add address-scope to NDP proxy tests
Related-Bug: #1987410
Change-Id: I61df81381803ca289f295ab8d7a8f495bb169447
2022-09-09 09:18:36 +02:00
Jan Hartkopf
4d7d7e627e network: Add tenant project filter for RBAC list
Implements a new parser argument "--target-project" to
list RBAC policies for a specific tenant project only.
This uses the already existing server-side query
parameter "target_tenant".

Story: 2009937
Task: 44824
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/834442
Change-Id: I83ff07041a022e8795e3c5550c6a7aabb0c0d8c8
Signed-off-by: Jan Hartkopf <jhartkopf@inovex.de>
2022-09-06 14:13:10 +02:00
Zuul
7df94c9f82 Merge "Microversion 2.91: Support specifying destination host to unshelve" 2022-09-01 18:15:52 +00:00
Zuul
5cf8f37a93 Merge "Fix documents for replaced configuration name" 2022-08-31 02:34:31 +00:00
Yang JianFeng
b36cd0f4c0 Add router ndp proxy commands
Depends-on: https://review.opendev.org/749036
Change-Id: I77e12cc2dfe4000bd5ae6511878c6591f52d9791
Related-Bug: #1877301
2022-08-26 08:15:43 +08:00
Takashi Kajinami
2093a5b681 Fix missing closing brackets in metavar
... to display the complete format in --help output.

Change-Id: I4d0f044072b206f6205b4b4f4992fd08f01729d6
2022-08-26 01:07:04 +09:00
Stephen Finucane
8b0e467355 Remove invalid note from requirements files
This isn't true with the new dependency resolver introduced in pip 20.3.

Change-Id: Ie28fe625663c960fbffa12efb1503b8c9f8c0581
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-08-24 11:03:52 +01:00
Stephen Finucane
84003aa6fe Bump python-novaclient version
The recently added support for nova API microversions 2.91 and 2.92
necessitate a newer version of python-novaclient. Make it so.

Change-Id: I40a77334e4aee2e196062c38a0bb70f8f3079b44
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-08-24 11:03:47 +01:00
René Ribaud
6e0699c1cf Microversion 2.91: Support specifying destination host to unshelve
This patch adds a new parameter ``--host`` to
``openstack server unshelve`` command. This can help administrators to specify
an ``host`` to unshelve a shelve offloaded server.
And add new parameter ``--no-availability-zone`` to unpin a server availability

These parameters are available in the 2.91 microversion.

Depends-On: https://review.opendev.org/c/openstack/python-novaclient/+/831651
Implements: blueprint unshelve-to-host
Change-Id: I7986adc7563f63bcd4b3caf5eb7bc4329b4e1eca
2022-08-22 15:03:24 +02:00
niuke
dd648dcb5c remove unicode prefix from code
Change-Id: I0b1ca4237de61b70c694f36e1956e71a2a6b39a4
2022-08-15 12:20:20 +08:00
Zuul
27b2496e03 Merge "Migrate server_groups to the new API" 2022-08-09 17:33:39 +00:00
Snow Kim
701dd67d6c Fix documents for replaced configuration name
Since 4.0, '--os-url' global option is no longer supported.
And this option had been replaced to '--os-endpoint'

- Refer Change-Id: I1b9fbb96e447889a41b705324725a2ffc8ecfd9f
- Refer Docs: doc/source/cli/backwards-incompatible.rs

I fixed in documents as below
- OPTIONS: '--os-url' to '--os-endpoint'
- ENVIRONMENT VARIABLES: 'OS_URL' to 'OS_ENDPOINT'
- and relevant sentence

Change-Id: Ibb0cddf34375df941678ee07a005d81399ec7195
2022-08-05 19:51:32 +09:00
Violet Kurtz
a9f8133274 Migrate server_groups to the new API
Moved the server_groups to the new API.

Change-Id: Ied7bd6f56e277f0c5efcd5ba028765f9be65050f
2022-08-02 20:39:19 +00:00
ryanKor
62c52f5e61 config: Also mask non-prefix config
The 'config show' command will show information about your current
configuration. When using a 'cloud.yaml' file and the 'OS_CLOUD'
environment variable, the output of this will look like so:

  $ openstack config show
  +---------------------------------------------+----------------------------------+
  | Field                                       | Value                            |
  +---------------------------------------------+----------------------------------+
  | additional_user_agent                       | [('osc-lib', '2.6.0')]           |
  | api_timeout                                 | None                             |
  | auth.auth_url                               | https://example.com:13000        |
  | auth.password                               | <redacted>                       |
  | auth.project_domain_id                      | default                          |
  | auth.project_id                             | c73b7097d07c46f78eb4b4dcfbac5ca8 |
  | auth.project_name                           | test-project                     |
  | auth.user_domain_name                       | example.com                      |
  | auth.username                               | john-doe                         |
  ...

All of the 'auth.'-prefixed values are extracted from the corresponding
entry in the 'clouds.yaml' file. You'll note that the 'auth.password'
value is not shown. Instead, it is masked and replaced with
'<redacted>'.

However, a 'clouds.yaml' file is not the only way to configure these
tools. You can also use old school environment variables. By using an
openrc file from Horizon (or the clouds2env tool [1]), we will set
various 'OS_'-prefixed environment variables. When you use the 'config
show' command with these environment variables set, we will see all of
these values appear in the output *without* an 'auth.' prefix. Scanning
down we will see the password value is not redacted.

  $ openstack config show
  +---------------------------------------------+----------------------------------+
  | Field                                       | Value                            |
  +---------------------------------------------+----------------------------------+
  | additional_user_agent                       | [('osc-lib', '2.6.0')]           |
  | api_timeout                                 | None                             |
  ...
  | password                                    | secret-password                  |
  ...

This will also happen if using tokens. This is obviously incorrect.
These should be masked also. Make it so. This involves enhancing our
fake config generation code to generate config that looks like it came
from environment variables.

Change-Id: I560b928e5e6bcdcd89c409e0678dfc0d0b056c0e
Story: 2008816
Task: 42260
2022-08-01 19:54:44 +09:00
Yoonsoo Lim
e6adf37d12 Update the Nova CLI Mapping Guide
Update missing command in Mapping Guide.

List of updated command
[Nova CLI / OSC]
instance-action-list / server event list

Change-Id: I1436a6c1bdd881890e015cf0f1829c38378b36fa
2022-07-31 14:20:22 +09:00
Zuul
60dd6e6257 Merge "Drop support for Python 3.6, 3.7" 2022-07-27 11:45:06 +00:00
Zuul
b3ae3f5552 Merge "Add support for CRUD operations for QoS minimum packet rate rule" 2022-07-20 14:13:42 +00:00
Pavlo Shchelokovskyy
167cf11e82 Add authorization_ttl for identity providers
this is supported since Ussuri (Keystone API version 3.14) but was
lacking from openstackclient.

Change-Id: Ifac818b9a4eff66d9a68455ada1ddfe67cb46b3b
2022-07-13 22:28:07 +03:00
Pedro Martins
bced4852c7 Add port ranges on floating ip portforwardings cli
This patch is one of a series of patches
to implement floating ip port forwarding with
port ranges.

The specification is defined in:
https://github.com/openstack/neutron-specs/blob/master/specs/wallaby/port-forwarding-port-ranges.rst

Change-Id: If9679c87fd8b770fcd960048e091ee8d59205285
Implements: blueprint floatingips-portforwarding-ranges
Related-Bug: #1885921
2022-07-13 16:24:15 -03:00
Stephen Finucane
722d3216a4 docs: Add missing command mappings
The 'neutron tag-replace' command is equivalent to the 'openstack
network set --no-tag --tag <tag> [--tag <tag> ...]' command. '--no-tag'
will unset all tags while '--tag <tag>' will set a new tag and can be
specified multiple times.

The 'nova hypervisor-uptime' command is equivalent to the 'openstack
hypervisor show' command. Before compute microversion 2.88, the nova
command was using a different API that returned an almost identical
output to 'nova hypervisor-show' except it included an 'uptime' field.
Since 2.88, this field is returned in the standard call. OSC abstracts
this detail away so the 'uptime' field is always present, removing the
need for a separate command.

The 'nova migration-list' command is implemented as 'openstack server
migration list' (simply omit the '--server' filter).

The 'nova volume-update' command is implemented as 'openstack server
volume update'.

The 'nova volume-attachments' command is actually available as
'openstack server volume list', though you can also use 'server show'.

The 'nova aggregate-cache-images' corresponds to an internal API that
only glance should be using. It doesn't need to be exposed via
openstackclient.

Change-Id: Icdbc42762230954f6f7f2064b6228416af41d45a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-07-07 13:47:53 +01:00
likui
4e769f0ed0 Drop support for Python 3.6, 3.7
Python 3.6 and Python 3.7 support has been dropped since Zed [1]. This
necessitates changes our jobs to build and publish docker images since
those currently use Python 3.6. We now use Python 3.9.

[1] https://governance.openstack.org/tc/reference/runtimes/zed.html

Change-Id: I228b7ff6691a025f1ba9b7d9449f294868942151
Co-authored-by: Stephen Finucane <stephenfin@redhat.com>
2022-07-04 17:48:55 +01:00
Stephen Finucane
e49ad1795b pre-commit: Allow unsafe YAML
We're using tags in '.zuul.yaml', which requires use of the unsafe
parser [1].

[1] https://stackoverflow.com/a/45967047

Change-Id: Ib97480f6fcaba7406ffe284e1935744346684b8b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-07-04 12:16:16 +01:00
Zuul
366e164738 Merge "Stop testing lower-constraints" 2022-07-01 18:01:08 +00:00
Przemyslaw Szczerbik
6ccbcdde64 Add support for CRUD operations for QoS minimum packet rate rule
Closes-Bug: #1922237
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/810364
See-Also: https://review.opendev.org/785236
Change-Id: Ie7e1eb0575fd37121d5097ecbc318d0769ab3db0
2022-07-01 13:55:41 +00:00
Stephen Finucane
14b93fec76 image: Split image creation depending on service
The 'image create' operation is actually one of two operations: it can
be either an image service (glance) operation if the '--volume' argument
is *not* passed or a block storage (cinder) operation if it is. Make
this clearer and add a log warning users about options that are
supported by the former but not the latter.

Change-Id: Id153c951a7d18403568bf67e13d5e0a4827428d4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-06-30 11:54:45 +01:00
Stephen Finucane
4776e0a5ae image: Make better use of argparse
Simplify some logic by using a common 'dest' for mutually exclusive
options.

Change-Id: Ie5f3600672953f40be52de51e84717c8912ddaf8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-06-30 11:51:33 +01:00
whoami-rajat
9eea28ba59 Fix: create image from volume command
Currently the command ``openstack image create --volume`` calls cinderclient
to upload the volume to image service (glance) but OSC passes ``visibility``
and ``protected`` fields which are only available in microversion 3.1 or
greater. This generates an error if the user is using volume microversion
< 3.1 and wants to create an image from volume.
This patch fixes that by only passing ``visibility`` and ``protected`` fields
when the volume microversion is 3.1 or greater and fail otherwise i.e. the
following 3 cases:
1) visibility/protected argument + mv >= 3.1 = pass
2) visibility/protected argument + mv < 3.1 = fail
3) not visibility/protected argument + any mv = pass

Story: 2010060
Task: 45511
Change-Id: I568a0ea0af8f7f82b16d49a6a1bb0391b99c50dc
2022-06-30 11:15:33 +01:00
Stephen Finucane
2290b38ab3 image: Trivial style changes
Change-Id: I35b7b8a80609916eb47357af4398789788d66382
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-06-30 11:15:33 +01:00
Zuul
20e7b01af8 Merge "Skip test_quota_network_set_with_force func test" 2022-06-28 09:51:10 +00:00
Dr. Jens Harbott
c6e8648786 Skip test_quota_network_set_with_force func test
This test was added in [0] and it causes a lot of failures, since
setting the network quota to 1 will result in quota errors for any other
test that is trying to create a network in parallel. We can only run
this test in a serial tempest task that would need to be created for
such a scenario.

Related-Story: 2010110
Change-Id: I6015c181ecabff26bdb1b0c11b0e33ad39e6f083
2022-06-28 06:56:14 +02:00
Zuul
30622272e3 Merge "volume: Correct output of 'volume attachment create'" 2022-06-27 15:54:20 +00:00
Dr. Jens Harbott
604ceeedf9 Don't show tenant_id in network objects
Patch [0] dropped mapping the tenant_id attribute to project_id.
However, the Neutron API still returns the tenant_id attribute in
addition to the project_id and so we still need to discard it from
the output.

[0] I5f62f2a76592eaaaed6703624e959df41a6ecc8f

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Iba1e003bf587802f28928cb44d160b3b3fb1f840
2022-06-27 10:50:03 +02:00
Zuul
4f79def9aa Merge "Allow users to list all images" 2022-06-20 15:19:59 +00:00
Zuul
ec95b58482 Merge "Refactor "volume backup restore" command" 2022-06-20 15:19:56 +00:00
Zuul
15608a2696 Merge "Add more filter option of columns for server list -c COLUMN" 2022-06-20 15:19:49 +00:00
Cyril Roelandt
34d1e0c7eb Allow users to list all images
Add a "--all" option to "openstack image list", which allows the user to
list all of the images.

Story: 2010071
Change-Id: I56a2e4846d0380d07803305fb830d1a43dfd71b3
2022-06-07 20:22:34 +02:00
Zuul
ed304992eb Merge "Changed minversion in tox to 3.18.0" 2022-06-01 15:54:37 +00:00
Zuul
6810414e45 Merge "Migrate osc-tox-py3N-tips to Python 3.8" 2022-05-25 06:12:21 +00:00
Takashi Kajinami
8a03f3cabc Migrate osc-tox-py3N-tips to Python 3.8
python-novaclient 18.0.0 removed support for Python 3.6 and 3.7 and
can't be installed in Python 3.6.

This change migrates the osc-tox-py3N-tips from Python 3.6 to Python
3.8 as Python 3.8 is the minimum version currently supported.

This also adds Python 3.9 to supported runtime list because it has been
tested since stable/yoga.

NOTE:
The osc-tox-py36-tips job is used by cliff, so the subsequent patch
for the cliff repo should be merged timely.

Change-Id: Id7a8f3ca5b704102aa18eb6bf98ae9ada005d013
2022-05-24 09:02:16 +00:00
melanie witt
93578ef85b Add 'Host Status' to 'server list --long' with >= v2.16
Currently, the 'Host Status' field is shown only for 'server show' but
not for 'server list'. The host_status can be helpful for users who are
having issues with servers that show a status of ACTIVE, as it can show
a hint about the compute host status when nova policy is configured to
allow it.

Story: 2009689
Task: 44003

Change-Id: I6209cf52044218b7b32ab2fa5712574f12ba2f5f
2022-05-16 17:55:40 +00:00
Zuul
9fc9e8d9d7 Merge "Allow to filter multiple tags for image list" 2022-05-16 16:36:48 +00:00
Stephen Finucane
045f2e7e06 volume: Correct output of 'volume attachment create'
When adding these, we missed that the underlying cinder library call
actually returns a dictionary and not a Resource-based object. This
requires slightly different handling. Fix this.

Change-Id: Ie065fe4198ae1238830cb619220e856390d4cb6e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-05-16 12:47:39 +01:00
Zuul
ccd877dd40 Merge "Fix typos" 2022-05-16 09:36:14 +00:00
Dmitriy Rabotyagov
5cc6fc2b88 Allow to filter multiple tags for image list
Currently in case of passing `--tag` several times, only last one will
be picked up for the filtering. In the meanwhile Glance allow option to
be repeated multiple times to filter based on the multiple tags.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/789827
Change-Id: I7379d0b0014f0e3d13b02ee5ec6b642a7a5aa7d1
2022-05-16 09:16:52 +01:00
likui
c677192d51 Stop testing lower-constraints
[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-October/018445.html

Change-Id: I45e9a81d451c64cdd51f9b606d94161742bacdb7
2022-05-14 11:02:12 +08:00
Zuul
4b97a85181 Merge "Refactor network fakes to sdk properties PART 4" 2022-05-13 16:30:47 +00:00
Zuul
9b399c5528 Merge "Stop using private _is_uuid_like method" 2022-05-13 16:30:44 +00:00
Zuul
644106a89c Merge "volume: Add 'block storage resource filter list' command" 2022-05-13 15:24:26 +00:00
Zuul
7fcfce486b Merge "volume: Add 'block storage cluster *' commands" 2022-05-13 14:13:07 +00:00
Zuul
4b14c400ff Merge "tests: Improve logging for executed commands" 2022-05-13 11:57:56 +00:00
Stephen Finucane
53a7e67b41 volume: Add 'block storage resource filter list' command
These are based on the 'cinder list-filters' command, which accepts an
optional '--resource {resource}' option to limit the listed filters to a
single resource type.

  block storage resource filter list
  block storage resource filter show

We used the 'block storage resource filter' terminology rather than
simply 'resource filter' to highlight the fact that this is specific to
the block storage service.

Note that while this feature is a bit weird, good documentation can be
found at [1].

[1] https://docs.openstack.org/cinder/latest/admin/generalized_filters.html

Change-Id: I21e7c0ea427aef1f6665394d4b8e9a1f30d6dbb1
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-05-13 12:42:16 +01:00
Stephen Finucane
d727a65023 volume: Add 'block storage cluster *' commands
These mirror the 'cinder cluster-*' commands, with arguments copied
across essentially verbatim. The only significant departure is the
replacement of "tenant" terminology with "project".

  block storage cluster list
  block storage cluster set
  block storage cluster show

We used the 'block storage' terminology rather than simply 'volume' to
allow us to start distinguishing between the volume service and a volume
resource.

Change-Id: I9105a9e4a139af4929e3b1f3a6de6c9a53e0b598
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-05-13 11:59:23 +01:00
Nurmatov Mamatisa
ccd84f8f2b Refactor network fakes to sdk properties PART 4
Included resources:
port
network_agent
network_flavor_profile
network_rbac

Change-Id: I2e71a3c0fefb56ddcc75865c95746550e2710aa3
2022-04-29 16:40:23 +03:00
Pavlo Shchelokovskyy
afc5f997c8 Stop using private _is_uuid_like method
currently this double-private method of a dependency library
is used in several places (openstack.cloud._utils._is_uuid_like)

openstacksdk deliberatly chose not to depend on oslo.utils to keep
dependenies to the minimum, so it just copied several methods from it,
including the is_uuid_like.

python-openstackclient however already depends on oslo.utils, so
using the public method from oslo.utils should be preferred
and more stable.

Change-Id: I578ffa36ffb00c9d47ee12a149313201973edd32
2022-04-20 17:42:02 +03:00
JIHOJU
10835a1886 Add more filter option of columns for server list -c COLUMN
In order to improve the convenient of use,
columns corresponding to the "--long" option has been added
so that it can be used in the filter.
Currently filterable columns include the following:
'ID', 'Name', 'Status', 'Networks', 'Image', 'Flavor'.

Story: 2009150
Task: 43113
Change-Id: I6760ca5da0e3707d1d746ae5eeec7d9162020d15
2022-04-19 11:17:03 +00:00
Stephen Finucane
725b7de13c compute: Only retrieve necessary images
The Glance API allows us to filter by multiple IDs using the 'in:'
operator. Take advantage of this to speed up listing of server in larger
deployments where image counts in the hundreds (or even thousands) are
not uncommon.

Unfortunately the Nova API does not support something similar for
listing flavors. Boo.

Change-Id: I7d3222d0b0b8bf72b4ff3e429bc49e621b569979
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/837613
2022-04-12 20:41:29 +01:00
Nicolas Belouin
64e4520b2a Add trustor and trustee filtering to trusts list
The keystone API supports filtering trusts by trustor and/or
trustee.

Also adds a shortcut parameter to get trusts with current
user as trustee or trustor.

Signed-off-by: Nicolas Belouin <nicolas.belouin@gandi.net>
Change-Id: I00ed2b68cf8ada214a59f640f4f0a5c9dbc37063
2022-04-12 06:26:18 +00:00
Zuul
dabaec5a7b Merge "volume: fix backup list of deleted volume" 2022-04-11 09:43:13 +00:00
Zuul
8f07476e53 Merge "volume list: don't fail when there's no compute service" 2022-03-24 21:29:04 +00:00
Zuul
fe165ef76f Merge "Refactor network fakes to sdk properties PART 3" 2022-03-24 11:31:02 +00:00
Zuul
7602451ab5 Merge "Refactor network fakes to sdk properties PART 2" 2022-03-23 17:00:17 +00:00
Zuul
65dad11108 Merge "Refactor network fakes to sdk properties PART 1" 2022-03-23 16:55:25 +00:00
Rodolfo Alonso Hernandez
1c6d396ba3 Allow "--force" flag in quota network commands
This flag allows to set a new Neutron quota resource limit without
checking first the current resource usage. The new limit will be
set anyway. This flag was used only by the compute engine.

Related-Bug: #1953170
Change-Id: I7084f8208b804236ac99e6842db7a45854ce54d7
2022-03-17 02:38:07 +00:00
Nurmatov Mamatisa
8efe863129 Refactor network fakes to sdk properties PART 3
Included resources:
network_flavor
network_segment
network_segment_range

Change-Id: If5ce0a07052d9dc0edb4f5f22806635b5bb6a523
2022-03-16 12:30:21 +03:00
Thobias Salazar Trevisan
e91e0e001c compute: Add 'Security Groups' for 'server list'
Add a column with security groups name for
--long option on server list.

Change-Id: I7062f224e18c3c8ac96a06d7ce97f9fab473bdb9
2022-03-15 08:56:59 -03:00
Nurmatov Mamatisa
6fe0ae497c Refactor network fakes to sdk properties PART 2
Included resources:
ip_availibility
network

Change-Id: I141bcb43272594da75e776a84a74158fc866ac94
2022-03-15 11:48:33 +03:00
Nurmatov Mamatisa
23ad68264b Refactor network fakes to sdk properties PART 1
Included resources:
address_group
address_scope
auto_allocated_topology
availability_zone

Change-Id: I943f988588efbe68dd3ab17a18441b25ac8c8d4d
2022-03-15 11:28:44 +03:00
Huanxuan Ao
de4a69a29f Refactor "volume backup restore" command
Make the positional argument "volume" optional and add a "--force"
option (volume v2 only) to the "volume backup restore" command.

Closes-Bug: #1597189
Change-Id: If944e10158bd18e8331be63e96187a23e23095d7
2022-03-10 12:04:11 +00:00
Stephen Finucane
c9b84106c3 compute: Move server migrations commands to their own file
The 'openstackclient.compute.v2.server' module is getting rather large.
The server migration commands don't need to be in there. Move them.

Change-Id: I8b2600cfd9f8e37d3093c52c7222d85e84e7fc89
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-03-09 17:32:30 +00:00
Stephen Finucane
cffec4517f compute: Allow retrieval of migration by UUID
The nova API doesn't allow you to retrieve migration records by UUID,
only ID. This is confusing. Work around it by listing records and
filtering this list.

Change-Id: I932c9c70420e85056509513e005bb78168e70611
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-03-09 17:31:44 +00:00
Zuul
8c975ba097 Merge "Fix 'server event list|show' for deleted servers" 2022-03-09 13:44:47 +00:00
Zuul
be1de891ac Merge "compute: Use correct command class for 'show migration'" 2022-03-09 13:44:29 +00:00
Zuul
91a963873f Merge "Fix metavars and typos in local_ip" 2022-03-09 13:44:26 +00:00
Jan Hartkopf
8acead32ee volume: fix backup list of deleted volume
When trying to list backups of a deleted volume with --volume,
openstackclient fails because the volume does not exist.
However, for listing a volume's backups, the volume itself
does not need to be present.

Fix this issue by allowing the volume of the requested backups
to not exist.

Story: 2009901
Task: 44716
Change-Id: Iea1a567151f427fa0e1ccff3af5cbeab620defcd
Signed-off-by: Jan Hartkopf <jhartkopf@inovex.de>
2022-03-08 16:28:43 +01:00
OpenStack Release Bot
54b32a37d7 Add Python3 zed unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for zed.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: Id79fecd4c4b16f2e5c3a5713be50327757346c1a
2022-03-08 12:49:48 +00:00
OpenStack Release Bot
15a7838c30 Update master for stable/yoga
Add file to the reno documentation build to show release notes for
stable/yoga.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/yoga.

Sem-Ver: feature
Change-Id: Ie1126dddd3666d3dc108190133df5e3b085a8404
2022-03-08 12:49:45 +00:00
Nurmatov Mamatisa
3e61824d4a Fix metavars and typos in local_ip
Change-Id: I2094f343e3353da25f9c5057ea5444345e271665
2022-03-02 12:52:14 +00:00
Zuul
63452f362d Merge "Add support for setting extra DHCP options on existing ports" 2022-02-25 13:26:11 +00:00
Zuul
bf71727c55 Merge "Add support for 'remote-managed' vnic type" 2022-02-23 07:55:28 +00:00
Slawek Kaplonski
47fa9ba356 Add support for setting extra DHCP options on existing ports
It is now possible to set extra DHCP option for an existing port using
"port set" command. It works in the same way like during port creation.

Story: 2009095
Task: 42927
Change-Id: I3577d4e3a303137b708ae8687c44b486aa82e296
2022-02-21 22:52:38 +01:00
Dr. Jens Harbott
077c9a77a2 volume list: don't fail when there's no compute service
There may be deployments that only have a volume service but no compute
service, possibly as an intermediate step during the initial setup.
Don't fail the "volume list" command when no compute client can be
initiated.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Idef77bdc8753a456a4c431b0385318dff6581a65
2022-02-17 16:08:57 +01:00
melanie witt
72a2477ec0 Fix 'server event list|show' for deleted servers
As of compute microversion >= 2.21, support for list and show of server
events for deleted servers was added. This however wasn't working using
the openstackclient because the compute GET /servers/{server_id} will
not return a deleted server, so osc_lib.utils.find_resource() fails to
find the server and the command bails early.

This adds a check for a uuid-like <server> arg and uses it directly if
the <server> cannot be found via find_resource().

A note is also added to the command help to indicate that list and show
for deleted servers will only work if a server ID is passed (name will
not work).

Story: 2009841
Task: 44443

Change-Id: Icd33b3b9a3a1855d7893dd111bbb2aca059f45fd
2022-02-09 23:26:25 +00:00
Zuul
d876b41958 Merge "image: Sanity check the 'SetImage' command" 2022-02-09 21:00:49 +00:00
Zuul
811add8b58 Merge "tests: Update fake image client in tests" 2022-02-09 21:00:46 +00:00
Zuul
20500c6ac9 Merge "image: Remove FakeImage test helper" 2022-02-09 20:42:43 +00:00
Zuul
f7eaaa8408 Merge "docs: Document additional 'server migration' commands" 2022-02-09 20:42:40 +00:00
Zuul
b072118afc Merge "compute: Don't warn if disk overcommit params unset" 2022-02-09 20:42:33 +00:00
Zuul
27843fc232 Merge "Add missing command mapping in nova" 2022-02-09 12:50:18 +00:00
Zuul
5f73c527ee Merge "Support Neutron Local IP CRUD" 2022-02-09 12:50:15 +00:00
Stephen Finucane
9c5220c97b docs: Document additional 'server migration' commands
Only 'server migration list' was being documented.

Change-Id: I038ff2bcf7bb852d619004bb00306d2d388135a7
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-02-08 15:27:58 +00:00
Frode Nordahl
d565f11093
Add support for 'remote-managed' vnic type
The 'remote-managed' vnic type will be used to support off-path
SmartNIC port binding with OVN, and it is expected that the user
will create ports with this vnic type as part of the workflow.

As such the client must allow users to interact with this
vnic type and this patch addresses that.

Partial-Bug: #1932154
Depends-On: I496db96ea40da3bee5b81bcee1edc79e1f46b541
Change-Id: I566c3da594d757dd62edcf7f9ea3077db8d6b11a
2022-02-08 07:26:46 +01:00
Zuul
e000fd5f0d Merge "Add network update quota "limit_check" parameter" 2022-02-03 15:53:02 +00:00
Dr. Jens Harbott
746b91335c Don't fail on extlinks warnings for reno build
With Sphinx==4.4.0 some "helpful" warnings were introduced when an
external link could be replaced by a macro, like for :lpbug:. Sadly we
have a very high number of existing release notes that trigger these
warnings and no good way to fix them retrospectively, because would mess
up their mapping to releases. So we change the logging for the
sphinx.ext.extlinks to ignore these warnings for now.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I709de5e454434b8790a68d9e67ca1432387b21ab
2022-02-03 12:19:27 +01:00
Nurmatov Mamatisa
26144743d9 Support Neutron Local IP CRUD
Add support for Neutron Local IP CRUD operations.

Partial-Bug: #1930200
Depends-On: https://review.opendev.org/c/openstack/neutron/+/804523
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/804988
Change-Id: I1095100efb27b8559412469f0a9d07fc0a3db9d5
2022-01-28 17:24:04 +03:00
Zuul
f00dce9e2f Merge "Get rid of tenant_id in the network commands" 2022-01-17 17:39:20 +00:00
Zuul
7c7a30b3cd Merge "Skip original_name from flavor info" 2022-01-17 09:28:37 +00:00
Artem Goncharov
18dcd7c9f7 Get rid of tenant_id in the network commands
Finally drop tenant_id completely from the networking service.

Change-Id: I5f62f2a76592eaaaed6703624e959df41a6ecc8f
2022-01-17 09:31:16 +01:00
Ritvik Vinodkumar
b5a2714b83 Switch compute service list, delete and set to sdk.
Switch the compute service commands from novaclient to SDK.

Change-Id: I16498905101d6c2702a3ccbaf8cf5e3098d51992
2022-01-14 18:36:37 +00:00
Artem Goncharov
f461af0ac8 Skip original_name from flavor info
In the new SDK we are going to add additional parameter to the flavor
which make no use for OSC. Exclude it explicitly since it also cause
failing tests.

Change-Id: Ie35e60498cf18f05c878611df6f88607a04b1870
2022-01-14 17:37:59 +01:00
Zuul
0a887a4786 Merge "Add --security-group to port list" 2022-01-13 20:13:30 +00:00
Dr. Jens Harbott
f533dca520 Fix volume set functional test
Sometimes it can happen that when extending a volume it is shown as
status "extending" with the original size for a while. Wait for the
volume to enter state "available" again before checking the result.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: Ib70cfa1c241ce94426214c7a05c550213f427caa
2022-01-11 07:24:48 +01:00
Zuul
b79c0b6cfb Merge "Include hosts in aggregate list --long" 2021-12-25 10:54:27 +00:00
Zuul
eb139f6fe8 Merge "compute: Return information about fixed IP" 2021-12-25 10:54:24 +00:00
Zuul
9b49363c0d Merge "Switch add fixed IP to SDK" 2021-12-25 10:54:22 +00:00
Zuul
6a0187d47c Merge "compute: Pass through args to ssh" 2021-12-25 10:54:20 +00:00
Zuul
ba935590f4 Merge "compute: Fix weird option definition for 'server ssh'" 2021-12-25 10:54:18 +00:00
Dr. Jens Harbott
724852e66e Add location to fake network objects
Network objects returned from the SDK include a location column which
has a reference to the cloud to which the object belongs. Add this
column to our fake objects used for testing, so that we can make sure we
don't include them in CLI output where they are useless.

Change-Id: Ib09027af78e7bf2458cdc76ea9027faa3dbbfcf9
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
2021-12-16 19:33:29 +00:00
Dr. Jens Harbott
90eb0ca4bb Hide location columns for network objects
Network objects returned from the SDK include a location column which
has a reference to the cloud to which the object belongs. We don't want
to include them in CLI output where they are useless.
The solution implemented in [0] was dropped as a sideeffect in [1].

[0] https://review.opendev.org/c/openstack/python-openstackclient/+/679445
[1] https://review.opendev.org/c/openstack/python-openstackclient/+/815032

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I9a408d9721c9c57d752afaab520cd6ee379a5184
2021-12-16 19:33:04 +00:00
Hugh Saunders
3a929611c0 compute: Pass through args to ssh
Why limit a user to preset ssh arguments? Capture them all and send
them along to ssh to deal with. This allows users to use the full range of
ssh arguments, including specifying a command to run on the
instance. For example:

  openstack server ssh -4 upg -- -l cirros -i ~/id_rsa_upg "date; uptime"

SSH arguments that openstackclient currently mirrors are deprecated
except for -4 and -6, as they are useful for retrieving the correct
instance IP.

Change-Id: Ia50786d5eee52688e180550fe16aeb8af610154b
Co-authored-by: Stephen Finucane <stephen@that.guru>
2021-12-15 17:41:58 +00:00
Stephen Finucane
ba69870d86 compute: Fix weird option definition for 'server ssh'
argparse allows you to specify multiple options for a given argument
when declaring the argument. For some reason, we weren't doing this for
the 'server ssh' command. There's no apparent reason for doing things
this way and it's been that way since the beginning (2013) so let's not
do that.

We also add unit tests since they were missing and should exist.

Change-Id: I67a9e6516d7057266210cd4083e9ddeb1cfaa5de
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-12-15 17:41:05 +00:00
Stephen Finucane
0cde82dcd8 compute: Return information about fixed IP
The compute API provides this information to us. We might as well use
it.

Change-Id: I5608fa80745975ce49712718452cfe296c0f64d2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-12-14 15:55:33 +00:00
Ritvik Vinodkumar
9971d7253e Switch add fixed IP to SDK
Switch the add fixed IP command from novaclient to SDK.

Change-Id: I4752ea7b4bfc17e04b8f46dbe9a68d938501a89e
2021-12-14 14:55:22 +00:00
Zuul
c10a4cd966 Merge "Allow unset port's host_id" 2021-12-13 10:26:18 +00:00
Stephen Finucane
b3cb85f112 tests: Improve logging for executed commands
We're seeing failures in a recently added tests,
'ServerTests.test_server_add_remove_volume' from
'openstackclient/tests/functional/compute/v2/test_server.py'. These
failures are likely the result of slow CI nodes, but we don't have
enough information in the CI logs to debug them. Starting logging the
various commands executed in tests so that we can see these logs if and
when tests fail.

Change-Id: I4584dc5e6343fe8c8544431a527d8c3c7e7b3c5b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-12-09 17:23:32 +00:00
Dr. Jens Harbott
4e9b929842 Allow setting gateway when creating a router
These options are not only valid when modifying a router, but also when
one is created initially.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I3e12901f37cbd1639ac9dc9cc49b04114b80474c
2021-12-09 13:49:27 +00:00
Dr. Jens Harbott
32e18253fa Fix RemoveServerVolume
The nova API we're using to delete a server volume attachment needs to
be handed a volume, not a volume attachment.

Also make sure that we create an error if the volume isn't actually
attached to the server.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Co-authored-by: Stephen Finucane <sfinucan@redhat.com>
Change-Id: I12abd3787ea47acb4da282d00fdc1989405a0564
2021-12-08 17:59:27 +00:00
Rodolfo Alonso Hernandez
bef70397a3 Add network update quota "limit_check" parameter
This new parameter commands the Neutron server to first check the
resource usage before setting the new quota limit. If the resource
usage is below the new limit, the Neutron server will raise an
exception.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/806254
Depends-On: https://review.opendev.org/c/openstack/neutron/+/801470

Partial-Bug: #1936408
Change-Id: Idc1b99492d609eb699d0a6bef6cd760458a774f6
2021-12-07 17:49:26 +00:00
Rodolfo Alonso Hernandez
c8c4f76498 Add --security-group to port list
The neutron API supports filtering ports by security group.

Closes-Bug: #1405057

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/804979
Change-Id: I0f626882716c21ac200c1b929ea04664d21874d8
2021-12-02 11:12:47 +00:00
Zuul
9eb42403d3 Merge "compute: Show flavor in 'server list' with API >= 2.47" 2021-11-30 19:45:10 +00:00
Zuul
d9ad0b5d46 Merge "Switch openstack server remove port/network to using sdk" 2021-11-30 19:08:01 +00:00
Zuul
e02fd2ab18 Merge "Switch server suspend and server resume to SDK" 2021-11-30 19:07:58 +00:00
Zuul
cf02135b52 Merge "Switch server pause and server unpause to SDK" 2021-11-30 19:07:55 +00:00
Zuul
3456ee7031 Merge "compute: Reorder building of columns for 'server list'" 2021-11-30 19:07:53 +00:00
Khomesh Thakre
8e362402de compute: Show flavor in 'server list' with API >= 2.47
Fix the issue where the flavor name was empty in server list output.
This requires somewhat invasive unit test changes to reflect the changed
API response from the server, but this has the upside of meaning we
don't need new tests since what we have validates things.
Also drop the flavor ID column as it is removed from the compute API.

Change-Id: Ica3320242a38901c1180b2b29109c9474366fde0
Signed-off-by: Khomesh Thakre <khomeshthakre24@gmail.com>
Story: 2008257
Task: 41113
2021-11-30 16:52:37 +00:00
Stephen Finucane
4c3de28e83 compute: Reorder building of columns for 'server list'
This has no impact on the end result, but it should make fixing issues
introduced by API microversion 2.69 a little easier.

Change-Id: I7d70eac8aa1a6197ed05a49f071e6899ec219c03
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-30 09:34:38 -05:00
Zuul
1cd0d084f5 Merge "image: Remove dead test helper methods" 2021-11-29 21:54:49 +00:00
Thrivikram Mudunuri
ff96fea012
Switch server suspend and server resume to SDK
Switch the server suspend and server resume commands from novaclient to
SDK. Use the SDK versions of test fakes to support fake Server
resources.

Change-Id: Idd0b4f13fab0f238e42844a7d759538bbda24f68
2021-11-29 11:50:04 -05:00
Thrivikram Mudunuri
b515fe61b2
Switch server pause and server unpause to SDK
Switch the server pause and server unpause commands from novaclient to
SDK. Use the SDK versions of test fakes to support fake Server
resources.

Change-Id: Id626f06f3d7edd44b306b7fc7b9b00d04af09621
2021-11-29 11:47:58 -05:00
Diwei Zhu
f82afc7f37 Switch openstack server remove port/network to using sdk
Change-Id: I1540c1f52e9a107dba20eeea9dc323c5510fe2b1
2021-11-29 14:31:07 +00:00
Zuul
397688320d Merge "Switch server image create to SDK" 2021-11-29 13:38:51 +00:00
Slawek Kaplonski
f462933113 Allow unset port's host_id
It is supported by Neutron and needs to be done like that when e.g.
admin wants to unbound port from the host.

Task: #44043
Story: #2009705
Change-Id: I08f1bb40f4dc72cfa7c62feeb5f513455de0ca45
2021-11-28 19:58:46 +01:00
Diwei Zhu
fae293dd52 Switch command server remove volume to sdk
Change-Id: If6f6cf93b55a67e767c54de8ce21f25252cf99ca
2021-11-26 16:11:21 +00:00
Diwei Zhu
28cd5763de Add functional test for server add/remove volume.
Change-Id: I86a76f32790cafcff1d94364fb72f8890a8cb025
2021-11-26 14:11:02 +00:00
Zuul
4b3cdaf8b1 Merge "Switch command server add volume to sdk." 2021-11-25 17:46:47 +00:00
Zuul
6fb71af243 Merge "Add --subnet-pool to subnet list" 2021-11-25 17:46:44 +00:00
Dr. Jens Harbott
860d636047 Temporarily drop aodhclient from doc build
Building plugin documentation is failing for aodhclient when running
with latest pyparsing. Drop the plugin from docs for now until the issue
can be fixed.

Needed-By: https://review.opendev.org/c/openstack/requirements/+/818614/
Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I1cc1efd9ff2004dd711ed9da0b1d9e8be31175f4
2021-11-24 06:51:17 +01:00
Diwei Zhu
3078a0a121 Switch command server add volume to sdk.
File tests.unit.volume.v2.fakes is modified to provide sdk volume fakes.
File tests.unit.compute.v2.fakes is modified to provide sdk volume
attachment fakes. For test, setup_sdk_volumes_mock() method is created
so that volumes are created in similar way as servers are created.

Change-Id: I290ba83b6ba27a1377ab73fd0ae06ecced25efd1
2021-11-22 16:01:29 +00:00
JieonLee
b3d09ffc37 Add missing command mapping in nova
nova command: instance-action
openstack command: server event show

Change-Id: I8e5dad90cfd28b1f0d65be688651918869f679e4
2021-11-21 05:05:25 +00:00
Stephen Finucane
61fac5b79e image: Sanity check the 'SetImage' command
This was a very difficult command to grok, due to the layering on of
additional features over the years. Make this a little easier to follow
by grouping related logic and making use of argparse features.

Change-Id: I4e1a0aed09ea5d6a8c26ec3e888c9c7b6cefc25a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-17 11:42:07 +00:00
Stephen Finucane
1feb676469 tests: Update fake image client in tests
These clients are intended to fake out the old glanceclient client which
we no longer use. They were only "working" because we weren't actually
using any of the glancelclient-based stuff and were instead overriding
everything within the tests. Move these overrides back to the main
fake client and remove the crud.

Change-Id: I92ee74a1df72a6dd23f9d2dc04342aab0cbd3210
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-17 11:42:07 +00:00
Stephen Finucane
2135a9ea05 image: Remove FakeImage test helper
We're no longer creating fake versions of glanceclient's 'Resource'
object but rather openstacksdk objects. As such, there's no point
nesting things under a fake resource class.

Change-Id: I39cd5302622f4542db9eebcccfad0cb90d077441
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-17 11:34:42 +00:00
Stephen Finucane
690e9a13a2 image: Remove dead test helper methods
These haven't been used since we switched the image commands from
glanceclient to openstacksdk. There's more cleanup to be done here but
that can be done later.

Change-Id: I3de1f24323886b122b3a30660fb3de18eb7014e9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-17 11:34:36 +00:00
Thrivikram Mudunuri
9acbd3e105
Switch server image create to SDK
Switch the server image create command from novaclient to SDK. Use the
SDK versions of test fakes to support fake Server resources. Also,
fetch updated image *after* waiting. If a user requests that we wait
(--wait) for a server image to become active before returning, then we
should probably return the final image. If we don't then the image can
appear to be in a non-active state when it fact it's active. Correct
this by fetching the image after the wait call.

Change-Id: I83a403c035add9ab041ed6d59b5b29e42267f143
2021-11-16 11:36:02 -05:00
Zuul
8b394e5641 Merge "Switch openstack server add port/network to using sdk." 2021-11-15 16:31:15 +00:00
Diwei Zhu
2183a61147 Switch openstack server add port/network to using sdk.
The old novaclient.v2.server.Server.interface_attach() method is
replaced with proxy.create_server_interface().
In swargs, 'net_id' and 'port_id' are mutual-exclusive, if one of
them is given with value, the other one cannot be None, as the
API would responde with 400 (None is not string).
In unit test, temporary method 'setup_sdk_servers_mock' is added,
because other tests are still using the old 'setup_servers_mock'.
Functional tests are added. Releasenote is generated.

Change-Id: I9899f0509febc5143560a1859ae6344d0a6d1427
2021-11-14 15:23:36 +00:00
Stephen Finucane
163cb01e46 compute: Return details of attached volumes
The API behind the 'server add volume' command returns details of the
created volume attachment, however, we were dropping these results
rather than displaying them to the user. Correct this.

Change-Id: I3f7e121220d29422ccf4e6940de2f28bb8496c83
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-11-03 11:57:31 +00:00
Stephen Finucane
442838ed15 compute: Use correct command class for 'show migration'
We should be inheriting from 'ShowOne'. Failure to do so results in a
tuple being dumped to the screen. Not what we intended.

While we're here, we update the docstring of this command to clarify the
command's intent. Nova does not provide an API to retrieve an individual
migration record for a cold migration or completed live migration. As
such, the 'server migration show' command only works for in-progress
live-migrations.

Change-Id: I2e2fe3da7d642b9e8e3d930603dcde178cd68cde
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2009658
Task: 43837
2021-11-03 10:19:52 +00:00
Stephen Finucane
8cb0a28607 compute: Don't warn if disk overcommit params unset
Due to a small logic error, we were emitting a warning about a
deprecated option when the user tried to live migrate an instance using
microversion 2.25 even though the user hadn't actually set that option.
Correct this.

Change-Id: Ib61e817bd4ced9b5533e7c7f9d8f0b45fe81c211
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2009657
Task: 43836
2021-11-03 10:17:37 +00:00
Zuul
f824e13bc5 Merge "Switch server backup to sdk." 2021-10-27 16:52:23 +00:00
Diwei Zhu
57aad01886 Switch server backup to sdk.
Switch this command from novaclient to SDK. As this is the first command
related to server that we are migrating, we need to extend our test
fakes to support fake Server resources. The extended fakes will replace
the old ones once all commands related to server are switched.

Change-Id: If476fb1614a64320ed071bbda35e941bf3290a2e
2021-10-27 09:11:27 +00:00
Cyril Roelandt
43639e1118 Fix typos
Change-Id: Idd502c8df21da79ff3b9339870f38378f5337879
2021-10-26 15:53:51 +02:00
Stephen Finucane
728401bbd7 Remove remnants of 'six'
Just one entry left. Remove it.

Change-Id: Ia12173ecb7f3fed4a1195a46ebf9b096d917b3b6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-10-21 17:14:45 +01:00
Stephen Finucane
30612bf622 Remove 'get_osc_show_columns_for_sdk_resource' duplicates
There were a number of 'get_osc_show_columns_for_sdk_resource' defined
in-tree. However, osc-lib has provided this method for some time (since
2.2.0, June 2020 [1] - our minimum version is currently 2.3.0) so
there's no need to provide our own copies. Remove them.

[1] https://github.com/openstack/osc-lib/commit/29a0c5a5

Change-Id: I25695f4f9a379dd691b7eaa1e3247164668ae77e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-10-21 17:14:45 +01:00
Stephen Finucane
a797c9d2a3 tox: Ignore virtualenvs for pep8 environment
Change-Id: I473d1b6c1287325566a5f5f5aadaea802c6af6f4
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-10-21 17:14:45 +01:00
Zuul
c985e0a23b Merge "Update the Nova CLI docoder document" 2021-10-21 10:23:23 +00:00
Stephen Finucane
53debe7fe1 compute: Fix filtering servers by tags
The nova API expects the 'tags' and 'not-tags' filters of the 'GET
/servers' (list servers) API to be a CSV string [1]:

  tags (Optional)
    A list of tags to filter the server list by. Servers that match all
    tags in this list will be returned. Boolean expression in this case
    is 't1 AND t2'. Tags in query must be separated by comma.

    New in version 2.26

  not-tags (Optional)
    A list of tags to filter the server list by. Servers that don’t
    match all tags in this list will be returned. Boolean expression in
    this case is 'NOT (t1 AND t2)'. Tags in query must be separated by
    comma.

    New in version 2.26

We were instead providing a Python list, which was simply being URL
encoded. Correct this.

[1] https://docs.openstack.org/api-ref/compute/?expanded=list-servers-detail#list-servers

Change-Id: Ie0251a0dccdf3385089e5bbaedf646a5e928cc48
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1946816
2021-10-13 10:30:26 +01:00
Zuul
e0c61f0cbe Merge "Update the Nova CLI decoder document" 2021-10-08 09:06:20 +00:00
JIHOJU
e06a4f1c20 Update the Nova CLI docoder document
There are several update in CLI decoder document.
- Change flavor set/unset to flavor set/unset --property
- Update the mapping with flavor-update, interface-attach, and interface-detach

Change-Id: I1db50188b3643d3fe28689dc73b3f63806defd29
2021-10-07 21:03:25 +09:00
Zuul
30bb576d81 Merge "Fix the functional-tips tox environment" 2021-10-07 11:06:13 +00:00
choidoa-git
70fed75c85 Update the Nova CLI decoder document
In this patch, Update missing command in Mapping Guide.

List of updated commands
(Nova CLI / OSC)
- server-migration-list / server migration list
- server-migration-show / server migration show
- live-migration-abort / server migration abort
- live-migration-force-complete / server migration force complete
- migration-list / server migration list
- evacuate / server evacuate
- flavor-access-add / flavor set --project
- flavor-access-list / flavor show
- flavor-access-remove / flavor unset
- server-tag-add / server set --tag
- server-tag-delete / server unset --tag
- server-tag-delete-all / server unset --tag
- server-tag-list / server list --tag
- server-tag-set / server set --tag
- quota-class-show / quota show --class

Change-Id: Id1b4980fbc0f6e8e58bfae6f393f9336c6a7e3b1
2021-10-07 10:40:15 +00:00
Zuul
81bab3a716 Merge "Remove non-working code after method return." 2021-10-07 07:31:56 +00:00
Zuul
d79ebc5278 Merge "Add --trusted-image-cert option for server create" 2021-10-06 22:14:37 +00:00
Zuul
49d2c21366 Merge "Fix typo error in listing server's column name" 2021-10-06 17:32:24 +00:00
Zuul
5a8a3b33a1 Merge "Fix that the path of functional test" 2021-10-06 12:11:07 +00:00
Zuul
f4e4cd25c5 Merge "Replace assertItemsEqual with assertCountEqual" 2021-10-06 12:11:06 +00:00
lsmman
abed9f20f5 Remove non-working code after method return.
Delete duplicate return code.

While adding return of a new Member type, the existing return code part is not deleted.

Note the code in fakes.py in the below commit where these codes were added.
- Project: python-openstackclient
- The commit: 60e7c51df4

Change-Id: Iae44770a784732991962cd38472095f76ab2543f
2021-10-06 19:21:51 +09:00
Pavlo Shchelokovskyy
28a376bfb0 Add --trusted-image-cert option for server create
this already exists for server rebuild, but was missing for server
create.

This option is supported from Compute API version >= 2.63, and is only
available for servers booted directly from images (not from volumes,
not from snapshots, and not from images first converted to volumes).

Additionally, this patch removes mentions of
OS_TRUSTED_IMAGE_CERTIFICATE_IDS env var from similar option help string
in server rebuild command as it is not actually implemented yet.

Change-Id: I4e9faea05c499bd91034d1d284c44fdcc8e18db5
2021-09-30 19:42:26 +03:00
ryanKor
c0a0f0f3d8 Fix that the path of functional test
before change:
$ tox -e functional -- --regex functional.tests.compute.v2.test_server
after change:
$ tox -e functional -- --regex tests.functional.compute.v2.test_server

the test unit path document should be change the above line.

(fixed wrong letter)

Change-Id: I49674fb0d56ee65c1f6328b9d960b16876173e2d
2021-09-25 21:34:47 +09:00
OpenStack Release Bot
ff372ffdfb Add Python3 yoga unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for yoga.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: I89cff43c0eb97c63deaba320e0fc63bd8ba31a2a
2021-09-22 10:42:18 +00:00
OpenStack Release Bot
8ef9280af9 Update master for stable/xena
Add file to the reno documentation build to show release notes for
stable/xena.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/xena.

Sem-Ver: feature
Change-Id: Iedf2c908bf5a9d87effa02717eb604ee8d15ef3b
2021-09-22 10:42:16 +00:00
Alfredo Moralejo
ed5d2a37c5 Replace assertItemsEqual with assertCountEqual
Follow-up of [1]. After this patch was sent, two more assertItemsEqual
were added in [2]. This patch is fixing it.

[1] https://review.opendev.org/c/openstack/python-openstackclient/+/789410
[2] https://review.opendev.org/c/openstack/python-openstackclient/+/781637

Change-Id: Ic2276bd0ff0f5df76505f37d8994b3384d40e9a7
2021-09-09 15:50:54 +02:00
Zuul
3a0571c4df Merge "compute: Add support for microversion 2.90" 2021-09-02 20:15:11 +00:00
Lee Yarwood
51ee17a94d compute: Add support for microversion 2.89
This microversion drops the duplicate ``id`` field while adding
``attachment_id`` and ``bdm_uuid`` to the output of the
os-volume_attachments API reflected within osc by the ``openstack server
volume list $server``command.

Depends-On: https://review.opendev.org/c/openstack/nova/+/804275
Change-Id: I8a7002d8d65d7795e106b768df868198ab8b8143
2021-09-02 14:35:17 +01:00
Stephen Finucane
8e833a3ed2 compute: Add support for microversion 2.90
Allow configuring hostname when creating a new server or updating or
rebuilding an existing server.

Change-Id: Ibe603eab78bbbec43605f56de62a20493b6aa93d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/python-novaclient/+/806917
2021-09-01 13:18:25 +01:00
Ghanshyam Mann
6ce7da8aeb [community goal] Update contributor documentation
This patch updates/adds the contributor documentation to follow
the guidelines of the Ussuri cycle community goal[1].

[1] https://governance.openstack.org/tc/goals/selected/ussuri/project-ptl-and-contrib-docs.html

Story: #2007236
Task: #38547
Change-Id: I0afa1796d488a96160f4a7fd615920d05fe1771c
2021-08-30 17:13:12 +00:00
LEE JAE YONG
4aad7dd779 Fix typo error in listing server's column name
openstack server list -c "Created At" command doesn't work
because the wrong variable was used here.

When we receive resp data, Created At data is saved with
the name "created". But in "server.py", we append columns
as created_at. So it seems to print an empty table.

Story: 2009149
Task: 43112
Change-Id: I06de6903d5cc427a8b0fdcd168fec47192f4365b
2021-08-28 07:17:04 +00:00
Zuul
d9c556e69a Merge "L3 conntrack helper: Use singular name consistently" 2021-08-26 08:14:22 +00:00
Zuul
eca51342c3 Merge "volume: Add 'volume transfer request create --(no-)snapshots' option" 2021-08-26 08:03:53 +00:00
Zuul
6776cec809 Merge "openstack image create: honor protection/visibility flags" 2021-08-26 08:02:34 +00:00
Zuul
2c89812714 Merge "volume: Add missing 'volume list --offset' parameter" 2021-08-26 08:00:40 +00:00
Zuul
4fc1ac2ce2 Merge "Replace assertItemsEqual with assertCountEqual" 2021-08-23 21:20:16 +00:00
Zuul
2dfaf62340 Merge "Update volume create documentation" 2021-08-19 04:32:51 +00:00
melanie witt
12c93c6d5f Show "Forced Down" compute service status with --long
Currently, the unified client does not have the ability to show the
"Forced Down" field of a GET /os-services response in microversion 2.11
even though the legacy client can.

This adds a "Forced Down" column to the 'openstack compute service list
--long' command output when microversion 2.11 is used.

Story: 2009115
Task: 43011

Change-Id: I10bc2fedbf0e867a990227962b2b6e60f5681f69
2021-08-17 01:34:05 +00:00
melanie witt
ed87f7949e Correct REST API response fields for /os-migrations API
The compute APIs are unfortunately inconsistent with regard to the
response parameters for migrations.

* GET /servers/{server_id}/migrations returns server_uuid
* GET /os-migrations returns instance_uuid

Because the 'Server UUID' column is being specified for parsing the
response from GET /os-migrations, it is always showing as an empty
string to users.

There are a few other mismatches between the column names and the REST
API response fields [1]:

* 'Old Flavor' vs 'old_instance_type_id'
* 'New Flavor' vs 'new_instance_type_id'
* 'Type' vs 'migration_type'

This adds a new list containing the REST API response field names to
pass to utils.get_item_properties so that the responses are correctly
parsed and the client output contains the response data instead of
empty strings.

Story: 2009078
Task: 42890

[1] https://docs.openstack.org/api-ref/compute/?expanded=list-migrations-detail#list-migrations

Change-Id: I8aab60619e0225047f6a1c31e44917ca8fcc799e
2021-07-28 15:25:06 +00:00
Zuul
59256becc9 Merge "compute: Note that '--password' is deployment-specific" 2021-07-27 12:13:40 +00:00
Stephen Finucane
e0dc31f32e volume: Add missing 'volume list --offset' parameter
Looking at the code for the ancient v1 cinder API, we see that this
supported offset-style pagination [1][2][3]. Add this parameter,
simplifying a future patch to standardize pagination across OSC.

[1] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L259
[2] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/v1/volumes.py#L292
[3] https://github.com/openstack/cinder/blob/juno-eol/cinder/api/common.py#L120

Change-Id: Ifec208ea9ed7afb4bebced6132abb96a3af034b5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-07-27 11:15:23 +01:00
melanie witt
4f6fe1c0fd Fix TestListMigrationV223 test class MIGRATION_COLUMNS
Currently only the test_server_migration_list adds the 'Id' and 'Type'
columns to the expected output, so if the
test_server_migration_list_no_options test is run by itself, it fails
as the actual response contains 'Id' and 'Type' but the reference does
not. This example run fails:

  tox -epy38 test_server_migration_list_no_options

The reason the tests pass in the gate is because
test_server_migration_list (which adds the 'Id' and 'Type' columns to
self.MIGRATION_COLUMNS) appears to always run before
test_server_migration_list_no_options, so the latter test gets the
benefit of the former test's column additions.

This changes the test class to just include the 'Id' and 'Type' columns
all the time as they are always returned in microversion 2.23 anyway.

Story: 2009079
Task: 42891

Change-Id: I2c97e9f64790b5e978e4d04230d45b8e343b53d4
2021-07-27 02:20:39 +00:00
Stephen Finucane
c1209601b4 tests: Handle removal of block-storage v2 API
Cinder recently removed their v2 API [1] which is causing the functional
tests to fail. Improve our 'is_service_enabled' test helper to use the
'versions show' command, which queries the service catalog and can give
us information about the service version as well as answer the more
general "is this service available" question. We also resolve a
long-standing TODO in the process.

[1] https://review.opendev.org/c/openstack/cinder/+/792299

Change-Id: I381069357aa008344e15327adf3a863c0c2e1f04
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-07-23 12:51:30 +01:00
Stephen Finucane
a821d6b7c5 volume: Add 'volume transfer request create --(no-)snapshots' option
This closes a gap with cinderclient's 'transfer-create' command.

Change-Id: I7386a7be15c0e3ee87abbcfc2275ba8524c10ff8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2009054
Task: 42831
2021-07-13 20:33:35 +01:00
Ghanshyam Mann
4891bb3820 Moving IRC network reference to OFTC
Change-Id: I11e00f18fa8dca02bc0f136c0c5e9a2f040eef8f
2021-07-07 19:43:00 -05:00
Zuul
12355b8dac Merge "cinder: Remove redundant command" 2021-07-07 15:12:12 +00:00
Zuul
ab6e905353 Merge "compute: Fix typo" 2021-07-02 18:29:30 +00:00
Zuul
4f35836798 Merge "Make functional Neutron tests running fine on ML2/OVN environments" 2021-06-29 17:13:27 +00:00
Stephen Finucane
af406f33e3 cinder: Remove redundant command
There is no 'volume group unset' command nor any need for one right now.
This was mistakenly added in I3b2c0cb92b8a53cc1c0cefa3313b80f59c9e5835.

Change-Id: I9386d1350099b10659c6b0e632e4d83cae5b2bfd
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-22 18:26:54 +01:00
Zuul
19b4ce402e Merge "Correct the tox option for skipping sdist generation" 2021-06-21 13:56:44 +00:00
Zuul
a5039e7764 Merge "volume: Add more missing 'volume backup *' options" 2021-06-21 13:20:28 +00:00
Zuul
3f3d8829ce Merge "volume: Add 'volume group snapshot *' commands" 2021-06-21 13:09:41 +00:00
Zuul
6abfb01895 Merge "volume: Add 'volume group type *' commands" 2021-06-21 13:09:36 +00:00
Zuul
87369984d1 Merge "volume: Add 'volume group *' commands" 2021-06-18 18:05:39 +00:00
Zuul
779c39f616 Merge "tests: Rename 'FakeType' -> 'FakeVolumeType'" 2021-06-18 18:02:34 +00:00
Zuul
05b7049316 Merge "volume: Add missing 'volume backup *' options" 2021-06-18 16:56:06 +00:00
Zuul
ae5f3009d5 Merge "volume: Add 'volume message *' commands" 2021-06-18 16:52:05 +00:00
Zuul
673fec4f64 Merge "volume: Add 'volume attachment *' commands" 2021-06-18 16:51:59 +00:00
Jeremy Stanley
98979cfc7f Correct the tox option for skipping sdist generation
The tox option to skip source distribution building is skipsdist,
but this seems to be often misspelled skipdist instead, which gets
silently ignored and so does not take effect. Correct it
everywhere, in hopes that new projects will finally stop copying
this mistake around.

See https://tox.readthedocs.io/en/latest/config.html#conf-skipsdist
and https://github.com/tox-dev/tox/issues/1388 for details.

Change-Id: I05c1cc0c2fbf77021cc1e05bc96bee03528c69f0
2021-06-17 17:07:39 +00:00
Zuul
f873428f2c Merge "volume: Allow more versions" 2021-06-17 13:06:18 +00:00
Zuul
89f6d7bf35 Merge "compute: Better help text for 'openstack server set --state'" 2021-06-16 20:55:31 +00:00
Zuul
5b4863ca11 Merge "docs: Update neutronclient comparison doc" 2021-06-16 17:34:43 +00:00
Zuul
a3227bf7f6 Merge "docs: Update glanceclient comparison doc" 2021-06-16 17:34:29 +00:00
Zuul
50dfc967df Merge "docs: Update novaclient comparison doc" 2021-06-16 17:34:20 +00:00
Zuul
82318b4137 Merge "docs: Update cinderclient comparison doc" 2021-06-16 17:34:02 +00:00
Stephen Finucane
13de349411 compute: Better help text for 'openstack server set --state'
Manually changing the server state is a potentially dangerous operation
that should only be done under limited circumstances. It's also an
admin-only operation by default. Highlight both points.

Change-Id: Ifd8aec94937764202131ba8caf6b507caa76d7e9
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Story: 2008549
Task: 41672
2021-06-16 18:09:32 +01:00
Stephen Finucane
280b14abcd compute: Note that '--password' is deployment-specific
Password injection requires either hypervisor-support or an agent
running in the guest that will talk to the metadata service. It can be
disabled for a deployment using the '[api] enable_instance_password'
nova config option. Indicate this, albeit briefly.

Change-Id: Ief94ea07fc7ab6a487af972e8759ca6704d8f085
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-16 16:19:36 +01:00
Stephen Finucane
7f66dfe0e3 volume: Add more missing 'volume backup *' options
Add an additional '--no-property' option to the 'volume backup set'
command, along with a brand spanking new 'volume backup unset' command.

Change-Id: Id7ca925e0ada03e259f0ecaf3e02af11c900641e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-10 11:21:25 +01:00
Stephen Finucane
34de2d3352 volume: Add 'volume group snapshot *' commands
These mirror the 'cinder group-snapshot-*' commands, with arguments
copied across essentially verbatim. The only significant departure is
the replacement of "tenant" terminology with "project".

  volume group snapshot create
  volume group snapshot delete
  volume group snapshot list
  volume group snapshot show

Change-Id: Ia5084749b7c1a5a936fd6d6e8d89b9b80969f68c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-10 11:21:22 +01:00
Akihiro Motoki
02d6fe9be6 L3 conntrack helper: Use singular name consistently
We use singular form for delete command argument in all places.
This commit replaces conntrack-helper-ids with a singular form.
The only visible change is a fix for the help message below.

  openstack network l3 conntrack helper delete
      <router>
      <conntrack-helper-ids>
      [<conntrack-helper-ids> ...]

Change-Id: I50bbd9f6199071bb86cbb2f37c45ebda1de58433
2021-06-08 15:28:06 +09:00
Slawek Kaplonski
fa8c8d26a7 Add support for Neutron's L3 conntrack helper resource
Neutron has got CRUD API for L3 conntrack helper since some time.
This patch adds support for it in the OSC.
OpenStack SDK supports that since [1]

This patch also bumps minimum OpenStack SDK version to
the 0.56.0 as that version introduced support for the
Neutron's L3 conntrack helper.

[1] https://review.opendev.org/c/openstack/openstacksdk/+/782870

Change-Id: I55604182ae50b6ad70c8bc1f7efad8859f191269
2021-06-07 15:34:30 +02:00
Stephen Finucane
83551d2a0c volume: Add 'volume group type *' commands
These mirror the 'cinder group-type-*' commands, with arguments copied
across essentially verbatim. The only significant departure is the
merging of some commands, such as 'group-type-default' and
'group-type-list' into 'group type list', and 'group-type-update' and
'group-type-key' into 'group type set/unset'.

  volume group type create
  volume group type delete
  volume group type list
  volume group type show
  volume group type set
  volume group type unset

Change-Id: Iee6ee2f1f276e6ef6f75a74f8f2980f14c0d5e2f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 18:00:50 +01:00
Stephen Finucane
4c2e8523a9 volume: Add 'volume group *' commands
These mirror the 'cinder group-*' commands, with arguments copied across
essentially verbatim. The only significant departures are the
replacement of "tenant" terminology with "project" and the merging of
the various volume group replication action commands into the parent
volume group (e.g. 'openstack volume group set --enable-replication'
instead of 'cinder group enable-replication')

  volume group create
  volume group delete
  volume group list
  volume group show
  volume group set
  volume group failover

Change-Id: I3b2c0cb92b8a53cc1c0cefa3313b80f59c9e5835
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 17:58:48 +01:00
Stephen Finucane
5faa9ef805 tests: Rename 'FakeType' -> 'FakeVolumeType'
There are more types than just volume types.

Change-Id: I6af66f966a221437ff79fabcb0b81fd38586fe67
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
Stephen Finucane
524af4a23e volume: Add missing 'volume backup *' options
Add a couple of missing options to each command:

  volume backup create
    --no-incremental
    --property
    --availability-zone

  volume backup set
    --property

Most of these are version dependent so we add the relevant version
checks as part of this work. While we're here, we also make the
formatting a little easier on the eye in places.

Change-Id: I328d5c981cb32b2ee9a4b1bd43aa36b22347ff63
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
Stephen Finucane
0eddab36e5 volume: Add 'volume message *' commands
This patch implements the necessary commands to utilize the Messages API
introduced in Cinder API version 3.3. Version 3.5 built upon this by
implementing pagination support for these commands which is present in
this patch as well.

  volume message get
  volume message list
  volume message delete

Change-Id: I64aa0b4a8d4468baa8c63e5e30ee31de68df999d
2021-06-03 15:52:18 +01:00
Stephen Finucane
6dc94e1fb8 volume: Add 'volume attachment *' commands
These mirror the 'cinder attachment-*' commands, with arguments copied
across essentially verbatim. The only significant departure is the
replacement of "tenant" terminology with "project".

  volume attachment create
  volume attachment delete
  volume attachment list
  volume attachment complete
  volume attachment set
  volume attachment show

Full support for filtering is deferred for now since that's a more
complicated change that requires additional commands be added first.
TODOs are included to this effect.

Change-Id: If47c2b56fe65ee2cee07c000d6ae3688d5ef3b42
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
Stephen Finucane
0f28588e48 volume: Allow more versions
Copy the API version checks from the 'openstackclient.compute.client'
module. These will only be necessary until we migrate everything to SDK
but it's very helpful until then.

Change-Id: I2d9c68db5bf891ffa25fd5a7fc9e8953e44b73ab
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
Stephen Finucane
95f914769a docs: Update neutronclient comparison doc
Done manually by looking at the help text for the 'neutron' client
(version 7.1.1) and identifying gaps.

Change-Id: Ib029b2c236f79a0ca6f64834f069db2be4332ea8
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
Stephen Finucane
83e7e4ab2e docs: Update glanceclient comparison doc
Done manually by looking at the help text for the 'glance' client
(version 3.1.1) and identifying gaps.

Change-Id: Ic46bbdef7182e5f707cd5083868886ce60c7eb47
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
Stephen Finucane
3751f1fdb6 docs: Update novaclient comparison doc
Done manually by looking at the help text for the 'nova' client
(version 17.0.0) and identifying gaps.

Change-Id: I23a4947a13d5e576c5aa66902686df60379ffda0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
Stephen Finucane
8dc2a7e9f7 docs: Update cinderclient comparison doc
Done manually by looking at the help text for the 'cinder' client
(version 7.0.0) and identifying gaps.

Change-Id: Ib16c7e9dfa47a93d8b077f0e3e5bbd5bf8984ec3
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-03 15:52:18 +01:00
David Caro
eca1fcd65f
Include hosts in aggregate list --long
This makes it easier to get the total list of aggregates and the hosts
belonging to each of them (specially for scripting purposes).

Change-Id: I94833c15075ae655bc11e7c0fc47c0abad5846fc
Signed-off-by: David Caro <me@dcaro.es>
2021-06-03 09:44:39 +02:00
wu.shiming
1169a114e7 Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: Ibb77fa2afad3f09e95f0dba243d3a096daedd787
2021-06-03 07:00:29 +00:00
Zuul
82fcf1dbe5 Merge "compute: Update 'server resize --revert', '--confirm' help" 2021-06-02 18:11:46 +00:00
Zuul
64295fcb7b Merge "setup.cfg: Replace dashes with underscores" 2021-06-02 17:57:49 +00:00
Stephen Finucane
d087952717 compute: Fix typo
Change-Id: I3795142318b63b7c8f836d78a415a2161f61164d
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-06-02 12:17:35 +01:00
YuehuiLei
fe6a4fa8fc setup.cfg: Replace dashes with underscores
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:

  UserWarning: Usage of dash-separated 'description-file' will not be
  supported in future versions. Please use the underscore name
  'description_file' instead

[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb

Change-Id: I7e43e43bc5a24f49aa7b225502e5d0176fef3783
2021-05-31 00:37:06 +00:00
Slawek Kaplonski
a2375b8787 Make functional Neutron tests running fine on ML2/OVN environments
Devstack recently switched default Neutron's backend from ML2/OVS to
ML2/OVN. As OVN backend has some parity gaps and differences in some
APIs, functional tests job was failing with ML2/OVN as some tests
weren't properly skipped in case of missing some Neutron API extensions.

This patch fixes that by doing some small changes in the functional
tests:
- skip DHCP/L3 agent tests when dhcp/l3 agent scheduler extensions
aren't available,
- skip updating neutron agent as OVN agents don't allows that,
- skip service providers tests when there is no Neutron L3 agent
available,
- skip setting router as distributed as OVN backend don't supports that
router's attribute at all.

Depends-On: https://review.opendev.org/c/openstack/neutron/+/793141
Change-Id: I29a8db202086b0b49fed865409fa8ca244b98439
2021-05-27 10:13:56 +00:00
Zuul
443c311fc2 Merge "Allow to send extra attributes in Neutron related commands" 2021-05-26 19:29:11 +00:00
Zuul
84a606be67 Merge "Set ML2/OVS backend explicitly in the devstack jobs" 2021-05-26 09:41:18 +00:00
Slawek Kaplonski
b26b7f3440 Allow to send extra attributes in Neutron related commands
To deprecate and drop support for neutronclient CLI and use only
OSC we need feature parity between OSC and neutronclient.
Last missing piece here is possibility to send in POST/PUT requests
unknown parameters to the Neutron server.
This patch adds such possibility to the OSC.

Change-Id: Iba09297c2be9fb9fa0be1b3dc65755277b79230e
2021-05-26 09:29:15 +02:00
Stephen Finucane
b1a41904c3 compute: Update 'server resize --revert', '--confirm' help
Update the help strings for these two arguments to indicate their
deprecated nature. This was previously flagged via a deprecation warning
but users would only see that if they were to run the command.

Change-Id: I31a5e27ac8bd2625a6073b54a51bf3e8d6126c8c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-05-20 16:58:57 +01:00
Brian Rosmaita
b019a56187 Add check for cinderclient.v2 support
Block Storage API v2 support is being removed from the cinderclient
during the Xena development cycle [0], so add a check to determine
whether the available cinderclient has v2 support.

[0] https://wiki.openstack.org/wiki/CinderXenaPTGSummary#Removing_the_Block_Storage_API_v2

Change-Id: Id54da1704d94526071f500c36a6e38d6d84aa7b8
2021-05-20 09:20:56 -04:00
Slawek Kaplonski
05807ee0db Set ML2/OVS backend explicitly in the devstack jobs
Neutron team recently switched default backend used in Neutron
by Devstack to OVN. With that backend some tests, like e.g. related
to DHCP or L3 agents aren't working fine. So to have still the same
test coverage as we had before, let's explicitly set ML2/OVS as a
Neutron's backend in those CI jobs.

Change-Id: Idf6466a59c6cf96be2f1d53e696f0564584fa233
2021-05-13 20:43:57 +00:00
Jens Harbott
1f0fcbcd1d Fix the functional-tips tox environment
The egg for the keystoneauth project is actually called keystonauth1.
Seems newer pip actually complains about the difference and fails.

Change-Id: I1602832d33cd467745a03b36c9b1545cd069ba1d
2021-05-11 11:24:59 +00:00
Cyril Roelandt
3918622968 openstack image create: honor protection/visibility flags
The --protected, --unprotected, --public, --shared, --community,
--private flags were ignored when using --volume.

Change-Id: Id5c05ef7d7bb0a04b9d7a9d821e544e1ff7b3d28
Story: 2008882
2021-05-05 01:26:51 +02:00
Dirk Mueller
e82a05864f Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: I0bbffbec8889b8b3067cfe17d258f5cb16624f38
2021-05-03 22:07:39 +02:00
Zuul
6bdf030953 Merge "requirements: Drop os-testr" 2021-04-14 14:10:03 +00:00
Zuul
782e4d0f97 Merge "Add support for token caching" 2021-04-09 23:29:03 +00:00
zhangbailin
168a4e7390 requirements: Drop os-testr
os-testr has been decrepated [1], it's not necessary in a world with stestr.

[1]https://opendev.org/openstack/os-testr/src/branch/master/README.rst

Change-Id: Id2382f2c559ea7f4d4a629d137f07f0ce8841abc
2021-04-08 14:24:52 +08:00
Zuul
684be67df9 Merge "volume: Re-add accidentally deleted test" 2021-04-06 21:09:02 +00:00
Zuul
f449c59378 Merge "hacking: Remove references to encoding" 2021-04-06 21:08:40 +00:00
Zuul
03e58a4886 Merge "Add pre-commit" 2021-04-01 19:05:00 +00:00
Zuul
903bbfe9eb Merge "Add Python3 xena unit tests" 2021-04-01 18:31:35 +00:00
Zuul
f48dc562fe Merge "Update master for stable/wallaby" 2021-04-01 18:31:30 +00:00
Zuul
930ca85dcf Merge "Implements hide image" 2021-04-01 17:58:18 +00:00
Stephen Finucane
f00e14f400 hacking: Remove references to encoding
This is no longer an issue in our new Python 3-only world.

Change-Id: I25c31a0b7f76a253499d9713ba48fd7ba7168450
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-04-01 14:16:22 +00:00
Zuul
8e3dde03f9 Merge "network: Add support for vnic-type vdpa" 2021-03-31 18:40:32 +00:00
Valery Tschopp
383289edd8 Implements hide image
openstack image set [--hidden|--unhidden] IMAGE
openstack image list --hidden

Task: 41734
Story: 2008581
Change-Id: Ie84f10c0f7aa2e7b7f78bfadc70132a10673866e
2021-03-25 08:57:31 +01:00
OpenStack Release Bot
449b30981a Add Python3 xena unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for xena.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: I2415ec61c3580fcd43ee7d8f2a90b698ac156593
2021-03-20 09:16:55 +00:00
OpenStack Release Bot
32151b099c Update master for stable/wallaby
Add file to the reno documentation build to show release notes for
stable/wallaby.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/wallaby.

Sem-Ver: feature
Change-Id: I848e21bf2d2ea1a1a132525070e5f20d7ff8478d
2021-03-20 09:16:50 +00:00
Zuul
23e7495d44 Merge "Hides prefix_length column in subnet show output" 2021-03-20 05:55:41 +00:00
Zuul
b527ec15a9 Merge "network: Make 'network qos rule create --type' option required" 2021-03-20 05:54:26 +00:00
Zuul
7c6b689fdd Merge "Remove unnecessary test" 2021-03-20 02:27:54 +00:00
James Denton
d769ff4393 Hides prefix_length column in subnet show output
When the openstacksdk is patched to properly support defining prefix
lengths when creating subnets, the resulting subnet show output
reveals a prefix_length column with a value of 'none'. This patch
hides the prefix_length column.

Change-Id: I59dfb0b1585ed624f9d82b3557df2ff5ff9d1b3e
Partial-Bug: 1754062
Depends-On: https://review.openstack.org/#/c/550558/
2021-03-19 18:43:35 +00:00
Stephen Finucane
c58f0277a7 network: Make 'network qos rule create --type' option required
When we create a network qos rule we need specify the type so that we
can call the corresponding API. It's not possible to use the command
without the type so mark it as required. This was already being done
but inline.

Change-Id: I559f884bac198d2c69e800620aef66b200473418
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-03-19 18:39:08 +00:00
Stephen Finucane
bf97b5f287 volume: Re-add accidentally deleted test
This is essentially a partial revert of change
I94aa7a9824e44f9585ffb45e5e7637b9588539b4, which removed some deprecated
commands like 'openstack snapshot *' in favour of 'openstack volume
snapshot *'. Unfortunately the latter appeared to have no test coverage
and were relying on tests for the former to validate behavior. Re-add
the tests removed back then.

Change-Id: Ib2cd975221034c8997d272d43cfb18acefc319fe
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-03-19 16:27:13 +00:00
Sean Mooney
6f82165979 network: Add support for vnic-type vdpa
Extend 'port create' to support vinc-type vdpa as introduced by neutron
in [1].

[1] https://review.opendev.org/c/openstack/neutron/+/760047

Change-Id: I635c5269f4e8fc55f234c98e85fced87b39fce81
2021-03-19 15:19:38 +00:00
Brian Haley
e4e9fb594d Add --subnet-pool to subnet list
The neutron API supports filtering subnets by subnet
pool id, but the CLI was missing support for it.

Change-Id: Ic230c2c5cda8255d8f2c422880aeac81670b2df3
2021-03-16 09:35:15 -04:00
Stephen Finucane
87e6828678 Add pre-commit
This is helpful to automate code style checks at runtime. We include
documentation on how to run this as well as a general overview of style
guidelines in OSC.

Change-Id: I2dc5a0f760ce53269ae25677560b2611cc6bfd91
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-03-11 16:20:15 +00:00
Pierre Riteau
46bd6ef91f Update volume create documentation
Change I94aa7a9824e44f9585ffb45e5e7637b9588539b4 removed these options.

Change-Id: I43d84b5532ae6570e1486867c03b8ebec81e38e4
2021-03-09 14:50:26 +01:00
Artem Goncharov
30d5f14a70 Add support for token caching
SDK starts caching token in keyring (when available and configured). A
small change is required in OSC not to reject this state.
Overall this helps avoiding reauthentication upon next openstack call.
If token is not valid anymore automatically reauthentication is done.

Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/735352
Depends-On: https://review.opendev.org/c/openstack/osc-lib/+/765650
Change-Id: I47261a32bd3b106a589974d3de5bf2a6ebd57263
2020-12-05 15:40:24 +01:00
Stephen Finucane
4d3a3bb28f Remove unnecessary test
As noted, we're simply testing the default behavior of Python 3 in this
test. Remove it, now that this is the only version(s) of Python 3 we
have to worry about.

Change-Id: I5f07343df8334457d907086033d5685f59c0bf0e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-11-06 10:16:06 +00:00
761 changed files with 92752 additions and 55301 deletions

View file

@ -1,6 +1,7 @@
[run] [run]
branch = True branch = True
source = openstackclient source = openstackclient
omit = openstackclient/tests/*
[report] [report]
ignore_errors = True ignore_errors = True

13
.git-blame-ignore-revs Normal file
View file

@ -0,0 +1,13 @@
# You can configure git to automatically use this file with the following config:
# git config --global blame.ignoreRevsFile .git-blame-ignore-revs
c5b772db76c071e493a81105c7d8c0def08b2264 # trivial: Prepare for pyupgrade pre-commit hook
ed0314ac76ae58a6621077feb742efd5c14c3a62 # Blacken everything else
ac64fdb93c32972575a4523ccb23d0279ef584f5 # Blacken openstackclient.api
a3778109d0051a25901569e7bafe54915ab25f82 # Blacken openstack.common
53476e1f73d8af172207ac7089fb85fc0221859f # Blacken openstackclient.image
c51e4ef1bc350905a04690eb019d53e68fe3d633 # Blacken openstackclient.object
af6ea07703ed1c12b86995b97a9618bfa70721ee # Blacken openstackclient.identity
1face4f48b07fbc51824980e989687adaf453f0e # Blacken openstackclient.network
1ca77acc9118b433c14e03bf9fd28f2b1639c430 # Blacken openstackclient.volume
4bbf3bd3846cb3d85e243199910de82df25d35e0 # Blacken openstackclient.compute

42
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,42 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: mixed-line-ending
args: ['--fix', 'lf']
exclude: '.*\.(svg)$'
- id: fix-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
args: ['--unsafe']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff-check
args: ['--fix', '--unsafe-fixes']
- id: ruff-format
- repo: https://opendev.org/openstack/hacking
rev: 7.0.0
hooks:
- id: hacking
additional_dependencies: []
exclude: '^(doc|releasenotes)/.*$'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.18.2
hooks:
- id: mypy
additional_dependencies:
- types-requests
# keep this in-sync with '[tool.mypy] exclude' in 'pyproject.toml'
exclude: |
(?x)(
doc/.*
| examples/.*
| hacking/.*
| releasenotes/.*
)

View file

@ -6,6 +6,11 @@
Run unit tests for OpenStackClient with master branch of important libs. Run unit tests for OpenStackClient with master branch of important libs.
Takes advantage of the base tox job's install-siblings feature. Takes advantage of the base tox job's install-siblings feature.
irrelevant-files: &common-irrelevant-files
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
- ^\.pre-commit-config\.yaml$
required-projects: required-projects:
- openstack/cliff - openstack/cliff
- openstack/keystoneauth - openstack/keystoneauth
@ -18,14 +23,14 @@
zuul_work_dir: src/opendev.org/openstack/python-openstackclient zuul_work_dir: src/opendev.org/openstack/python-openstackclient
- job: - job:
name: osc-tox-py36-tips name: osc-tox-py310-tips
parent: openstack-tox-py36 parent: openstack-tox-py310
description: | description: |
Run unit tests for OpenStackClient with master branch of important libs. Run unit tests for OpenStackClient with master branch of important libs.
Takes advantage of the base tox job's install-siblings feature. Takes advantage of the base tox job's install-siblings feature.
# The job only tests the latest and shouldn't be run on the stable branches # The job only tests the latest and shouldn't be run on the stable branches
branches: ^(?!stable) branches: ^master$
required-projects: required-projects:
- openstack/cliff - openstack/cliff
- openstack/keystoneauth - openstack/keystoneauth
@ -38,11 +43,31 @@
zuul_work_dir: src/opendev.org/openstack/python-openstackclient zuul_work_dir: src/opendev.org/openstack/python-openstackclient
- job: - job:
name: osc-functional-devstack-base name: osc-tox-py313-tips
parent: openstack-tox-py313
description: |
Run unit tests for OpenStackClient with master branch of important libs.
Takes advantage of the base tox job's install-siblings feature.
# The job only tests the latest and shouldn't be run on the stable branches
branches: ^master$
required-projects:
- openstack/cliff
- openstack/keystoneauth
- openstack/openstacksdk
- openstack/osc-lib
- openstack/python-openstackclient
vars:
# Set work dir to openstackclient so that if it's triggered by one of the
# other repos the tests will run in the same place
zuul_work_dir: src/opendev.org/openstack/python-openstackclient
- job:
name: osc-functional-devstack
parent: devstack-tox-functional parent: devstack-tox-functional
description: | description: |
Base job for devstack-based functional tests Run functional tests for OpenStackClient.
timeout: 9000 timeout: 7800
irrelevant-files: irrelevant-files:
- ^.*\.rst$ - ^.*\.rst$
- ^doc/.*$ - ^doc/.*$
@ -54,72 +79,51 @@
LIBS_FROM_GIT: python-openstackclient LIBS_FROM_GIT: python-openstackclient
# NOTE(dtroyer): Functional tests need a bit more volume headroom # NOTE(dtroyer): Functional tests need a bit more volume headroom
VOLUME_BACKING_FILE_SIZE: 20G VOLUME_BACKING_FILE_SIZE: 20G
devstack_local_conf: Q_AGENT: openvswitch
post-config: Q_ML2_TENANT_NETWORK_TYPE: vxlan
$CINDER_CONF: Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch
DEFAULT:
# NOTE(dtroyer): OSC needs to support Volume v1 for a while yet so re-enable
enable_v1_api: true
devstack_services:
ceilometer-acentral: false
ceilometer-acompute: false
ceilometer-alarm-evaluator: false
ceilometer-alarm-notifier: false
ceilometer-anotification: false
ceilometer-api: false
ceilometer-collector: false
s-account: true
s-container: true
s-object: true
s-proxy: true
osc_environment:
PYTHONUNBUFFERED: 'true'
OS_CLOUD: devstack-admin
zuul_work_dir: src/opendev.org/openstack/python-openstackclient
# The Neutron bits are here rather than in osc-functional-devstack-base to
# simplify removing Neutron in the osc-functional-devstack-n-net job.
- job:
name: osc-functional-devstack
parent: osc-functional-devstack-base
timeout: 7800
vars:
devstack_plugins: devstack_plugins:
# NOTE(amotoki): Some neutron features are enabled by devstack plugin # NOTE(amotoki): Some neutron features are enabled by devstack plugin
neutron: https://opendev.org/openstack/neutron neutron: https://opendev.org/openstack/neutron
devstack_services: devstack_services:
s-account: true
s-container: true
s-object: true
s-proxy: true
# Disable OVN services
br-ex-tcpdump: false
br-int-flows: false
ovn-controller: false
ovn-northd: false
ovs-vswitchd: false
ovsdb-server: false
q-ovn-metadata-agent: false
# Neutron services
q-agt: true
q-dhcp: true
q-l3: true
q-meta: true
neutron-network-segment-range: true neutron-network-segment-range: true
neutron-segments: true neutron-segments: true
q-metering: true q-metering: true
q-qos: true q-qos: true
neutron-tag-ports-during-bulk-creation: true neutron-tag-ports-during-bulk-creation: true
neutron-conntrack-helper: true
neutron-ndp-proxy: true
q-trunk: true
osc_environment:
PYTHONUNBUFFERED: 'true'
OS_CLOUD: devstack-admin
tox_envlist: functional tox_envlist: functional
zuul_work_dir: src/opendev.org/openstack/python-openstackclient
- job:
name: osc-functional-devstack-n-net
parent: osc-functional-devstack-base
timeout: 7800
vars:
devstack_localrc:
FLAT_INTERFACE: br_flat
PUBLIC_INTERFACE: br_pub
devstack_services:
n-cell: true
n-net: true
neutron: false
neutron-segments: false
q-agt: false
q-dhcp: false
q-l3: false
q-meta: false
q-metering: false
q-qos: false
q-svc: false
tox_envlist: functional
- job: - job:
name: osc-functional-devstack-tips name: osc-functional-devstack-tips
parent: osc-functional-devstack parent: osc-functional-devstack
description: |
Run functional tests for OpenStackClient with master branch of important libs.
Takes advantage of the base tox job's install-siblings feature.
timeout: 7800 timeout: 7800
required-projects: required-projects:
- openstack/cliff - openstack/cliff
@ -130,120 +134,54 @@
vars: vars:
devstack_localrc: devstack_localrc:
LIBS_FROM_GIT: python-openstackclient,openstacksdk,osc-lib,cliff LIBS_FROM_GIT: python-openstackclient,openstacksdk,osc-lib,cliff
# This is insufficient, but leaving it here as a reminder of what may
# someday be all we need to make this work
# disable_python3_package swift
DISABLED_PYTHON3_PACKAGES: swift
devstack_services:
# Swift is not ready for python3 yet: At a minimum keystonemiddleware needs
# to be installed in the py2 env, there are probably other things too...
s-account: false
s-container: false
s-object: false
s-proxy: false
# As swift is not available for this job, c-bak service won't be functional.
# The backup related tests can be handled by other jobs having swift enabled.
# The backup service along with swift services can be enabled once swift is
# compatible with py3
c-bak: false
tox_envlist: functional tox_envlist: functional
tox_install_siblings: true tox_install_siblings: true
- secret:
name: osc-dockerhub
data:
username: osclientzuul
password: !encrypted/pkcs1-oaep
- LbIZjJiVstRVXMpoLQ3+/JcNB6lKVUWJXXo5+Outf+PKAaO7mNnv8XLiFMKnJ6ftopLyu
hWbX9rA+NddvplLQkf1xxkh7QBBU8PToLr58quI2SENUclt4tpjxbZfZu451kFSNJvNvR
E58cHHpfJZpyRnS2htXmN/Qy24gbV2w7CQxSZD2YhlcrerD8uQ8rWEnlY1wcJEaEGomtS
ZTGxsdK2TsZC2cd4b7TG7+xbl2i+hjADzwSQAgUzlLlwuG71667+IWk4SOZ7OycJTv9NN
ZTak8+CGfiMKdmsxZ1Z8uD7DC+RIklDjMWyly6zuhWzfhOmsmU0CesR50moodRUvbK79p
NZM8u0hBex5cl2EpUEwJL/FSPJXUhDMPoMoTZT/SAuXf25R9eZ9JGrKsIAlmVhpl8ifoE
8TpPyvIHGS3YelTQjhqOX0wGb9T4ZauQCcI5Ajzy9NuCTyD9xxme9OX1zz7gMACRnVHvz
q7U7Ue90MnmGH6E2SgKjIZhyzy9Efwb7JUvH1Zb3hlrjCjEhwi9MV5FnABTEeXyYwE10s
3o/KZg2zvdWkVG6x0dEkjpoQaNuaB7T2Na7Sm421n/z3LCzhiQGuTUjENnL6cMEtuA6Pp
BfI5+Qlg7HMwkBXNB73EPfWHzbCR3VNrzGYTy9FvhGud0/cXsuBXgps4WH63ic=
- job: - job:
name: osc-build-image name: osc-build-image
parent: opendev-build-docker-image parent: opendev-build-docker-image
description: Build Docker images. description: Build Docker images.
allowed-projects: openstack/python-openstackclient allowed-projects: openstack/python-openstackclient
requires: requires:
- python-builder-3.7-container-image - python-builder-3.11-bookworm-container-image
- python-base-3.7-container-image - python-base-3.11-bookworm-container-image
provides: osc-container-image provides: osc-container-image
vars: &osc_image_vars vars:
docker_images: docker_images:
- context: . - context: .
repository: osclient/python-openstackclient tags: []
- job:
name: osc-upload-image
parent: opendev-upload-docker-image
description: Build Docker images and upload to Docker Hub.
allowed-projects: openstack/python-openstackclient
requires:
- python-builder-3.7-container-image
- python-base-3.7-container-image
provides: osc-container-image
secrets:
- name: docker_credentials
secret: osc-dockerhub
pass-to-parent: true
vars: *osc_image_vars
- job:
name: osc-promote-image
parent: opendev-promote-docker-image
allowed-projects: openstack/python-openstackclient
description: Promote previously uploaded Docker images.
secrets:
- name: docker_credentials
secret: osc-dockerhub
pass-to-parent: true
nodeset:
nodes: []
vars: *osc_image_vars
- project-template: - project-template:
name: osc-tox-unit-tips name: osc-tox-unit-tips
check: check:
jobs: jobs:
- osc-tox-py36-tips - osc-tox-py310-tips
- osc-tox-py313-tips
gate: gate:
jobs: jobs:
- osc-tox-py36-tips - osc-tox-py310-tips
- osc-tox-py313-tips
- project: - project:
templates: templates:
- openstackclient-plugin-jobs - openstackclient-plugin-jobs
- osc-tox-unit-tips - osc-tox-unit-tips
- openstack-cover-jobs - openstack-cover-jobs
- openstack-lower-constraints-jobs - openstack-python3-jobs
- openstack-python3-wallaby-jobs
- publish-openstack-docs-pti - publish-openstack-docs-pti
- check-requirements - check-requirements
- release-notes-jobs-python3 - release-notes-jobs-python3
check: check:
jobs: jobs:
- osc-build-image - openstackclient-check-plugins:
voting: true
- osc-build-image:
voting: false
- osc-functional-devstack - osc-functional-devstack
# - osc-functional-devstack-n-net:
# voting: false
# # The job testing nova-network no longer works before Pike, and
# # should be disabled until the New Way of testing against old clouds
# # is ready and backported
# branches: ^(?!stable/(newton|ocata)).*$
- osc-functional-devstack-tips: - osc-functional-devstack-tips:
# The functional-tips job only tests the latest and shouldn't be run # The functional-tips job only tests the latest and shouldn't be run
# on the stable branches # on the stable branches
branches: ^(?!stable) branches: ^master$
gate: gate:
jobs: jobs:
- osc-upload-image
- osc-functional-devstack - osc-functional-devstack
promote:
jobs:
- osc-promote-image

View file

@ -1,16 +1,27 @@
If you would like to contribute to the development of OpenStack, The source repository for this project can be found at:
you must follow the steps documented at:
https://docs.openstack.org/infra/manual/developers.html https://opendev.org/openstack/python-openstackclient
Once those steps have been completed, changes to OpenStack Pull requests submitted through GitHub are not monitored.
should be submitted for review via the Gerrit tool, following
the workflow documented at:
https://docs.openstack.org/infra/manual/developers.html#development-workflow To start contributing to OpenStack, follow the steps in the contribution guide
to set up and use Gerrit:
Pull requests submitted through GitHub will be ignored. https://docs.openstack.org/contributors/code-and-documentation/quick-start.html
Bugs should be filed on Storyboard, not GitHub or Launchpad: Bugs should be filed on Launchpad:
https://storyboard.openstack.org/#!/project/openstack/python-openstackclient https://bugs.launchpad.net/python-openstackclient
Developers should also join the discussion on the mailing list, at:
https://lists.openstack.org/mailman3/lists/openstack-discuss.lists.openstack.org/
or join the IRC channel on
#openstack-sdks on OFTC (irc.oftc.net)
For more specific information about contributing to this repository, see the
openstacksdk contributor guide:
https://docs.openstack.org/openstacksdk/latest/contributor/index.html

View file

@ -13,12 +13,19 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
FROM docker.io/opendevorg/python-builder:3.7 as builder FROM docker.io/opendevorg/python-builder:3.12-bookworm AS builder
COPY . /tmp/src COPY . /tmp/src
RUN assemble RUN assemble
FROM docker.io/opendevorg/python-base:3.7 FROM docker.io/opendevorg/python-base:3.12-bookworm
LABEL org.opencontainers.image.title="python-openstackclient"
LABEL org.opencontainers.image.description="Client for OpenStack services."
LABEL org.opencontainers.image.licenses="Apache License 2.0"
LABEL org.opencontainers.image.url="https://www.openstack.org/"
LABEL org.opencontainers.image.documentation="https://docs.openstack.org/python-openstackclient/latest/"
LABEL org.opencontainers.image.source="https://opendev.org/openstack/python-openstackclient"
COPY --from=builder /output/ /output COPY --from=builder /output/ /output
RUN /output/install-from-bindep RUN /output/install-from-bindep

View file

@ -32,7 +32,7 @@ use the alternate 4 space indent. With the first argument on the succeeding
line all arguments will then be vertically aligned. Use the same convention line all arguments will then be vertically aligned. Use the same convention
used with other data structure literals and terminate the method call with used with other data structure literals and terminate the method call with
the last argument line ending with a comma and the closing paren on its own the last argument line ending with a comma and the closing paren on its own
line indented to the starting line level. line indented to the starting line level. ::
unnecessarily_long_function_name( unnecessarily_long_function_name(
'string one', 'string one',
@ -40,49 +40,3 @@ line indented to the starting line level.
kwarg1=constants.ACTIVE, kwarg1=constants.ACTIVE,
kwarg2=['a', 'b', 'c'], kwarg2=['a', 'b', 'c'],
) )
Text encoding
-------------
Note: this section clearly has not been implemented in this project yet, it is
the intention to do so.
All text within python code should be of type 'unicode'.
WRONG:
>>> s = 'foo'
>>> s
'foo'
>>> type(s)
<type 'str'>
RIGHT:
>>> u = u'foo'
>>> u
u'foo'
>>> type(u)
<type 'unicode'>
Transitions between internal unicode and external strings should always
be immediately and explicitly encoded or decoded.
All external text that is not explicitly encoded (database storage,
commandline arguments, etc.) should be presumed to be encoded as utf-8.
WRONG:
infile = open('testfile', 'r')
mystring = infile.readline()
myreturnstring = do_some_magic_with(mystring)
outfile.write(myreturnstring)
RIGHT:
infile = open('testfile', 'r')
mystring = infile.readline()
mytext = mystring.decode('utf-8')
returntext = do_some_magic_with(mytext)
returnstring = returntext.encode('utf-8')
outfile.write(returnstring)

View file

@ -1,12 +1,3 @@
========================
Team and repository tags
========================
.. image:: https://governance.openstack.org/tc/badges/python-openstackclient.svg
:target: https://governance.openstack.org/tc/reference/tags/index.html
.. Change things from this point on
=============== ===============
OpenStackClient OpenStackClient
=============== ===============
@ -15,96 +6,158 @@ OpenStackClient
:target: https://pypi.org/project/python-openstackclient/ :target: https://pypi.org/project/python-openstackclient/
:alt: Latest Version :alt: Latest Version
OpenStackClient (aka OSC) is a command-line client for OpenStack that brings OpenStackClient (OSC) is a command-line client for OpenStack that brings
the command set for Compute, Identity, Image, Network, Object Store and Block the command set for Compute, Identity, Image, Network, Object Store and Block
Storage APIs together in a single shell with a uniform command structure. Storage APIs together in a single shell with a uniform command structure.
Support for additional service APIs is provided via plugins.
The primary goal is to provide a unified shell command structure and a common The primary goal is to provide a unified shell command structure and a common
language to describe operations in OpenStack. language to describe operations in OpenStack.
* `PyPi`_ - package installation
* `Online Documentation`_
* `Storyboard project`_ - bugs and feature requests
* `Blueprints`_ - feature specifications (historical only)
* `Source`_
* `Developer`_ - getting started as a developer
* `Contributing`_ - contributing code
* `Testing`_ - testing code
* IRC: #openstack-sdks on Freenode (irc.freenode.net)
* License: Apache 2.0
.. _PyPi: https://pypi.org/project/python-openstackclient
.. _Online Documentation: https://docs.openstack.org/python-openstackclient/latest/
.. _Blueprints: https://blueprints.launchpad.net/python-openstackclient
.. _`Storyboard project`: https://storyboard.openstack.org/#!/project/openstack/python-openstackclient
.. _Source: https://opendev.org/openstack/python-openstackclient
.. _Developer: https://docs.openstack.org/project-team-guide/project-setup/python.html
.. _Contributing: https://docs.openstack.org/infra/manual/developers.html
.. _Testing: https://docs.openstack.org/python-openstackclient/latest/contributor/developing.html#testing
.. _Release Notes: https://docs.openstack.org/releasenotes/python-openstackclient
Getting Started Getting Started
=============== ===============
OpenStack Client can be installed from PyPI using pip:: OpenStack Client can be installed from PyPI using pip:
pip install python-openstackclient .. code-block:: shell
There are a few variants on getting help. A list of global options and supported python3 -m pip install python-openstackclient
commands is shown with ``--help``::
openstack --help You can use ``--help`` or the ``help`` command to get a list of global options
and supported commands:
There is also a ``help`` command that can be used to get help text for a specific .. code-block:: shell
command::
openstack --help
openstack help openstack help
You can also get help for a specific command:
.. code-block:: shell
openstack server create --help
openstack help server create openstack help server create
If you want to make changes to the OpenStackClient for testing and contribution, You can add support for additional services by installing their clients. For
make any changes and then run:: example, to add support for the DNS service (designate):
python setup.py develop .. code-block:: shell
or:: python3 -m pip install python3-designateclient
pip install -e . A ``Dockerfile`` is provided for your convenience in the repository. You can
use this to build your own container images:
.. code-block:: shell
git clone https://opendev.org/openstack/python-openstackclient
cd python-openstackclient
podman build . -t example.com/myuser/openstackclient
For more information the available options and commands, refer to the `Users
Guide`__.
.. __: https://docs.openstack.org/python-openstackclient/latest/cli/index.html
Configuration Configuration
============= =============
The CLI is configured via environment variables and command-line OpenStack Client must be configured with authentication information in order to
options as listed in https://docs.openstack.org/python-openstackclient/latest/cli/authentication.html. communicate with a given OpenStack cloud. This configuration can be achieved
via a ``clouds.yaml`` file, a set of environment variables (often shared via an
``openrc`` file), a set of command-line options, or a combination of all three.
Your cloud provider or deployment tooling will typically provide either a
``clouds.yaml`` file or ``openrc`` file for you. If using a ``clouds.yaml``
file, OpenStack Client expects to find it in one of the following locations:
Authentication using username/password is most commonly used: * If set, the path indicated by the ``OS_CLIENT_CONFIG_FILE`` environment
variable
* ``.`` (the current directory)
* ``$HOME/.config/openstack``
* ``/etc/openstack``
- For a local user, your configuration will look like the one below:: The options you should set will depend on the configuration of your cloud and
the authentication mechanism(s) supported. For example, consider a cloud that
supports username/password authentication. Configuration for this cloud using a
``clouds.yaml`` file would look like so:
.. code-block:: yaml
clouds:
my-cloud:
auth:
auth_url: '<url-to-openstack-identity>'
project_name: '<project-name>'
project_domain_name: '<project-domain-name>'
username: '<username>'
user_domain_name: '<user-domain-name>'
password: '<password>' # (optional)
region_name: '<region>'
The corresponding environment variables would look very similar:
.. code-block:: shell
export OS_AUTH_URL=<url-to-openstack-identity> export OS_AUTH_URL=<url-to-openstack-identity>
export OS_IDENTITY_API_VERSION=3 export OS_REGION_NAME=<region>
export OS_PROJECT_NAME=<project-name> export OS_PROJECT_NAME=<project-name>
export OS_PROJECT_DOMAIN_NAME=<project-domain-name> export OS_PROJECT_DOMAIN_NAME=<project-domain-name>
export OS_USERNAME=<username> export OS_USERNAME=<username>
export OS_USER_DOMAIN_NAME=<user-domain-name> export OS_USER_DOMAIN_NAME=<user-domain-name>
export OS_PASSWORD=<password> # (optional) export OS_PASSWORD=<password> # (optional)
The corresponding command-line options look very similar:: Likewise, the corresponding command-line options would look very similar:
--os-auth-url <url> ::
--os-identity-api-version 3
openstack
--os-auth-url <url-to-openstack-identity>
--os-region <region>
--os-project-name <project-name> --os-project-name <project-name>
--os-project-domain-name <project-domain-name> --os-project-domain-name <project-domain-name>
--os-username <username> --os-username <username>
--os-user-domain-name <user-domain-name> --os-user-domain-name <user-domain-name>
[--os-password <password>] [--os-password <password>]
- For a federated user, your configuration will look the so:: .. note::
If a password is not provided above (in plaintext), you will be
interactively prompted to provide one securely.
Some clouds use federated authentication. If this is the case, your
configuration will be slightly more involved. For example, to configure
username/password authentication for a federated user using a ``clouds.yaml``
file:
.. code-block:: yaml
clouds:
my-cloud:
auth:
auth_url: '<url-to-openstack-identity>'
project_name: '<project-name>'
project_domain_name: '<project-domain-name>'
username: '<username-in-idp>'
user_domain_name: '<user-domain-name>'
password: '<password-in-idp>'
identity_provider: '<the-desired-idp-in-keystone>'
client_id: '<the-client-id-configured-in-the-idp>'
client_secret: '<the-client-secret-configured-in-the-idp>'
openid_scope: '<the-scopes-of-desired-attributes-to-claim-from-idp>'
protocol: '<the-protocol-used-in-the-apache2-oidc-proxy>'
access_token_type: '<the-access-token-type-used-by-your-idp>'
discovery_endpoint: '<the-well-known-endpoint-of-the-idp>'
auth_type: 'v3oidcpassword'
region_name: '<region>'
The corresponding environment variables would look very similar:
.. code-block:: shell
export OS_PROJECT_NAME=<project-name> export OS_PROJECT_NAME=<project-name>
export OS_PROJECT_DOMAIN_NAME=<project-domain-name> export OS_PROJECT_DOMAIN_NAME=<project-domain-name>
export OS_AUTH_URL=<url-to-openstack-identity> export OS_AUTH_URL=<url-to-openstack-identity>
export OS_IDENTITY_API_VERSION=3 export OS_IDENTITY_API_VERSION=3
export OS_AUTH_PLUGIN=openid
export OS_AUTH_TYPE=v3oidcpassword export OS_AUTH_TYPE=v3oidcpassword
export OS_USERNAME=<username-in-idp> export OS_USERNAME=<username-in-idp>
export OS_PASSWORD=<password-in-idp> export OS_PASSWORD=<password-in-idp>
@ -116,7 +169,9 @@ Authentication using username/password is most commonly used:
export OS_ACCESS_TOKEN_TYPE=<the-access-token-type-used-by-your-idp> export OS_ACCESS_TOKEN_TYPE=<the-access-token-type-used-by-your-idp>
export OS_DISCOVERY_ENDPOINT=<the-well-known-endpoint-of-the-idp> export OS_DISCOVERY_ENDPOINT=<the-well-known-endpoint-of-the-idp>
The corresponding command-line options look very similar:: Likewise, the corresponding command-line options would look very similar:
.. code-block:: shell
--os-project-name <project-name> --os-project-name <project-name>
--os-project-domain-name <project-domain-name> --os-project-domain-name <project-domain-name>
@ -134,5 +189,41 @@ Authentication using username/password is most commonly used:
--os-access-token-type <the-access-token-type-used-by-your-idp> --os-access-token-type <the-access-token-type-used-by-your-idp>
--os-discovery-endpoint <the-well-known-endpoint-of-the-idp> --os-discovery-endpoint <the-well-known-endpoint-of-the-idp>
If a password is not provided above (in plaintext), you will be interactively For more information on configuring authentication, including an overview of
prompted to provide one securely. the many authentication mechanisms supported, refer to the `Authentication
guide`__. For more information on configuration in general, refer to the
`Configuration guide`__.
.. __: https://docs.openstack.org/python-openstackclient/latest/cli/authentication.html.
.. __: https://docs.openstack.org/python-openstackclient/latest/configuration/index.html
Contributing
============
You can clone the repository from opendev.org::
git clone https://opendev.org/openstack/python-openstackclient
cd python-openstackclient
OpenStack Client uses the same contributor process as other OpenStack projects.
For information on this process, including help on setting up you Gerrit
account and an overview of the CI process, refer to the `OpenStack Contributors
Guide`__.
For more information on contributing to OpenStack Client itself, including
guidance on how to design new commands and how to report bugs, refer to the
`Contributors Guide`__.
.. __: https://docs.openstack.org/python-openstackclient/latest/contributor/index.html
.. __: https://docs.opendev.org/opendev/infra-manual/latest/developers.html
Links
-----
* `Issue Tracker <https://bugs.launchpad.net/python-openstackclient>`_
* `Code Review <https://review.opendev.org/#/q/status:open+project:openstack/openstacksdk,n,z>`_
* `Documentation <https://docs.openstack.org/python-openstackclient/latest/>`_
* `PyPi <https://pypi.org/project/python-openstackclient>`_
* `Mailing list <https://lists.openstack.org/mailman3/lists/openstack-discuss.lists.openstack.org/>`_
* `Release Notes <https://docs.openstack.org/releasenotes/python-openstackclient>`_
* `IRC (#openstack-sdks on OFTC (irc.oftc.net)) <irc://irc.oftc.net/openstack-sdks>`_

View file

@ -8,3 +8,4 @@ libffi-dev [compile test platform:dpkg]
libssl-dev [compile test platform:dpkg] libssl-dev [compile test platform:dpkg]
python3-dev [compile test platform:dpkg] python3-dev [compile test platform:dpkg]
python3-devel [compile test platform:rpm] python3-devel [compile test platform:rpm]
libpcre3-dev [test platform:dpkg]

View file

@ -1,6 +1,3 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
openstackdocstheme>=2.2.1 # Apache-2.0 openstackdocstheme>=2.2.1 # Apache-2.0
reno>=3.1.0 # Apache-2.0 reno>=3.1.0 # Apache-2.0
sphinx>=2.0.0,!=2.1.0 # BSD sphinx>=2.0.0,!=2.1.0 # BSD
@ -14,18 +11,16 @@ aodhclient>=0.9.0 # Apache-2.0
gnocchiclient>=3.3.1 # Apache-2.0 gnocchiclient>=3.3.1 # Apache-2.0
osc-placement>=1.7.0 # Apache-2.0 osc-placement>=1.7.0 # Apache-2.0
python-barbicanclient>=4.5.2 # Apache-2.0 python-barbicanclient>=4.5.2 # Apache-2.0
python-cyborgclient>=1.2.1 # Apache-2.0
python-designateclient>=2.7.0 # Apache-2.0 python-designateclient>=2.7.0 # Apache-2.0
python-heatclient>=1.10.0 # Apache-2.0 python-heatclient>=1.10.0 # Apache-2.0
python-ironicclient>=2.3.0 # Apache-2.0 python-ironicclient>=2.3.0 # Apache-2.0
python-ironic-inspector-client>=1.5.0 # Apache-2.0 python-ironic-inspector-client>=1.5.0 # Apache-2.0
python-magnumclient>=2.3.0 # Apache-2.0
python-manilaclient>=2.0.0 # Apache-2.0 python-manilaclient>=2.0.0 # Apache-2.0
python-mistralclient!=3.2.0,>=3.1.0 # Apache-2.0 python-mistralclient!=3.2.0,>=3.1.0 # Apache-2.0
python-muranoclient>=0.8.2 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0 python-neutronclient>=6.7.0 # Apache-2.0
python-octaviaclient>=1.11.0 # Apache-2.0 python-octaviaclient>=1.11.0 # Apache-2.0
python-rsdclient>=1.0.1 # Apache-2.0
python-saharaclient>=1.4.0 # Apache-2.0
python-senlinclient>=1.1.0 # Apache-2.0
python-troveclient>=3.1.0 # Apache-2.0 python-troveclient>=3.1.0 # Apache-2.0
python-watcherclient>=2.5.0 # Apache-2.0 python-watcherclient>=2.5.0 # Apache-2.0
python-zaqarclient>=1.0.0 # Apache-2.0 python-zaqarclient>=1.0.0 # Apache-2.0

View file

@ -3,7 +3,7 @@ image
===== =====
.. NOTE(efried): This page is hidden from the main TOC; it's here so links in .. NOTE(efried): This page is hidden from the main TOC; it's here so links in
the wild redirect somewhere sane, because previously identity v2 and v3 were the wild redirect somewhere sane, because previously image v2 and v3 were
combined in a single page. combined in a single page.
.. toctree:: .. toctree::

View file

@ -36,7 +36,7 @@ There are at least three authentication types that are always available:
URL for the Identity service is also required. [Required: ``--os-auth-url``, URL for the Identity service is also required. [Required: ``--os-auth-url``,
``--os-project-name``, ``--os-username``; Optional: ``--os-password``] ``--os-project-name``, ``--os-username``; Optional: ``--os-password``]
* **Token**: This is slightly different from the usual token authentication * **Token**: This is slightly different from the usual token authentication
(described below as token/endpoint) in that a token and an authentication in that a token and an authentication
URL are supplied and the plugin retrieves a new token. URL are supplied and the plugin retrieves a new token.
[Required: ``--os-auth-url``, ``--os-token``] [Required: ``--os-auth-url``, ``--os-token``]
* **Others**: Other authentication plugins such as SAML, Kerberos, and OAuth1.0 * **Others**: Other authentication plugins such as SAML, Kerberos, and OAuth1.0
@ -145,5 +145,233 @@ credentials.
This is useful in a Federated environment where one credential give access This is useful in a Federated environment where one credential give access
to many applications/services that the Federation supports. To check how to to many applications/services that the Federation supports. To check how to
configure the OpenStackClient to allow Federated users to log in, please check configure the OpenStackClient to allow Federated users to log in, please check
the the :ref:`Authentication using federation. <manpage>`
:ref:`Authentication using federation. <manpage>`
Examples
--------
.. todo: It would be nice to add more examples here, particularly for
complicated things like oauth2
``v3password``
~~~~~~~~~~~~~~
Using ``clouds.yaml``:
.. code-block:: yaml
clouds:
demo:
auth:
auth_url: http://openstack.dev/identity
project_name: demo
project_domain_name: default
user_domain_name: default
username: demo
password: password
auth_type: v3password
or, using command line options:
.. code-block:: bash
$ openstack \
--os-auth-url "http://openstack.dev/identity" \
--os-project-name demo \
--os-project-domain-name default \
--os-user-domain-name default \
--os-auth-type=v3password \
--os-username demo \
--os-password password \
server list
or, using environment variables:
.. code-block:: bash
$ export OS_AUTH_URL="http://openstack.dev/identity"
$ export OS_PROJECT_NAME=demo
$ export OS_PROJECT_DOMAIN_NAME=default
$ export OS_AUTH_TYPE=v3password
$ export OS_USERNAME=demo
$ export OS_PASSWORD=password
$ openstack server list
.. note::
If a password is not provided, you will be prompted for one.
``v3applicationcredential``
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using ``clouds.yaml``:
.. code-block:: yaml
clouds:
demo:
auth:
auth_url: http://openstack.dev/identity
application_credential_id: ${APP_CRED_ID}
application_credential_secret: ${APP_CRED_SECRET}
auth_type: v3applicationcredential
or, using command line options:
.. code-block:: bash
$ openstack \
--os-auth-url "http://openstack.dev/identity" \
--os-auth-type=v3applicationcredential \
--os-application-credential-id=${APP_CRED_ID} \
--os-application-credential-secret=${APP_CRED_SECRET}
server list
or, using environment variables:
.. code-block:: bash
$ export OS_AUTH_URL="http://openstack.dev/identity"
$ export OS_AUTH_TYPE=v3applicationcredential
$ export OS_APPLICATION_CREDENTIAL_ID=${APP_CRED_ID}
$ export OS_APPLICATION_CREDENTIAL_SECRET=${APP_CRED_SECRET}
$ openstack server list
.. note::
You can generate application credentials using the :program:`openstack
application credential create` command:
.. code-block:: bash
$ readarray -t lines <<< $(openstack application credential create test -f value -c id -c secret)
$ APP_CRED_ID=${lines[0]}
$ APP_CRED_SECRET=${lines[1]}
``v3token``
~~~~~~~~~~~
Using ``clouds.yaml``:
.. code-block:: yaml
clouds:
demo:
auth:
auth_url: http://openstack.dev/identity
project_name: demo
project_domain_name: default
token: ${TOKEN}
auth_type: v3token
or, using command line options:
.. code-block:: bash
$ openstack \
--os-auth-url "http://openstack.dev/identity" \
--os-project-name demo \
--os-project-domain-name default \
--os-auth-type=v3token \
--os-token ${TOKEN} \
server list
or, using environment variables:
.. code-block:: bash
$ export OS_AUTH_URL="http://openstack.dev/identity"
$ export OS_PROJECT_NAME=demo
$ export OS_PROJECT_DOMAIN_NAME=default
$ export OS_AUTH_TYPE=v3token
$ export OS_TOKEN=${TOKEN}
$ openstack server list
.. note::
You can generate tokens using the :program:`openstack token issue` command:
.. code-block:: bash
$ TOKEN=$(openstack token issue -f value -c id)
.. note::
The above examples assume you require a project-scoped token. You can omit
the project-related configuration if your user has a default project ID set.
Conversely, if requesting domain-scoped or system-scoped, you should update
these examples accordingly. If the user does not have a default project
configured and no scoping information is provided, the resulting token will
be unscoped.
``v3totp``
~~~~~~~~~~
.. note::
The TOTP mechanism is poorly suited to command line-driven API
interactions. Where the TOTP mechanism is configured for a cloud, it is
expected that it is to be used for initial authentication and to create a
token or application credential, which can then be used for future
interactions.
.. note::
The TOTP mechanism is often combined with other mechanisms to enable
Multi-Factor Authentication, or MFA. The authentication type
``v3multifactor`` is used in this case, while the ``v3totp`` authentication
type is specified alongside the other mechanisms in ``auth_methods``.
Using ``clouds.yaml``:
.. code-block:: yaml
clouds:
demo:
auth:
auth_url: http://openstack.dev/identity
project_name: demo
project_domain_name: default
user_domain_name: default
username: demo
passcode: ${PASSCODE}
auth_type: v3totp
or, using command line options:
.. code-block:: bash
$ openstack \
--os-auth-url "http://openstack.dev/identity" \
--os-project-name demo \
--os-project-domain-name default \
--os-user-domain-name default \
--os-auth-type=v3totp \
--os-username demo \
--os-passcode ${PASSCODE} \
server list
or, using environment variables:
.. code-block:: bash
$ export OS_AUTH_URL="http://openstack.dev/identity"
$ export OS_PROJECT_NAME=demo
$ export OS_PROJECT_DOMAIN_NAME=default
$ export OS_AUTH_TYPE=v3totp
$ export OS_USERNAME=demo
$ export OS_PASSCODE=${PASSCODE}
$ openstack server list
.. note::
The passcode will be generated by an authenticator application such FreeOTP
or Google Authenticator. Refer to your cloud provider's documentation for
information on how to configure an authenticator application, or to the
`Keystone documentation`__ if you are configuring this for your own cloud.
.. __: https://docs.openstack.org/keystone/latest/admin/auth-totp.html
.. note::
If a passcode is not provided, you will be prompted for one.

View file

@ -20,119 +20,129 @@ Release 4.0
----------- -----------
1. Remove ``ip fixed add|remove`` commands. 1. Remove ``ip fixed add|remove`` commands.
Use ``server add|remove fixed ip`` commands instead. Use ``server add|remove fixed ip`` commands instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612781 * Commit: https://review.opendev.org/612781
2. Remove ``ip floating add|remove`` commands. 2. Remove ``ip floating add|remove`` commands.
Use ``server add|remove floating ip`` commands instead. Use ``server add|remove floating ip`` commands instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612781 * Commit: https://review.opendev.org/612781
3. Remove ``service create`` option ``--type``. Service type is 3. Remove ``service create`` option ``--type``. Service type is
a positional argument. a positional argument.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612798 * Commit: https://review.opendev.org/612798
4. Remove ``role list`` options ``--project`` and ``--user``. 4. Remove ``role list`` options ``--project`` and ``--user``.
Use ``role assignment list`` options ``--project`` and ``--user`` instead. Use ``role assignment list`` options ``--project`` and ``--user`` instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612798 * Commit: https://review.opendev.org/612798
5. Remove ``user role list`` command. 5. Remove ``user role list`` command.
Use ``role assignment list`` options ``--project`` and ``--user`` instead. Use ``role assignment list`` options ``--project`` and ``--user`` instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612798 * Commit: https://review.opendev.org/612798
6. Remove ``image create|set`` option ``--owner``. 6. Remove ``image create|set`` option ``--owner``.
Use ``--project`` option instead. Use ``--project`` option instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/659431 * Commit: https://review.opendev.org/659431
7. Remove ``port create|set`` options ``--device-id`` and ``--host-id``. 7. Remove ``port create|set`` options ``--device-id`` and ``--host-id``.
Use ``--device`` and ``--host`` instead. Use ``--device`` and ``--host`` instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/613644 * Commit: https://review.opendev.org/613644
8. Remove ``router set`` option ``--clear-routes``. 8. Remove ``router set`` option ``--clear-routes``.
Use ``no-route`` option instead. Use ``no-route`` option instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/613644 * Commit: https://review.opendev.org/613644
9. Remove ``security group rule create`` options ``--src-ip`` and ``--src-group``. 9. Remove ``security group rule create`` options ``--src-ip`` and ``--src-group``.
Use ``--remote-ip`` and ``--remote-group`` options instead. Use ``--remote-ip`` and ``--remote-group`` options instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/613644 * Commit: https://review.opendev.org/613644
10. Remove ``backup`` commands. 10. Remove ``backup`` commands.
Use ``volume backup`` commands instead. Use ``volume backup`` commands instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612751 * Commit: https://review.opendev.org/612751
11. Remove ``snapshot`` commands. 11. Remove ``snapshot`` commands.
Use ``volume snapshot`` commands instead. Use ``volume snapshot`` commands instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612751 * Commit: https://review.opendev.org/612751
12. Remove ``volume create`` options ``--project``, ``--user``, ``--multi-attach``. 12. Remove ``volume create`` options ``--project``, ``--user``, ``--multi-attach``.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612751 * Commit: https://review.opendev.org/612751
13. Change ``volume transfer request accept`` to use new option ``--auth-key`` 13. Change ``volume transfer request accept`` to use new option ``--auth-key``
rather than a second positional argument. rather than a second positional argument.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/612751 * Commit: https://review.opendev.org/612751
14. Remove 'Token/Endpoint' auth plugin support (type ``token_endpoint``). 14. Remove 'Token/Endpoint' auth plugin support (type ``token_endpoint``).
This remained as a compatibility for the ``admin_token`` auth type to This remained as a compatibility for the ``admin_token`` auth type to
support the ``--url`` global option. That option is also now removed, support the ``--url`` global option. That option is also now removed,
use ``--endpoint`` instead. use ``--endpoint`` instead.
* Removed in: 4.0 * Removed in: 4.0
* Commit: https://review.opendev.org/<tbd> * Commit: https://review.opendev.org/<tbd>
Release 3.12 Release 3.12
------------ ------------
1. Replace ``Display Name`` by ``Name`` in volume list. 1. Replace ``Display Name`` by ``Name`` in volume list.
Change column name ``Display Name`` to ``Name`` in ``volume list`` output. Change column name ``Display Name`` to ``Name`` in ``volume list`` output.
Current ``volume list --name`` command uses ``display_name`` as search_opts Current ``volume list --name`` command uses ``display_name`` as search_opts
to send to cinder API, and show the result table with ``Display Name`` to send to cinder API, and show the result table with ``Display Name``
as column title. Replace all ``Display Name`` by ``Name`` to be consistent as column title. Replace all ``Display Name`` by ``Name`` to be consistent
with other list commands. with other list commands.
Support a mapping for volume list -c ``Display Name`` (Volume v1 and v2) Support a mapping for volume list -c ``Display Name`` (Volume v1 and v2)
and volume create/show -c ``display_name`` (Volume v1) to maintain backward and volume create/show -c ``display_name`` (Volume v1) to maintain backward
compatibility until the next major release. compatibility until the next major release.
* In favor of: ``openstack volume list -c Name`` * In favor of: ``openstack volume list -c Name``
* As of: 3.12.0 * As of: 3.12.0
* Removed in: n/a * Removed in: n/a
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1657956 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1657956
* Commit: https://review.opendev.org/#/c/423081/ * Commit: https://review.opendev.org/#/c/423081/
Release 3.10 Release 3.10
------------ ------------
1. The ``network create`` command now requires the ``--subnet`` option when used 1. The ``network create`` command now requires the ``--subnet`` option when used
with Nova-network clouds. with nova-network clouds.
* As of: 3.10 * As of: 3.10
* Commit: https://review.opendev.org/460679 * Commit: https://review.opendev.org/460679
2. The positional argument ``<snapshot-name>`` of the ``volume snapshot create`` 2. The positional argument ``<snapshot-name>`` of the ``volume snapshot create``
command is no longer optional. command is no longer optional.
@ -142,23 +152,23 @@ Release 3.10
``--volume`` option is not present now it defaults to the value of ``--volume`` option is not present now it defaults to the value of
``<snapshot-name>``. ``<snapshot-name>``.
* As of: 3.10 * As of: 3.10
* Bug: 1659894 * Bug: 1659894
* Commit: https://review.opendev.org/440497 * Commit: https://review.opendev.org/440497
Release 3.0 Release 3.0
----------- -----------
1. Remove the ``osc_password`` authentication plugin. 1. Remove the ``osc_password`` authentication plugin.
This was the 'last-resort' plugin default that worked around an old default This was the 'last-resort' plugin default that worked around an old default
Keystone configuration for the ``admin_endpoint`` and ``public_endpoint``. Keystone configuration for the ``admin_endpoint`` and ``public_endpoint``.
* In favor of: ``password`` * In favor of: ``password``
* As of: 3.0 * As of: 3.0
* Removed in: n/a * Removed in: n/a
* Bug: n/a * Bug: n/a
* Commit: https://review.opendev.org/332938 * Commit: https://review.opendev.org/332938
Releases Before 3.0 Releases Before 3.0
@ -166,209 +176,209 @@ Releases Before 3.0
1. Rename command `openstack project usage list` 1. Rename command `openstack project usage list`
The `project` part of the command was pointless. The `project` part of the command was pointless.
* In favor of: `openstack usage list` instead. * In favor of: `openstack usage list` instead.
* As of: 1.0.2 * As of: 1.0.2
* Removed in: TBD * Removed in: TBD
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1406654 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1406654
* Commit: https://review.opendev.org/#/c/147379/ * Commit: https://review.opendev.org/#/c/147379/
2. <type> should not be optional for command `openstack service create` 2. <type> should not be optional for command `openstack service create`
Previously, the command was `openstack service create <name> --type <type>`, Previously, the command was `openstack service create <name> --type <type>`,
whereas now it is: `openstack service create <type> --name <name>`. whereas now it is: `openstack service create <type> --name <name>`.
This bug also affected python-keystoneclient, and keystone. This bug also affected python-keystoneclient, and keystone.
* In favor of: making <type> a positional argument. * In favor of: making <type> a positional argument.
* As of: 1.0.2 * As of: 1.0.2
* Removed in: TBD * Removed in: TBD
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1404073 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1404073
* Commit: https://review.opendev.org/#/c/143242/ * Commit: https://review.opendev.org/#/c/143242/
3. Command `openstack security group rule delete` now requires rule id 3. Command `openstack security group rule delete` now requires rule id
Previously, the command was `openstack security group rule delete --proto Previously, the command was `openstack security group rule delete --proto
<proto> [--src-ip <ip-address> --dst-port <port-range>] <group>`, <proto> [--src-ip <ip-address> --dst-port <port-range>] <group>`,
whereas now it is: `openstack security group rule delete <rule>`. whereas now it is: `openstack security group rule delete <rule>`.
* In favor of: Using `openstack security group rule delete <rule>`. * In favor of: Using `openstack security group rule delete <rule>`.
* As of: 1.2.1 * As of: 1.2.1
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1450872 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1450872
* Commit: https://review.opendev.org/#/c/179446/ * Commit: https://review.opendev.org/#/c/179446/
4. Command `openstack image create` does not update already existing image 4. Command `openstack image create` does not update already existing image
Previously, the image create command updated already existing image if it had Previously, the image create command updated already existing image if it had
same name. It disabled possibility to create multiple images with same name same name. It disabled possibility to create multiple images with same name
and lead to potentially unwanted update of existing images by image create and lead to potentially unwanted update of existing images by image create
command. command.
Now, update code was moved from create action to set action. Now, update code was moved from create action to set action.
* In favor of: Create multiple images with same name (as glance does). * In favor of: Create multiple images with same name (as glance does).
* As of: 1.5.0 * As of: 1.5.0
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1461817 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1461817
* Commit: https://review.opendev.org/#/c/194654/ * Commit: https://review.opendev.org/#/c/194654/
5. Command `openstack network list --dhcp` has been removed 5. Command `openstack network list --dhcp` has been removed
The --dhcp option to network list is not a logical use case of listing The --dhcp option to network list is not a logical use case of listing
networks, it lists agents. Another command should be added in the future networks, it lists agents. Another command should be added in the future
to provide this functionality. It is highly unlikely anyone uses this to provide this functionality. It is highly unlikely anyone uses this
feature as we don't support any other agent commands. Use neutron feature as we don't support any other agent commands. Use neutron
dhcp-agent-list-hosting-net command instead. dhcp-agent-list-hosting-net command instead.
* In favor of: Create network agent list command in the future * In favor of: Create network agent list command in the future
* As of: 1.6.0 * As of: 1.6.0
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/472613 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/472613
* Commit: https://review.opendev.org/#/c/194654/ * Commit: https://review.opendev.org/#/c/194654/
6. Plugin interface change for default API versions 6. Plugin interface change for default API versions
Previously, the default version was set in the parsed arguments, Previously, the default version was set in the parsed arguments,
but this makes it impossible to tell what has been passed in at the but this makes it impossible to tell what has been passed in at the
command line, set in an environment variable or is just the default. command line, set in an environment variable or is just the default.
Now, the module should have a DEFAULT_API_VERSION that contains the Now, the module should have a DEFAULT_API_VERSION that contains the
value and it will be set after command line argument, environment value and it will be set after command line argument, environment
and OCC file processing. and OCC file processing.
* In favor of: DEFAULT_API_VERSION * In favor of: DEFAULT_API_VERSION
* As of: 1.2.1 * As of: 1.2.1
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1453229 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1453229
* Commit: https://review.opendev.org/#/c/181514/ * Commit: https://review.opendev.org/#/c/181514/
7. `image set` commands will no longer return the modified resource 7. `image set` commands will no longer return the modified resource
Previously, modifying an image would result in the new image being displayed Previously, modifying an image would result in the new image being displayed
to the user. To keep things consistent with other `set` commands, we will to the user. To keep things consistent with other `set` commands, we will
no longer be showing the modified resource. no longer be showing the modified resource.
* In favor of: Use `set` then `show` * In favor of: Use `set` then `show`
* As of: NA * As of: NA
* Removed in: NA * Removed in: NA
* Bug: NA * Bug: NA
* Commit: NA * Commit: NA
8. `region` commands no longer support `url` 8. `region` commands no longer support `url`
The Keystone team removed support for the `url` attribute from the client The Keystone team removed support for the `url` attribute from the client
and server side. Changes to the `create`, `set` and `list` commands for and server side. Changes to the `create`, `set` and `list` commands for
regions have been affected. regions have been affected.
* In favor of: NA * In favor of: NA
* As of 1.9.0 * As of 1.9.0
* Removed in: NA * Removed in: NA
* Bug: https://launchpad.net/bugs/1506841 * Bug: https://launchpad.net/bugs/1506841
* Commit: https://review.opendev.org/#/c/236736/ * Commit: https://review.opendev.org/#/c/236736/
9. `flavor set/unset` commands will no longer return the modified resource 9. `flavor set/unset` commands will no longer return the modified resource
Previously, modifying a flavor would result in the new flavor being displayed Previously, modifying a flavor would result in the new flavor being displayed
to the user. To keep things consistent with other `set/unset` commands, we to the user. To keep things consistent with other `set/unset` commands, we
will no longer be showing the modified resource. will no longer be showing the modified resource.
* In favor of: Use `set/unset` then `show` * In favor of: Use `set/unset` then `show`
* As of: NA * As of: NA
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065
* Commit: https://review.opendev.org/#/c/280663/ * Commit: https://review.opendev.org/#/c/280663/
10. `security group set` commands will no longer return the modified resource 10. `security group set` commands will no longer return the modified resource
Previously, modifying a security group would result in the new security group Previously, modifying a security group would result in the new security group
being displayed to the user. To keep things consistent with other `set` being displayed to the user. To keep things consistent with other `set`
commands, we will no longer be showing the modified resource. commands, we will no longer be showing the modified resource.
* In favor of: Use `set` then `show` * In favor of: Use `set` then `show`
* As of: NA * As of: NA
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065
* Commit: https://review.opendev.org/#/c/281087/ * Commit: https://review.opendev.org/#/c/281087/
11. `compute agent set` commands will no longer return the modified resource 11. `compute agent set` commands will no longer return the modified resource
Previously, modifying an agent would result in the new agent being displayed Previously, modifying an agent would result in the new agent being displayed
to the user. To keep things consistent with other `set` commands, we will to the user. To keep things consistent with other `set` commands, we will
no longer be showing the modified resource. no longer be showing the modified resource.
* In favor of: Use `set` then `show` * In favor of: Use `set` then `show`
* As of: NA * As of: NA
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065
* Commit: https://review.opendev.org/#/c/281088/ * Commit: https://review.opendev.org/#/c/281088/
12. `<version> <url> <md5hash>` should be optional for command `openstack 12. `<version> <url> <md5hash>` should be optional for command `openstack
compute agent set` compute agent set`
Previously, the command was `openstack compute agent set <id> <version> <url> Previously, the command was `openstack compute agent set <id> <version> <url>
<md5hash>`, whereas now it is: `openstack compute agent set <id> --version <md5hash>`, whereas now it is: `openstack compute agent set <id> --version
<version> --url <url> --md5hash <md5hash>`. <version> --url <url> --md5hash <md5hash>`.
* In favor of: making <version> <url> <md5hash> optional. * In favor of: making <version> <url> <md5hash> optional.
* As of: NA * As of: NA
* Removed in: NA * Removed in: NA
* Bug: NA * Bug: NA
* Commit: https://review.opendev.org/#/c/328819/ * Commit: https://review.opendev.org/#/c/328819/
13. `aggregate set` commands will no longer return the modified resource 13. `aggregate set` commands will no longer return the modified resource
Previously, modifying an aggregate would result in the new aggregate being Previously, modifying an aggregate would result in the new aggregate being
displayed to the user. To keep things consistent with other `set` commands, displayed to the user. To keep things consistent with other `set` commands,
we will no longer be showing the modified resource. we will no longer be showing the modified resource.
* In favor of: Use `set` then `show` * In favor of: Use `set` then `show`
* As of: NA * As of: NA
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1546065
* Commit: https://review.opendev.org/#/c/281089/ * Commit: https://review.opendev.org/#/c/281089/
14. Output of `ip floating list` command has changed. 14. Output of `ip floating list` command has changed.
When using Compute v2, the original output is: When using Compute v2, the original output is:
.. code-block:: bash .. code-block:: bash
# ip floating list # ip floating list
+----+--------+------------+----------+-------------+ +----+--------+------------+----------+-------------+
| ID | Pool | IP | Fixed IP | Instance ID | | ID | Pool | IP | Fixed IP | Instance ID |
+----+--------+-----------------------+-------------+ +----+--------+-----------------------+-------------+
| 1 | public | 172.24.4.1 | None | None | | 1 | public | 172.24.4.1 | None | None |
+----+--------+------------+----------+-------------+ +----+--------+------------+----------+-------------+
Now it changes to: Now it changes to:
.. code-block:: bash .. code-block:: bash
# ip floating list # ip floating list
+----+---------------------+------------------+-----------+--------+ +----+---------------------+------------------+-----------+--------+
| ID | Floating IP Address | Fixed IP Address | Server ID | Pool | | ID | Floating IP Address | Fixed IP Address | Server ID | Pool |
+----+---------------------+------------------+-----------+--------+ +----+---------------------+------------------+-----------+--------+
| 1 | 172.24.4.1 | None | None | public | | 1 | 172.24.4.1 | None | None | public |
+----+---------------------+------------------+-----------+--------+ +----+---------------------+------------------+-----------+--------+
When using Network v2, which is different from Compute v2. The output is: When using Network v2, which is different from Compute v2. The output is:
.. code-block:: bash .. code-block:: bash
# ip floating list # ip floating list
+--------------------------------------+---------------------+------------------+------+ +--------------------------------------+---------------------+------------------+------+
| ID | Floating IP Address | Fixed IP Address | Port | | ID | Floating IP Address | Fixed IP Address | Port |
+--------------------------------------+---------------------+------------------+------+ +--------------------------------------+---------------------+------------------+------+
| 1976df86-e66a-4f96-81bd-c6ffee6407f1 | 172.24.4.3 | None | None | | 1976df86-e66a-4f96-81bd-c6ffee6407f1 | 172.24.4.3 | None | None |
+--------------------------------------+---------------------+------------------+------+ +--------------------------------------+---------------------+------------------+------+
* In favor of: Use `ip floating list` command * In favor of: Use `ip floating list` command
* As of: NA * As of: NA
* Removed in: NA * Removed in: NA
* Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1519502 * Bug: https://bugs.launchpad.net/python-openstackclient/+bug/1519502
* Commit: https://review.opendev.org/#/c/277720/ * Commit: https://review.opendev.org/#/c/277720/
For Developers For Developers
============== ==============

View file

@ -9,53 +9,11 @@ rule comprises of a service type, a request path, and a request method. Access
rules may only be created as attributes of application credentials, but they may rules may only be created as attributes of application credentials, but they may
be viewed and deleted independently. be viewed and deleted independently.
.. autoprogram-cliff:: openstack.identity.v3
:command: access rule delete
access rule delete .. autoprogram-cliff:: openstack.identity.v3
------------------ :command: access rule list
Delete access rule(s) .. autoprogram-cliff:: openstack.identity.v3
:command: access rule show
.. program:: access rule delete
.. code:: bash
openstack access rule delete <access-rule> [<access-rule> ...]
.. describe:: <access-rule>
Access rule(s) to delete (ID)
access rule list
----------------
List access rules
.. program:: access rule list
.. code:: bash
openstack access rule list
[--user <user>]
[--user-domain <user-domain>]
.. option:: --user
User whose access rules to list (name or ID). If not provided, looks up the
current user's access rules.
.. option:: --user-domain
Domain the user belongs to (name or ID). This can be
used in case collisions between user names exist.
access rule show
---------------------------
Display access rule details
.. program:: access rule show
.. code:: bash
openstack access rule show <access-rule>
.. describe:: <access-rule>
Access rule to display (ID)

View file

@ -0,0 +1,8 @@
=============
block storage
=============
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: block storage cleanup

View file

@ -0,0 +1,8 @@
=====================
block storage cluster
=====================
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: block storage cluster *

View file

@ -0,0 +1,8 @@
=======================
Block Storage Log Level
=======================
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: block storage log level *

View file

@ -0,0 +1,11 @@
====================
Block Storage Manage
====================
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: block storage volume manageable list
.. autoprogram-cliff:: openstack.volume.v3
:command: block storage snapshot manageable list

View file

@ -0,0 +1,8 @@
=============================
block storage resource filter
=============================
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: block storage resource filter *

View file

@ -2,95 +2,16 @@
consistency group snapshot consistency group snapshot
========================== ==========================
Block Storage v2 Block Storage v2, v3
consistency group snapshot create .. autoprogram-cliff:: openstack.volume.v3
--------------------------------- :command: consistency group snapshot create
Create new consistency group snapshot. .. autoprogram-cliff:: openstack.volume.v3
:command: consistency group snapshot delete
.. program:: consistency group snapshot create .. autoprogram-cliff:: openstack.volume.v3
.. code:: bash :command: consistency group snapshot list
openstack consistency group snapshot create .. autoprogram-cliff:: openstack.volume.v3
[--consistency-group <consistency-group>] :command: consistency group snapshot show
[--description <description>]
[<snapshot-name>]
.. option:: --consistency-group <consistency-group>
Consistency group to snapshot (name or ID)
(default to be the same as <snapshot-name>)
.. option:: --description <description>
Description of this consistency group snapshot
.. _consistency_group_snapshot_create-snapshot-name:
.. describe:: <snapshot-name>
Name of new consistency group snapshot (default to None)
consistency group snapshot delete
---------------------------------
Delete consistency group snapshot(s)
.. program:: consistency group snapshot delete
.. code:: bash
openstack consistency group snapshot delete
<consistency-group-snapshot> [<consistency-group-snapshot> ...]
.. _consistency_group_snapshot_delete-consistency-group-snapshot:
.. describe:: <consistency-group-snapshot>
Consistency group snapshot(s) to delete (name or ID)
consistency group snapshot list
-------------------------------
List consistency group snapshots.
.. program:: consistency group snapshot list
.. code:: bash
openstack consistency group snapshot list
[--all-projects]
[--long]
[--status <status>]
[--consistency-group <consistency-group>]
.. option:: --all-projects
Show detail for all projects. Admin only.
(defaults to False)
.. option:: --long
List additional fields in output
.. option:: --status <status>
Filters results by a status
("available", "error", "creating", "deleting" or "error_deleting")
.. option:: --consistency-group <consistency-group>
Filters results by a consistency group (name or ID)
consistency group snapshot show
-------------------------------
Display consistency group snapshot details.
.. program:: consistency group snapshot show
.. code:: bash
openstack consistency group snapshot show
<consistency-group-snapshot>
.. _consistency_group_snapshot_show-consistency-group-snapshot:
.. describe:: <consistency-group-snapshot>
Consistency group snapshot to display (name or ID)

View file

@ -2,172 +2,25 @@
consistency group consistency group
================= =================
Block Storage v2 Block Storage v2, v3
consistency group add volume .. autoprogram-cliff:: openstack.volume.v3
---------------------------- :command: consistency group add volume
Add volume(s) to consistency group. .. autoprogram-cliff:: openstack.volume.v3
:command: consistency group create
.. program:: consistency group add volume .. autoprogram-cliff:: openstack.volume.v3
.. code:: bash :command: consistency group delete
openstack consistency group add volume .. autoprogram-cliff:: openstack.volume.v3
<consistency-group> :command: consistency group list
<volume> [<volume> ...]
.. _consistency_group_add_volume: .. autoprogram-cliff:: openstack.volume.v3
.. describe:: <consistency-group> :command: consistency group remove volume
Consistency group to contain <volume> (name or ID) .. autoprogram-cliff:: openstack.volume.v3
:command: consistency group set
.. describe:: <volume> .. autoprogram-cliff:: openstack.volume.v3
:command: consistency group show
Volume(s) to add to <consistency-group> (name or ID)
(repeat option to add multiple volumes)
consistency group create
------------------------
Create new consistency group.
.. program:: consistency group create
.. code:: bash
openstack consistency group create
--volume-type <volume-type> | --consistency-group-source <consistency-group> | --consistency-group-snapshot <consistency-group-snapshot>
[--description <description>]
[--availability-zone <availability-zone>]
[<name>]
.. option:: --volume-type <volume-type>
Volume type of this consistency group (name or ID)
.. option:: --consistency-group-source <consistency-group>
Existing consistency group (name or ID)
.. option:: --consistency-group-snapshot <consistency-group-snapshot>
Existing consistency group snapshot (name or ID)
.. option:: --description <description>
Description of this consistency group
.. option:: --availability-zone <availability-zone>
Availability zone for this consistency group
(not available if creating consistency group from source)
.. _consistency_group_create-name:
.. describe:: <name>
Name of new consistency group (default to None)
consistency group delete
------------------------
Delete consistency group(s).
.. program:: consistency group delete
.. code:: bash
openstack consistency group delete
[--force]
<consistency-group> [<consistency-group> ...]
.. option:: --force
Allow delete in state other than error or available
.. _consistency_group_delete-consistency-group:
.. describe:: <consistency-group>
Consistency group(s) to delete (name or ID)
consistency group list
----------------------
List consistency groups.
.. program:: consistency group list
.. code:: bash
openstack consistency group list
[--all-projects]
[--long]
.. option:: --all-projects
Show detail for all projects. Admin only.
(defaults to False)
.. option:: --long
List additional fields in output
consistency group remove volume
-------------------------------
Remove volume(s) from consistency group.
.. program:: consistency group remove volume
.. code:: bash
openstack consistency group remove volume
<consistency-group>
<volume> [<volume> ...]
.. _consistency_group_remove_volume:
.. describe:: <consistency-group>
Consistency group containing <volume> (name or ID)
.. describe:: <volume>
Volume(s) to remove from <consistency-group> (name or ID)
(repeat option to remove multiple volumes)
consistency group set
---------------------
Set consistency group properties.
.. program:: consistency group set
.. code:: bash
openstack consistency group set
[--name <name>]
[--description <description>]
<consistency-group>
.. option:: --name <name>
New consistency group name
.. option:: --description <description>
New consistency group description
.. _consistency_group_set-consistency-group:
.. describe:: <consistency-group>
Consistency group to modify (name or ID)
consistency group show
----------------------
Display consistency group details.
.. program:: consistency group show
.. code:: bash
openstack consistency group show
<consistency-group>
.. _consistency_group_show-consistency-group:
.. describe:: <consistency-group>
Consistency group to display (name or ID)

View file

@ -0,0 +1,10 @@
==================
console connection
==================
Server console connection information
Compute v2
.. autoprogram-cliff:: openstack.compute.v2
:command: console connection show

View file

@ -0,0 +1,11 @@
===========================
default security group rule
===========================
A **default security group rule** specifies the template of the security group
rules which will be used by neutron to create rules in every new security group.
Network v2
.. autoprogram-cliff:: openstack.network.v2
:command: default security group rule *

View file

@ -0,0 +1,14 @@
============
image member
============
Image v2
.. autoprogram-cliff:: openstack.image.v2
:command: image add project
.. autoprogram-cliff:: openstack.image.v2
:command: image remove project
.. autoprogram-cliff:: openstack.image.v2
:command: image member list

View file

@ -0,0 +1,50 @@
=============
image metadef
=============
Image v2
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef namespace create
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef namespace delete
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef namespace list
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef namespace set
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef namespace show
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef resource type list
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef object create
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef object show
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef object list
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef object delete
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef object update
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef object property show
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef property create
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef property list
.. autoprogram-cliff:: openstack.image.v2
:command: image metadef property show

View file

@ -0,0 +1,11 @@
==========
image task
==========
Image v2
.. autoprogram-cliff:: openstack.image.v2
:command: image task list
.. autoprogram-cliff:: openstack.image.v2
:command: image task show

View file

@ -1,6 +1,32 @@
======== =====
image v2 image
======== =====
Image v2
.. autoprogram-cliff:: openstack.image.v2 .. autoprogram-cliff:: openstack.image.v2
:command: image * :command: image create
.. autoprogram-cliff:: openstack.image.v2
:command: image delete
.. autoprogram-cliff:: openstack.image.v2
:command: image list
.. autoprogram-cliff:: openstack.image.v2
:command: image save
.. autoprogram-cliff:: openstack.image.v2
:command: image set
.. autoprogram-cliff:: openstack.image.v2
:command: image unset
.. autoprogram-cliff:: openstack.image.v2
:command: image show
.. autoprogram-cliff:: openstack.image.v2
:command: image stage
.. autoprogram-cliff:: openstack.image.v2
:command: image import

View file

@ -4,7 +4,7 @@ limits
The Compute and Block Storage APIs have resource usage limits. The Compute and Block Storage APIs have resource usage limits.
Compute v2, Block Storage v1 Block Storage v2, v3; Compute v2
.. autoprogram-cliff:: openstack.common .. autoprogram-cliff:: openstack.common

View file

@ -0,0 +1,11 @@
=============================================
Local IP Associations (local_ip_associations)
=============================================
The resource lets users assign Local IPs to user Ports.
This is a sub-resource of the Local IP resource.
Network v2
.. autoprogram-cliff:: openstack.network.v2
:command: local ip association *

View file

@ -0,0 +1,12 @@
=====================
Local IPs (local_ips)
=====================
Extension that allows users to create a virtual IP that can later be assigned
to multiple ports/VMs (similar to anycast IP) and is guaranteed to only be
reachable within the same physical server/node boundaries
Network v2
.. autoprogram-cliff:: openstack.network.v2
:command: local ip *

View file

@ -0,0 +1,8 @@
===========================
network l3 conntrack helper
===========================
Network v2
.. autoprogram-cliff:: openstack.network.v2
:command: network l3 conntrack helper *

View file

@ -0,0 +1,16 @@
=============
network trunk
=============
A **network trunk** is a container to group logical ports from different
networks and provide a single trunked vNIC for servers. It consists of
one parent port which is a regular VIF and multiple subports which allow
the server to connect to more networks.
Network v2
.. autoprogram-cliff:: openstack.network.v2
:command: network subport list
.. autoprogram-cliff:: openstack.network.v2
:command: network trunk *

View file

@ -1,11 +0,0 @@
=============
project purge
=============
Clean resources associated with a specific project.
Block Storage v1, v2; Compute v2; Image v1, v2
.. autoprogram-cliff:: openstack.common
:command: project purge

View file

@ -5,7 +5,7 @@ quota
Resource quotas appear in multiple APIs, OpenStackClient presents them as a Resource quotas appear in multiple APIs, OpenStackClient presents them as a
single object with multiple properties. single object with multiple properties.
Block Storage v1, v2, Compute v2, Network v2 Block Storage v1, v3; Compute v2; Network v2
.. autoprogram-cliff:: openstack.common .. autoprogram-cliff:: openstack.common
:command: quota * :command: quota *

View file

@ -4,103 +4,5 @@ role assignment
Identity v2, v3 Identity v2, v3
role assignment list .. autoprogram-cliff:: openstack.identity.v3
-------------------- :command: role assignment list
List role assignments
.. program:: role assignment list
.. code:: bash
openstack role assignment list
[--role <role>]
[--role-domain <role-domain>]
[--user <user>]
[--user-domain <user-domain>]
[--group <group>]
[--group-domain <group-domain>]
[--domain <domain>]
[--project <project>]
[--project-domain <project-domain>]
[--effective]
[--inherited]
[--names]
.. option:: --role <role>
Role to filter (name or ID)
.. versionadded:: 3
.. option:: --role-domain <role-domain>
Domain the role belongs to (name or ID).
This can be used in case collisions between role names exist.
.. versionadded:: 3
.. option:: --user <user>
User to filter (name or ID)
.. option:: --user-domain <user-domain>
Domain the user belongs to (name or ID).
This can be used in case collisions between user names exist.
.. versionadded:: 3
.. option:: --group <group>
Group to filter (name or ID)
.. versionadded:: 3
.. option:: --group-domain <group-domain>
Domain the group belongs to (name or ID).
This can be used in case collisions between group names exist.
.. versionadded:: 3
.. option:: --domain <domain>
Domain to filter (name or ID)
.. versionadded:: 3
.. option:: --project <project>
Project to filter (name or ID)
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. versionadded:: 3
.. option:: --effective
Returns only effective role assignments (defaults to False)
.. versionadded:: 3
.. option:: --inherited
Specifies if the role grant is inheritable to the sub projects
.. versionadded:: 3
.. option:: --names
Returns role assignments with names instead of IDs
.. option:: --auth-user
Returns role assignments for the authenticated user.
.. option:: --auth-project
Returns role assignments for the project to which the authenticated user
is scoped.

View file

@ -0,0 +1,12 @@
=================
router ndp proxy
=================
An **NDP proxy** publishes a internal IPv6 address to public network. With the
**NDP proxy**, the IPv6 address can be accessed from external. It is similar
to **Floating IP** of IPv4 in functionality.
Network v2
.. autoprogram-cliff:: openstack.network.v2
:command: router ndp proxy *

View file

@ -9,4 +9,4 @@ supported: live migration, cold migration, resize and evacuation.
Compute v2 Compute v2
.. autoprogram-cliff:: openstack.compute.v2 .. autoprogram-cliff:: openstack.compute.v2
:command: server migration list :command: server migration *

View file

@ -0,0 +1,8 @@
=================
volume attachment
=================
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: volume attachment *

View file

@ -2,7 +2,7 @@
volume backend volume backend
============== ==============
Block Storage v2 Block Storage v2, v3
.. autoprogram-cliff:: openstack.volume.v2 .. autoprogram-cliff:: openstack.volume.v3
:command: volume backend * :command: volume backend *

View file

@ -2,8 +2,8 @@
volume backup volume backup
============= =============
Block Storage v1, v2 Block Storage v2, v3
.. autoprogram-cliff:: openstack.volume.v2 .. autoprogram-cliff:: openstack.volume.v3
:command: volume backup * :command: volume backup *

View file

@ -0,0 +1,8 @@
=====================
volume group snapshot
=====================
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group snapshot *

View file

@ -0,0 +1,8 @@
=================
volume group type
=================
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group type *

View file

@ -0,0 +1,23 @@
============
volume group
============
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group create
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group delete
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group list
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group failover
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group set
.. autoprogram-cliff:: openstack.volume.v3
:command: volume group show

View file

@ -2,51 +2,7 @@
volume host volume host
=========== ===========
Block Storage v2 Block Storage v2, v3
volume host failover .. autoprogram-cliff:: openstack.volume.v3
-------------------- :command: volume host *
Failover volume host to different backend
.. program:: volume host failover
.. code:: bash
openstack volume host failover
--volume-backend <backend-id>
<host-name>
.. option:: --volume-backend <backend-id>
The ID of the volume backend replication
target where the host will failover to (required)
.. _volume_host_failover-host-name:
.. describe:: <host-name>
Name of volume host
volume host set
---------------
Set volume host properties
.. program:: volume host set
.. code:: bash
openstack volume host set
[--enable | --disable]
<host-name>
.. option:: --enable
Thaw and enable the specified volume host.
.. option:: --disable
Freeze and disable the specified volume host
.. _volume_host_set-host-name:
.. describe:: <host-name>
Name of volume host

View file

@ -0,0 +1,8 @@
==============
volume message
==============
Block Storage v3
.. autoprogram-cliff:: openstack.volume.v3
:command: volume message *

View file

@ -2,165 +2,7 @@
volume qos volume qos
========== ==========
Block Storage v1, v2 Block Storage v2, v3
volume qos associate .. autoprogram-cliff:: openstack.volume.v3
-------------------- :command: volume qos *
Associate a QoS specification to a volume type
.. program:: volume qos associate
.. code:: bash
openstack volume qos associate
<qos-spec>
<volume-type>
.. _volume_qos_associate:
.. describe:: <qos-spec>
QoS specification to modify (name or ID)
.. describe:: <volume-type>
Volume type to associate the QoS (name or ID)
volume qos create
-----------------
Create new QoS Specification
.. program:: volume qos create
.. code:: bash
openstack volume qos create
[--consumer <consumer>]
[--property <key=value> [...] ]
<name>
.. option:: --consumer <consumer>
Consumer of the QoS. Valid consumers: 'front-end', 'back-end', 'both' (defaults to 'both')
.. option:: --property <key=value>
Set a property on this QoS specification (repeat option to set multiple properties)
.. _volume_qos_create-name:
.. describe:: <name>
New QoS specification name
volume qos delete
-----------------
Delete QoS specification
.. program:: volume qos delete
.. code:: bash
openstack volume qos delete
[--force]
<qos-spec> [<qos-spec> ...]
.. option:: --force
Allow to delete in-use QoS specification(s)
.. _volume_qos_delete-qos-spec:
.. describe:: <qos-spec>
QoS specification(s) to delete (name or ID)
volume qos disassociate
-----------------------
Disassociate a QoS specification from a volume type
.. program:: volume qos disassociate
.. code:: bash
openstack volume qos disassociate
--volume-type <volume-type> | --all
<qos-spec>
.. option:: --volume-type <volume-type>
Volume type to disassociate the QoS from (name or ID)
.. option:: --all
Disassociate the QoS from every volume type
.. _volume_qos_disassociate-qos-spec:
.. describe:: <qos-spec>
QoS specification to modify (name or ID)
volume qos list
---------------
List QoS specifications
.. program:: volume qos list
.. code:: bash
openstack volume qos list
volume qos set
--------------
Set QoS specification properties
.. program:: volume qos set
.. code:: bash
openstack volume qos set
[--property <key=value> [...] ]
<qos-spec>
.. option:: --property <key=value>
Property to add or modify for this QoS specification (repeat option to set multiple properties)
.. _volume_qos_set-qos-spec:
.. describe:: <qos-spec>
QoS specification to modify (name or ID)
volume qos show
---------------
Display QoS specification details
.. program:: volume qos show
.. code:: bash
openstack volume qos show
<qos-spec>
.. _volume_qos_show-qos-spec:
.. describe:: <qos-spec>
QoS specification to display (name or ID)
volume qos unset
----------------
Unset QoS specification properties
.. program:: volume qos unset
.. code:: bash
openstack volume qos unset
[--property <key> [...] ]
<qos-spec>
.. option:: --property <key>
Property to remove from QoS specification (repeat option to remove multiple properties)
.. _volume_qos_unset-qos-spec:
.. describe:: <qos-spec>
QoS specification to modify (name or ID)

View file

@ -2,65 +2,7 @@
volume service volume service
============== ==============
Block Storage v1, v2 Block Storage v2, v3
volume service list .. autoprogram-cliff:: openstack.volume.v3
------------------- :command: volume service *
List volume service
.. program:: volume service list
.. code:: bash
openstack volume service list
[--host <host>]
[--service <service>]
[--long]
.. option:: --host <host>
List services on specified host (name only)
.. option:: --service <service>
List only specified service (name only)
.. option:: --long
List additional fields in output
volume service set
------------------
Set volume service properties
.. program:: volume service set
.. code:: bash
openstack volume service set
[--enable | --disable]
[--disable-reason <reason>]
<host>
<service>
.. option:: --enable
Enable volume service
.. option:: --disable
Disable volume service
.. option:: --disable-reason <reason>
Reason for disabling the service
(should be used with :option:`--disable` option)
.. _volume_service_set-host:
.. describe:: <host>
Name of host
.. describe:: <service>
Name of service (Binary name)

View file

@ -2,222 +2,7 @@
volume snapshot volume snapshot
=============== ===============
Block Storage v1, v2 Block Storage v2, v3
volume snapshot create .. autoprogram-cliff:: openstack.volume.v3
---------------------- :command: volume snapshot *
Create new volume snapshot
.. program:: volume snapshot create
.. code:: bash
openstack volume snapshot create
[--volume <volume>]
[--description <description>]
[--force]
[--property <key=value> [...] ]
[--remote-source <key=value> [...]]
<snapshot-name>
.. option:: --volume <volume>
Volume to snapshot (name or ID) (default is <snapshot-name>)
.. option:: --description <description>
Description of the snapshot
.. option:: --force
Create a snapshot attached to an instance. Default is False
.. option:: --property <key=value>
Set a property to this snapshot (repeat option to set multiple properties)
*Volume version 2 only*
.. option:: --remote-source <key=value>
The attribute(s) of the exsiting remote volume snapshot
(admin required) (repeat option to specify multiple attributes)
e.g.: '--remote-source source-name=test_name --remote-source source-id=test_id'
*Volume version 2 only*
.. _volume_snapshot_create-snapshot-name:
.. describe:: <snapshot-name>
Name of the new snapshot
volume snapshot delete
----------------------
Delete volume snapshot(s)
.. program:: volume snapshot delete
.. code:: bash
openstack volume snapshot delete
[--force]
<snapshot> [<snapshot> ...]
.. option:: --force
Attempt forced removal of snapshot(s), regardless of state (defaults to False)
.. _volume_snapshot_delete-snapshot:
.. describe:: <snapshot>
Snapshot(s) to delete (name or ID)
volume snapshot list
--------------------
List volume snapshots
.. program:: volume snapshot list
.. code:: bash
openstack volume snapshot list
[--all-projects]
[--project <project> [--project-domain <project-domain>]]
[--long]
[--limit <num-snapshots>]
[--marker <snapshot>]
[--name <name>]
[--status <status>]
[--volume <volume>]
.. option:: --all-projects
Include all projects (admin only)
.. option:: --project <project>
Filter results by project (name or ID) (admin only)
*Volume version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Volume version 2 only*
.. option:: --long
List additional fields in output
.. option:: --status <status>
Filters results by a status.
('available', 'error', 'creating', 'deleting' or 'error_deleting')
.. option:: --name <name>
Filters results by a name.
.. option:: --volume <volume>
Filters results by a volume (name or ID).
.. option:: --limit <num-snapshots>
Maximum number of snapshots to display
*Volume version 2 only*
.. option:: --marker <snapshot>
The last snapshot ID of the previous page
*Volume version 2 only*
volume snapshot set
-------------------
Set volume snapshot properties
.. program:: volume snapshot set
.. code:: bash
openstack volume snapshot set
[--name <name>]
[--description <description>]
[--no-property]
[--property <key=value> [...] ]
[--state <state>]
<snapshot>
.. option:: --name <name>
New snapshot name
.. option:: --description <description>
New snapshot description
.. option:: --no-property
Remove all properties from :ref:`\<snapshot\> <volume_snapshot_set-snapshot>`
(specify both :option:`--no-property` and :option:`--property` to
remove the current properties before setting new properties.)
.. option:: --property <key=value>
Property to add or modify for this snapshot (repeat option to set multiple properties)
.. option:: --state <state>
New snapshot state.
("available", "error", "creating", "deleting", or "error_deleting") (admin only)
(This option simply changes the state of the snapshot in the database with
no regard to actual status, exercise caution when using)
*Volume version 2 only*
.. _volume_snapshot_set-snapshot:
.. describe:: <snapshot>
Snapshot to modify (name or ID)
volume snapshot show
--------------------
Display volume snapshot details
.. program:: volume snapshot show
.. code:: bash
openstack volume snapshot show
<snapshot>
.. _volume_snapshot_show-snapshot:
.. describe:: <snapshot>
Snapshot to display (name or ID)
volume snapshot unset
---------------------
Unset volume snapshot properties
.. program:: volume snapshot unset
.. code:: bash
openstack volume snapshot unset
[--property <key>]
<snapshot>
.. option:: --property <key>
Property to remove from snapshot (repeat option to remove multiple properties)
.. _volume_snapshot_unset-snapshot:
.. describe:: <snapshot>
Snapshot to modify (name or ID)

View file

@ -2,95 +2,7 @@
volume transfer request volume transfer request
======================= =======================
Block Storage v1, v2 Block Storage v2, v3
volume transfer request accept .. autoprogram-cliff:: openstack.volume.v3
------------------------------ :command: volume transfer request *
Accept volume transfer request
.. program:: volume transfer request accept
.. code:: bash
openstack volume transfer request accept
--auth-key <key>
<transfer-request-id>
.. option:: --auth-key <key>
Volume transfer request authentication key
.. _volume_transfer_request_accept:
.. describe:: <transfer-request-id>
Volume transfer request to accept (ID only)
Non-admin users are only able to specify the transfer request by ID.
volume transfer request create
------------------------------
Create volume transfer request
.. program:: volume transfer request create
.. code:: bash
openstack volume transfer request create
[--name <name>]
<volume>
.. option:: --name <name>
New transfer request name (default to None)
.. _volume_transfer_request_create-volume:
.. describe:: <volume>
Volume to transfer (name or ID)
volume transfer request delete
------------------------------
Delete volume transfer request(s)
.. program:: volume transfer request delete
.. code:: bash
openstack volume transfer request delete
<transfer-request> [<transfer-request> ...]
.. _volume_transfer_request_delete-transfer-request:
.. describe:: <transfer-request>
Volume transfer request(s) to delete (name or ID)
volume transfer request list
----------------------------
Lists all volume transfer requests
.. program:: volume transfer request list
.. code:: bash
openstack volume transfer request list
--all-projects
.. option:: --all-projects
Include all projects (admin only)
volume transfer request show
----------------------------
Show volume transfer request details
.. program:: volume transfer request show
.. code:: bash
openstack volume transfer request show
<transfer-request>
.. _volume_transfer_request_show-transfer-request:
.. describe:: <transfer-request>
Volume transfer request to display (name or ID)

View file

@ -2,290 +2,7 @@
volume type volume type
=========== ===========
Block Storage v1, v2 Block Storage v2, v3
volume type create .. autoprogram-cliff:: openstack.volume.v3
------------------ :command: volume type *
Create new volume type
.. program:: volume type create
.. code:: bash
openstack volume type create
[--description <description>]
[--public | --private]
[--property <key=value> [...] ]
[--project <project>]
[--project-domain <project-domain>]
[--encryption-provider <provider>]
[--encryption-cipher <cipher>]
[--encryption-key-size <key-size>]
[--encryption-control-location <control-location>]
<name>
.. option:: --description <description>
Volume type description
.. versionadded:: 2
.. option:: --public
Volume type is accessible to the public
.. versionadded:: 2
.. option:: --private
Volume type is not accessible to the public
.. versionadded:: 2
.. option:: --property <key=value>
Set a property on this volume type (repeat option to set multiple properties)
.. option:: --project <project>
Allow <project> to access private type (name or ID)
(Must be used with :option:`--private` option)
*Volume version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Volume version 2 only*
.. option:: --encryption-provider <provider>
Set the encryption provider format for this volume type
(e.g "luks" or "plain") (admin only)
This option is required when setting encryption type of a volume.
Consider using other encryption options such as: :option:`--encryption-cipher`,
:option:`--encryption-key-size` and :option:`--encryption-control-location`
.. option:: --encryption-cipher <cipher>
Set the encryption algorithm or mode for this volume type
(e.g "aes-xts-plain64") (admin only)
.. option:: --encryption-key-size <key-size>
Set the size of the encryption key of this volume type
(e.g "128" or "256") (admin only)
.. option:: --encryption-control-location <control-location>
Set the notional service where the encryption is performed
("front-end" or "back-end") (admin only)
The default value for this option is "front-end" when setting encryption type of
a volume. Consider using other encryption options such as: :option:`--encryption-cipher`,
:option:`--encryption-key-size` and :option:`--encryption-provider`
.. _volume_type_create-name:
.. describe:: <name>
Volume type name
volume type delete
------------------
Delete volume type(s)
.. program:: volume type delete
.. code:: bash
openstack volume type delete
<volume-type> [<volume-type> ...]
.. _volume_type_delete-volume-type:
.. describe:: <volume-type>
Volume type(s) to delete (name or ID)
volume type list
----------------
List volume types
.. program:: volume type list
.. code:: bash
openstack volume type list
[--long]
[--default | --public | --private]
[--encryption-type]
.. option:: --long
List additional fields in output
.. option:: --public
List only public types
*Volume version 2 only*
.. option:: --private
List only private types (admin only)
*Volume version 2 only*
.. option:: --default
List the default volume type
*Volume version 2 only*
.. option:: --encryption-type
Display encryption information for each volume type (admin only)
volume type set
---------------
Set volume type properties
.. program:: volume type set
.. code:: bash
openstack volume type set
[--name <name>]
[--description <description>]
[--property <key=value> [...] ]
[--project <project>]
[--project-domain <project-domain>]
[--encryption-provider <provider>]
[--encryption-cipher <cipher>]
[--encryption-key-size <key-size>]
[--encryption-control-location <control-location>]
<volume-type>
.. option:: --name <name>
Set volume type name
.. versionadded:: 2
.. option:: --description <description>
Set volume type description
.. versionadded:: 2
.. option:: --project <project>
Set volume type access to project (name or ID) (admin only)
*Volume version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
.. option:: --property <key=value>
Set a property on this volume type (repeat option to set multiple properties)
.. option:: --encryption-provider <provider>
Set the encryption provider format for this volume type
(e.g "luks" or "plain") (admin only)
This option is required when setting encryption type of a volume for the first time.
Consider using other encryption options such as: :option:`--encryption-cipher`,
:option:`--encryption-key-size` and :option:`--encryption-control-location`
.. option:: --encryption-cipher <cipher>
Set the encryption algorithm or mode for this volume type
(e.g "aes-xts-plain64") (admin only)
.. option:: --encryption-key-size <key-size>
Set the size of the encryption key of this volume type
(e.g "128" or "256") (admin only)
.. option:: --encryption-control-location <control-location>
Set the notional service where the encryption is performed
("front-end" or "back-end") (admin only)
The default value for this option is "front-end" when setting encryption type of
a volume for the first time. Consider using other encryption options such as:
:option:`--encryption-cipher`, :option:`--encryption-key-size` and :option:`--encryption-provider`
.. _volume_type_set-volume-type:
.. describe:: <volume-type>
Volume type to modify (name or ID)
volume type show
----------------
Display volume type details
.. program:: volume type show
.. code:: bash
openstack volume type show
[--encryption-type]
<volume-type>
.. option:: --encryption-type
Display encryption information of this volume type (admin only)
.. _volume_type_show-volume-type:
.. describe:: <volume-type>
Volume type to display (name or ID)
volume type unset
-----------------
Unset volume type properties
.. program:: volume type unset
.. code:: bash
openstack volume type unset
[--property <key> [...] ]
[--project <project>]
[--project-domain <project-domain>]
[--encryption-type]
<volume-type>
.. option:: --property <key>
Property to remove from volume type (repeat option to remove multiple properties)
.. option:: --project <project>
Removes volume type access from project (name or ID) (admin only)
*Volume version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Volume version 2 only*
.. option:: --encryption-type
Remove the encryption type for this volume type (admin only)
.. _volume_type_unset-volume-type:
.. describe:: <volume-type>
Volume type to modify (name or ID)

View file

@ -2,408 +2,33 @@
volume volume
====== ======
Block Storage v1, v2 Block Storage v2, v3
volume create .. autoprogram-cliff:: openstack.volume.v3
------------- :command: volume create
Create new volume .. autoprogram-cliff:: openstack.volume.v3
:command: volume delete
.. program:: volume create .. autoprogram-cliff:: openstack.volume.v3
.. code:: bash :command: volume list
openstack volume create .. autoprogram-cliff:: openstack.volume.v3
[--size <size>] :command: volume migrate
[--type <volume-type>]
[--image <image> | --snapshot <snapshot> | --source <volume> ]
[--description <description>]
[--user <user>]
[--project <project>]
[--availability-zone <availability-zone>]
[--consistency-group <consistency-group>]
[--property <key=value> [...] ]
[--hint <key=value> [...] ]
[--multi-attach]
[--bootable | --non-bootable]
[--read-only | --read-write]
<name>
.. option:: --size <size> .. autoprogram-cliff:: openstack.volume.v3
:command: volume set
Volume size in GB .. autoprogram-cliff:: openstack.volume.v3
(Required unless --snapshot or --source is specified) :command: volume show
.. option:: --type <volume-type> .. autoprogram-cliff:: openstack.volume.v3
:command: volume unset
Set the type of volume Block Storage v3
Select ``<volume-type>`` from the available types as shown .. autoprogram-cliff:: openstack.volume.v3
by ``volume type list``. :command: volume summary
.. option:: --image <image> .. autoprogram-cliff:: openstack.volume.v3
:command: volume revert
Use ``<image>`` as source of volume (name or ID)
This is commonly used to create a boot volume for a server.
.. option:: --snapshot <snapshot>
Use ``<snapshot>`` as source of volume (name or ID)
.. option:: --source <volume>
Volume to clone (name or ID)
.. option:: --description <description>
Volume description
.. option:: --user <user>
Specify an alternate user (name or ID)
.. option:: --project <project>
Specify an alternate project (name or ID)
.. option:: --availability-zone <availability-zone>
Create volume in ``<availability-zone>``
.. option:: --consistency-group <consistency-group>
Consistency group where the new volume belongs to
.. option:: --property <key=value>
Set a property on this volume (repeat option to set multiple properties)
.. option:: --hint <key=value>
Arbitrary scheduler hint key-value pairs to help boot an instance
(repeat option to set multiple hints)
.. option:: --multi-attach
Allow volume to be attached more than once (default to False)
.. option:: --bootable
Mark volume as bootable
.. option:: --non-bootable
Mark volume as non-bootable (default)
.. option:: --read-only
Set volume to read-only access mode
.. option:: --read-write
Set volume to read-write access mode (default)
.. _volume_create-name:
.. describe:: <name>
Volume name
The :option:`--project` and :option:`--user` options are typically only
useful for admin users, but may be allowed for other users depending on
the policy of the cloud and the roles granted to the user.
volume delete
-------------
Delete volume(s)
.. program:: volume delete
.. code:: bash
openstack volume delete
[--force | --purge]
<volume> [<volume> ...]
.. option:: --force
Attempt forced removal of volume(s), regardless of state (defaults to False)
.. option:: --purge
Remove any snapshots along with volume(s) (defaults to False)
*Volume version 2 only*
.. _volume_delete-volume:
.. describe:: <volume>
Volume(s) to delete (name or ID)
volume list
-----------
List volumes
.. program:: volume list
.. code:: bash
openstack volume list
[--project <project> [--project-domain <project-domain>]]
[--user <user> [--user-domain <user-domain>]]
[--name <name>]
[--status <status>]
[--all-projects]
[--long]
[--limit <num-volumes>]
[--marker <volume>]
.. option:: --project <project>
Filter results by ``<project>`` (name or ID) (admin only)
*Volume version 2 only*
.. option:: --project-domain <project-domain>
Domain the project belongs to (name or ID).
This can be used in case collisions between project names exist.
*Volume version 2 only*
.. option:: --user <user>
Filter results by ``<user>`` (name or ID) (admin only)
*Volume version 2 only*
.. option:: --user-domain <user-domain>
Domain the user belongs to (name or ID).
This can be used in case collisions between user names exist.
*Volume version 2 only*
.. option:: --name <name>
Filter results by volume name
.. option:: --status <status>
Filter results by status
.. option:: --all-projects
Include all projects (admin only)
.. option:: --long
List additional fields in output
.. option:: --limit <num-volumes>
Maximum number of volumes to display
.. option:: --marker <volume>
The last volume ID of the previous page
*Volume version 2 only*
volume migrate
--------------
Migrate volume to a new host
.. program:: volume migrate
.. code:: bash
openstack volume migrate
--host <host>
[--force-host-copy]
[--lock-volume]
<volume>
.. option:: --host <host>
Destination host (takes the form: host@backend-name#pool) (required)
.. option:: --force-host-copy
Enable generic host-based force-migration,
which bypasses driver optimizations
.. option:: --lock-volume
If specified, the volume state will be locked and will not allow
a migration to be aborted (possibly by another operation)
*Volume version 2 only*
.. _volume_migrate-volume:
.. describe:: <volume>
Volume to migrate (name or ID)
volume set
----------
Set volume properties
.. program:: volume set
.. code:: bash
openstack volume set
[--name <name>]
[--size <size>]
[--description <description>]
[--no-property]
[--property <key=value> [...] ]
[--image-property <key=value> [...] ]
[--state <state>]
[--attached | --detached ]
[--type <volume-type>]
[--retype-policy <retype-policy>]
[--bootable | --non-bootable]
[--read-only | --read-write]
<volume>
.. option:: --name <name>
New volume name
.. option:: --size <size>
Extend volume size in GB
.. option:: --description <description>
New volume description
.. option:: --no-property
Remove all properties from :ref:`\<volume\> <volume_set-volume>`
(specify both :option:`--no-property` and :option:`--property` to
remove the current properties before setting new properties.)
.. option:: --property <key=value>
Set a property on this volume (repeat option to set multiple properties)
.. option:: --type <volume-type>
New volume type (name or ID)
*Volume version 2 only*
.. option:: --retype-policy <retype-policy>
Migration policy while re-typing volume
("never" or "on-demand", default is "never" )
(available only when :option:`--type` option is specified)
*Volume version 2 only*
.. option:: --bootable
Mark volume as bootable
.. option:: --non-bootable
Mark volume as non-bootable
.. option:: --read-only
Set volume to read-only access mode
.. option:: --read-write
Set volume to read-write access mode
.. option:: --image-property <key=value>
Set an image property on this volume
(repeat option to set multiple image properties)
Image properties are copied along with the image when creating a volume
using ``--image``. Note that these properties are immutable on the image
itself, this option updates the copy attached to this volume.
*Volume version 2 only*
.. option:: --state <state>
New volume state
("available", "error", "creating", "deleting", "in-use",
"attaching", "detaching", "error_deleting" or "maintenance") (admin only)
(This option simply changes the state of the volume in the database with
no regard to actual status, exercise caution when using)
*Volume version 2 only*
.. option:: --attached
Set volume attachment status to "attached" (admin only)
(This option simply changes the state of the volume in the database with
no regard to actual status, exercise caution when using)
*Volume version 2 only*
.. option:: --deattach
Set volume attachment status to "detached" (admin only)
(This option simply changes the state of the volume in the database with
no regard to actual status, exercise caution when using)
*Volume version 2 only*
.. _volume_set-volume:
.. describe:: <volume>
Volume to modify (name or ID)
volume show
-----------
Show volume details
.. program:: volume show
.. code:: bash
openstack volume show
<volume>
.. _volume_show-volume:
.. describe:: <volume>
Volume to display (name or ID)
volume unset
------------
Unset volume properties
.. program:: volume unset
.. code:: bash
openstack volume unset
[--property <key>]
[--image-property <key>]
<volume>
.. option:: --property <key>
Remove a property from volume (repeat option to remove multiple properties)
.. option:: --image-property <key>
Remove an image property from volume
(repeat option to remove multiple image properties)
*Volume version 2 only*
.. _volume_unset-volume:
.. describe:: <volume>
Volume to modify (name or ID)

View file

@ -76,6 +76,8 @@ referring to both Compute and Volume quotas.
* ``address scope``: (**Network**) a scope of IPv4 or IPv6 addresses * ``address scope``: (**Network**) a scope of IPv4 or IPv6 addresses
* ``aggregate``: (**Compute**) a grouping of compute hosts * ``aggregate``: (**Compute**) a grouping of compute hosts
* ``availability zone``: (**Compute**, **Network**, **Volume**) a logical partition of hosts or block storage or network services * ``availability zone``: (**Compute**, **Network**, **Volume**) a logical partition of hosts or block storage or network services
* ``block storage cluster``: (**Volume**) clusters of volume services
* ``block storage resource filter``: (**Volume**) filters for volume service resources
* ``catalog``: (**Identity**) service catalog * ``catalog``: (**Identity**) service catalog
* ``command``: (**Internal**) installed commands in the OSC process * ``command``: (**Internal**) installed commands in the OSC process
* ``compute agent``: (**Compute**) a cloud Compute agent available to a hypervisor * ``compute agent``: (**Compute**) a cloud Compute agent available to a hypervisor
@ -153,12 +155,17 @@ referring to both Compute and Volume quotas.
* ``user``: (**Identity**) individual cloud resources users * ``user``: (**Identity**) individual cloud resources users
* ``user role``: (**Identity**) roles assigned to a user * ``user role``: (**Identity**) roles assigned to a user
* ``volume``: (**Volume**) block volumes * ``volume``: (**Volume**) block volumes
* ``volume attachment``: (**Volume**) an attachment of a volumes to a server
* ``volume backup``: (**Volume**) backup for volumes * ``volume backup``: (**Volume**) backup for volumes
* ``volume backend capability``: (**volume**) volume backend storage capabilities * ``volume backend capability``: (**Volume**) volume backend storage capabilities
* ``volume backend pool``: (**volume**) volume backend storage pools * ``volume backend pool``: (**Volume**) volume backend storage pools
* ``volume backup record``: (**Volume**) volume record that can be imported or exported * ``volume backup record``: (**Volume**) volume record that can be imported or exported
* ``volume backend``: (**volume**) volume backend storage * ``volume backend``: (**Volume**) volume backend storage
* ``volume group``: (**Volume**) group of volumes
* ``volume group snapshot``: (**Volume**) a point-in-time copy of a volume group
* ``volume group type``: (**Volume**) deployment-specific types of volumes groups available
* ``volume host``: (**Volume**) the physical computer for volumes * ``volume host``: (**Volume**) the physical computer for volumes
* ``volume message``: (**Volume**) volume API internal messages detailing volume failure messages
* ``volume qos``: (**Volume**) quality-of-service (QoS) specification for volumes * ``volume qos``: (**Volume**) quality-of-service (QoS) specification for volumes
* ``volume snapshot``: (**Volume**) a point-in-time copy of a volume * ``volume snapshot``: (**Volume**) a point-in-time copy of a volume
* ``volume type``: (**Volume**) deployment-specific types of volumes available * ``volume type``: (**Volume**) deployment-specific types of volumes available
@ -184,23 +191,14 @@ conflicts when creating new plugins. For a complete list check out
* ``appcontainer service``: (**Application Container (Zun)**) * ``appcontainer service``: (**Application Container (Zun)**)
* ``baremetal``: (**Baremetal (Ironic)**) * ``baremetal``: (**Baremetal (Ironic)**)
* ``claim``: (**Messaging (Zaqar)**) * ``claim``: (**Messaging (Zaqar)**)
* ``cluster``: (**Clustering (Senlin)**) * ``coe ca``: (**Container Orchestration Engine (Magnum)**)
* ``cluster action``: (**Clustering (Senlin)**) * ``coe cluster``: (**Container Orchestration Engine (Magnum)**)
* ``cluster event``: (**Clustering (Senlin)**) * ``coe cluster template``: (**Container Orchestration Engine (Magnum)**)
* ``cluster members``: (**Clustering (Senlin)**) * ``coe quotas``: (**Container Orchestration Engine (Magnum)**)
* ``cluster node``: (**Clustering (Senlin)**) * ``coe service``: (**Container Orchestration Engine (Magnum)**)
* ``cluster policy``: (**Clustering (Senlin)**) * ``coe stats``: (**Container Orchestration Engine (Magnum)**)
* ``cluster policy binding``: (**Clustering (Senlin)**)
* ``cluster policy type``: (**Clustering (Senlin)**)
* ``cluster profile``: (**Clustering (Senlin)**)
* ``cluster profile type``: (**Clustering (Senlin)**)
* ``cluster receiver``: (**Clustering (Senlin)**)
* ``cron trigger``: (**Workflow Engine (Mistral)**) * ``cron trigger``: (**Workflow Engine (Mistral)**)
* ``database flavor``: (**Database (Trove)**) * ``database flavor``: (**Database (Trove)**)
* ``dataprocessing data source``: (**Data Processing (Sahara)**)
* ``dataprocessing image``: (**Data Processing (Sahara)**)
* ``dataprocessing image tags``: (**Data Processing (Sahara)**)
* ``dataprocessing plugin``: (**Data Processing (Sahara)**)
* ``loadbalancer``: (**Load Balancer (Octavia)**) * ``loadbalancer``: (**Load Balancer (Octavia)**)
* ``loadbalancer healthmonitor``: (**Load Balancer (Octavia)**) * ``loadbalancer healthmonitor``: (**Load Balancer (Octavia)**)
* ``loadbalancer l7policy``: (**Load Balancer (Octavia)**) * ``loadbalancer l7policy``: (**Load Balancer (Octavia)**)
@ -219,13 +217,35 @@ conflicts when creating new plugins. For a complete list check out
* ``ptr record``: (**DNS (Designate)**) * ``ptr record``: (**DNS (Designate)**)
* ``queue``: (**Messaging (Zaqar)**) * ``queue``: (**Messaging (Zaqar)**)
* ``recordset``: (**DNS (Designate)**) * ``recordset``: (**DNS (Designate)**)
* ``rsd``: (**Disaggregated Hardware Resource Management (RSD)**)
* ``search`` (**Search (Searchlight)**)
* ``search facet`` (**Search (Searchlight)**)
* ``search resource type`` (**Search (Searchlight)**)
* ``secret``: (**Key Manager (Barbican)**) * ``secret``: (**Key Manager (Barbican)**)
* ``secret container``: (**Key Manager (Barbican)**) * ``secret container``: (**Key Manager (Barbican)**)
* ``secret order``: (**Key Manager (Barbican)**) * ``secret order``: (**Key Manager (Barbican)**)
* ``share``: (**Share (Manila)**)
* ``share access``: (**Share (Manila)**)
* ``share availability zone``: (**Share (Manila)**)
* ``share backup``: (**Share (Manila)**)
* ``share export location``: (**Share (Manila)**)
* ``share group``: (**Share (Manila)**)
* ``share group snapshot``: (**Share (Manila)**)
* ``share group type``: (**Share (Manila)**)
* ``share instance``: (**Share (Manila)**)
* ``share limits show``: (**Share (Manila)**)
* ``share lock``: (**Share (Manila)**)
* ``share message``: (**Share (Manila)**)
* ``share migration``: (**Share (Manila)**)
* ``share network``: (**Share (Manila)**)
* ``share quota``: (**Share (Manila)**)
* ``share replica``: (**Share (Manila)**)
* ``share security service``: (**Share (Manila)**)
* ``share server``: (**Share (Manila)**)
* ``share server migration``: (**Share (Manila)**)
* ``share service``: (**Share (Manila)**)
* ``share snapshot``: (**Share (Manila)**)
* ``share snapshot access``: (**Share (Manila)**)
* ``share snapshot export location``: (**Share (Manila)**)
* ``share snapshot instance``: (**Share (Manila)**)
* ``share transfer``: (**Share (Manila)**)
* ``share type``: (**Share (Manila)**)
* ``software config``: (**Orchestration (Heat)**) * ``software config``: (**Orchestration (Heat)**)
* ``software deployment``: (**Orchestration (Heat)**) * ``software deployment``: (**Orchestration (Heat)**)
* ``stack event``: (**Orchestration (Heat)**) * ``stack event``: (**Orchestration (Heat)**)
@ -269,7 +289,6 @@ Those actions with an opposite action are noted in parens if applicable.
live server migration if possible live server migration if possible
* ``pause`` (``unpause``) - stop one or more servers and leave them in memory * ``pause`` (``unpause``) - stop one or more servers and leave them in memory
* ``query`` - Query resources by Elasticsearch query string or json format DSL. * ``query`` - Query resources by Elasticsearch query string or json format DSL.
* ``purge`` - clean resources associated with a specific project
* ``cleanup`` - flexible clean resources associated with a specific project * ``cleanup`` - flexible clean resources associated with a specific project
* ``reboot`` - forcibly reboot a server * ``reboot`` - forcibly reboot a server
* ``rebuild`` - rebuild a server using (most of) the same arguments as in the original create * ``rebuild`` - rebuild a server using (most of) the same arguments as in the original create

View file

@ -1,5 +1,12 @@
absolute-limits,limits show --absolute,Lists absolute limits for a user. absolute-limits,limits show --absolute,Lists absolute limits for a user.
api-version,openstack versions show --service volume,Display the server API version information.
availability-zone-list,availability zone list --volume,Lists all availability zones. availability-zone-list,availability zone list --volume,Lists all availability zones.
attachment-complete,volume attachment complete,Complete an attachment for a cinder volume. (Supported by API versions 3.44 - 3.latest)
attachment-create,volume attachment create,Create an attachment for a cinder volume. (Supported by API versions 3.27 - 3.latest)
attachment-delete,volume attachment delete,Delete an attachment for a cinder volume. (Supported by API versions 3.27 - 3.latest)
attachment-list,volume attachment list,Lists all attachments. (Supported by API versions 3.27 - 3.latest)
attachment-show,volume attachment show,Show detailed information for attachment. (Supported by API versions 3.27 - 3.latest)
attachment-update,volume attachment update,Update an attachment for a cinder volume. (Supported by API versions 3.27 - 3.latest)
backup-create,volume backup create,Creates a volume backup. backup-create,volume backup create,Creates a volume backup.
backup-delete,volume backup delete,Removes a backup. backup-delete,volume backup delete,Removes a backup.
backup-export,volume backup record export,Export backup metadata record. backup-export,volume backup record export,Export backup metadata record.
@ -8,10 +15,15 @@ backup-list,volume backup list,Lists all backups.
backup-reset-state,volume backup set --state,Explicitly updates the backup state. backup-reset-state,volume backup set --state,Explicitly updates the backup state.
backup-restore,volume backup restore,Restores a backup. backup-restore,volume backup restore,Restores a backup.
backup-show,volume backup show,Show backup details. backup-show,volume backup show,Show backup details.
backup-update,volume backup set,Updates a backup. (Supported by API versions 3.9 - 3.latest)
cgsnapshot-create,consistency group snapshot create,Creates a cgsnapshot. cgsnapshot-create,consistency group snapshot create,Creates a cgsnapshot.
cgsnapshot-delete,consistency group snapshot delete,Removes one or more cgsnapshots. cgsnapshot-delete,consistency group snapshot delete,Removes one or more cgsnapshots.
cgsnapshot-list,consistency group snapshot list,Lists all cgsnapshots. cgsnapshot-list,consistency group snapshot list,Lists all cgsnapshots.
cgsnapshot-show,consistency group snapshot show,Shows cgsnapshot details. cgsnapshot-show,consistency group snapshot show,Shows cgsnapshot details.
cluster-disable,block storage cluster set --disable,Disables clustered services. (Supported by API versions 3.7 - 3.latest)
cluster-enable,block storage cluster set --enable,Enables clustered services. (Supported by API versions 3.7 - 3.latest)
cluster-list,block storage cluster list,Lists clustered services with optional filtering. (Supported by API versions 3.7 - 3.latest)
cluster-show,block storage cluster show,Show detailed information on a clustered service. (Supported by API versions 3.7 - 3.latest)
consisgroup-create,consistency group create,Creates a consistency group. consisgroup-create,consistency group create,Creates a consistency group.
consisgroup-create-from-src,consistency group create --consistency-group-snapshot,Creates a consistency group from a cgsnapshot or a source CG consisgroup-create-from-src,consistency group create --consistency-group-snapshot,Creates a consistency group from a cgsnapshot or a source CG
consisgroup-delete,consistency group delete,Removes one or more consistency groups. consisgroup-delete,consistency group delete,Removes one or more consistency groups.
@ -19,25 +31,50 @@ consisgroup-list,consistency group list,Lists all consistencygroups.
consisgroup-show,consistency group show,Shows details of a consistency group. consisgroup-show,consistency group show,Shows details of a consistency group.
consisgroup-update,consistency group set,Updates a consistencygroup. consisgroup-update,consistency group set,Updates a consistencygroup.
create,volume create,Creates a volume. create,volume create,Creates a volume.
credentials,WONTFIX,Shows user credentials returned from auth.
delete,volume delete,Removes one or more volumes. delete,volume delete,Removes one or more volumes.
encryption-type-create,volume type create --encryption-provider --enc..,Creates encryption type for a volume type. Admin only. encryption-type-create,volume type create --encryption-provider --enc..,Creates encryption type for a volume type. Admin only.
encryption-type-delete,volume type delete,Deletes encryption type for a volume type. Admin only. encryption-type-delete,volume type delete,Deletes encryption type for a volume type. Admin only.
encryption-type-list,volume type list --encryption-type,Shows encryption type details for volume types. Admin only. encryption-type-list,volume type list --encryption-type,Shows encryption type details for volume types. Admin only.
encryption-type-show,volume type list --encryption-show,Shows encryption type details for volume type. Admin only. encryption-type-show,volume type list --encryption-show,Shows encryption type details for volume type. Admin only.
encryption-type-update,volume type set --encryption-provider --enc..,Update encryption type information for a volume type (Admin Only). encryption-type-update,volume type set --encryption-provider --enc..,Update encryption type information for a volume type (Admin Only).
endpoints,catalog list,Discovers endpoints registered by authentication service.
extend,volume set --size,Attempts to extend size of an existing volume. extend,volume set --size,Attempts to extend size of an existing volume.
extra-specs-list,volume type list --long,Lists current volume types and extra specs. extra-specs-list,volume type list --long,Lists current volume types and extra specs.
failover-host,volume host failover,Failover a replicating cinder-volume host. failover-host,volume host failover,Failover a replicating cinder-volume host.
force-delete,volume delete --force,"Attempts force-delete of volume, regardless of state." force-delete,volume delete --force,"Attempts force-delete of volume regardless of state."
freeze-host,volume host set --disable,Freeze and disable the specified cinder-volume host. freeze-host,volume host set --disable,Freeze and disable the specified cinder-volume host.
get-capabilities,volume backend capability show,Show capabilities of a volume backend. Admin only. get-capabilities,volume backend capability show,Show capabilities of a volume backend. Admin only.
get-pools,volume backend pool list,Show pool information for backends. Admin only. get-pools,volume backend pool list,Show pool information for backends. Admin only.
group-create,volume group create,Creates a group. (Supported by API versions 3.13 - 3.latest)
group-create-from-src,volume group create [--source-group|--group-snapshot],Creates a group from a group snapshot or a source group. (Supported by API versions 3.14 - 3.latest)
group-delete,volume group delete,Removes one or more groups. (Supported by API versions 3.13 - 3.latest)
group-disable-replication,volume group set --disable-replication,Disables replication for group. (Supported by API versions 3.38 - 3.latest)
group-enable-replication,volume group set --enable-replication,Enables replication for group. (Supported by API versions 3.38 - 3.latest)
group-failover-replication,volume group failover,Fails over replication for group. (Supported by API versions 3.38 - 3.latest)
group-list,volume group list,Lists all groups. (Supported by API versions 3.13 - 3.latest)
group-list-replication-targets,volume group list --replication-targets,Lists replication targets for group. (Supported by API versions 3.38 - 3.latest)
group-show,volume group show,Shows details of a group. (Supported by API versions 3.13 - 3.latest)
group-snapshot-create,volume group snapshot create,Creates a group snapshot. (Supported by API versions 3.14 - 3.latest)
group-snapshot-delete,volume group snapshot delete,Removes one or more group snapshots. (Supported by API versions 3.14 - 3.latest)
group-snapshot-list,volume group snapshot list,Lists all group snapshots. (Supported by API versions 3.14 - 3.latest)
group-snapshot-show,volume group snapshot show,Shows group snapshot details. (Supported by API versions 3.14 - 3.latest)
group-specs-list,volume group type list,Lists current group types and specs. (Supported by API versions 3.11 - 3.latest)
group-type-create,volume group type create,Creates a group type. (Supported by API versions 3.11 - 3.latest)
group-type-default,volume group type list --default,List the default group type. (Supported by API versions 3.11 - 3.latest)
group-type-delete,volume group type delete,Deletes group type or types. (Supported by API versions 3.11 - 3.latest)
group-type-key,volume group type set,Sets or unsets group_spec for a group type. (Supported by API versions 3.11 - 3.latest)
group-type-list,volume group type set,Lists available 'group types'. (Admin only will see private types) (Supported by API versions 3.11 - 3.latest)
group-type-show,volume group type show,Show group type details. (Supported by API versions 3.11 - 3.latest)
group-type-update,volume group type set,Updates group type name description and/or is_public. (Supported by API versions 3.11 - 3.latest)
group-update,volume group set,Updates a group. (Supported by API versions 3.13 - 3.latest)
image-metadata,volume set --image-property,Sets or deletes volume image metadata. image-metadata,volume set --image-property,Sets or deletes volume image metadata.
image-metadata-show,volume show,Shows volume image metadata. image-metadata-show,volume show,Shows volume image metadata.
list,volume list,Lists all volumes. list,volume list,Lists all volumes.
list-filters,block storage resource filter list,List enabled filters. (Supported by API versions 3.33 - 3.latest)
manage,volume create --remote-source k=v,Manage an existing volume. manage,volume create --remote-source k=v,Manage an existing volume.
manageable-list,block storage volume manageable list,Lists all manageable volumes. (Supported by API versions 3.8 - 3.latest)
message-delete,volume message delete,Removes one or more messages. (Supported by API versions 3.3 - 3.latest)
message-list,volume message list,Lists all messages. (Supported by API versions 3.3 - 3.latest)
message-show,volume message show,Shows message details. (Supported by API versions 3.3 - 3.latest)
metadata,volume set --property k=v / volume unset --property k,Sets or deletes volume metadata. metadata,volume set --property k=v / volume unset --property k,Sets or deletes volume metadata.
metadata-show,volume show,Shows volume metadata. metadata-show,volume show,Shows volume metadata.
metadata-update-all,volume set --property k=v,Updates volume metadata. metadata-update-all,volume set --property k=v,Updates volume metadata.
@ -54,33 +91,36 @@ qos-show,volume qos show,Shows a specified qos specs.
quota-class-show,quota show --class,Lists quotas for a quota class. quota-class-show,quota show --class,Lists quotas for a quota class.
quota-class-update,quota set --class,Updates quotas for a quota class. quota-class-update,quota set --class,Updates quotas for a quota class.
quota-defaults,quota show --default,Lists default quotas for a tenant. quota-defaults,quota show --default,Lists default quotas for a tenant.
quota-delete,,Delete the quotas for a tenant. quota-delete,quota delete --volume,Delete the quotas for a tenant.
quota-show,quota show,Lists quotas for a tenant. quota-show,quota show,Lists quotas for a tenant.
quota-update,quota set,Updates quotas for a tenant. quota-update,quota set,Updates quotas for a tenant.
quota-usage,,Lists quota usage for a tenant. quota-usage,quota show --usage,Lists quota usage for a tenant.
rate-limits,limits show --rate,Lists rate limits for a user. rate-limits,limits show --rate,Lists rate limits for a user.
readonly-mode-update,volume set --read-only-mode | --read-write-mode,Updates volume read-only access-mode flag. readonly-mode-update,volume set --read-only-mode | --read-write-mode,Updates volume read-only access-mode flag.
rename,volume set --name,Renames a volume. rename,volume set --name,Renames a volume.
replication-promote,WONTFIX,Promote a secondary volume to primary for a relationship
replication-reenable,WONTFIX,Sync the secondary volume with primary for a relationship
reset-state,volume set --state,Explicitly updates the volume state. reset-state,volume set --state,Explicitly updates the volume state.
retype,volume type set --type,Changes the volume type for a volume. retype,volume type set --type,Changes the volume type for a volume.
revert-to-snapshot,volume revert,Revert a volume to the specified snapshot. (Supported by API versions 3.40 - 3.latest)
service-disable,volume service set --disable,Disables the service. service-disable,volume service set --disable,Disables the service.
service-enable,volume service set --enable,Enables the service. service-enable,volume service set --enable,Enables the service.
service-get-log,block storage log level list,(Supported by API versions 3.32 - 3.latest)
service-list,volume service list,Lists all services. Filter by host and service binary. service-list,volume service list,Lists all services. Filter by host and service binary.
service-set-log,block storage log level set,(Supported by API versions 3.32 - 3.latest)
set-bootable,volume set --bootable / --not-bootable,Update bootable status of a volume. set-bootable,volume set --bootable / --not-bootable,Update bootable status of a volume.
show,volume show,Shows volume details. show,volume show,Shows volume details.
snapshot-create,snapshot create,Creates a snapshot. snapshot-create,volume snapshot create,Creates a snapshot.
snapshot-delete,snapshot delete,Remove one or more snapshots. snapshot-delete,volume snapshot delete,Remove one or more snapshots.
snapshot-list,snapshot list,Lists all snapshots. snapshot-list,volume snapshot list,Lists all snapshots.
snapshot-manage,volume snapshot create --remote-source <key=value>,Manage an existing snapshot. snapshot-manage,volume snapshot create --remote-source <key=value>,Manage an existing snapshot.
snapshot-metadata,snapshot set --property k=v / snapshot unset --property k,Sets or deletes snapshot metadata. snapshot-manageable-list,block storage snapshot manageable list,Lists all manageable snapshots. (Supported by API versions 3.8 - 3.latest)
snapshot-metadata-show,snapshot show,Shows snapshot metadata. snapshot-metadata,volume snapshot set --property k=v / snapshot unset --property k,Sets or deletes snapshot metadata.
snapshot-metadata-update-all,snapshot set --property k=v,Updates snapshot metadata. snapshot-metadata-show,volume snapshot show,Shows snapshot metadata.
snapshot-rename,snapshot set --name,Renames a snapshot. snapshot-metadata-update-all,volume snapshot set --property k=v,Updates snapshot metadata.
snapshot-reset-state,snapshot set --state,Explicitly updates the snapshot state. snapshot-rename,volume snapshot set --name,Renames a snapshot.
snapshot-show,snapshot show,Shows snapshot details. snapshot-reset-state,volume snapshot set --state,Explicitly updates the snapshot state.
snapshot-show,volume snapshot show,Shows snapshot details.
snapshot-unmanage,volume snapshot delete --remote,Stop managing a snapshot. snapshot-unmanage,volume snapshot delete --remote,Stop managing a snapshot.
summary,volume summary,Get volumes summary. (Supported by API versions 3.12 - 3.latest)
thaw-host,volume host set --enable,Thaw and enable the specified cinder-volume host. thaw-host,volume host set --enable,Thaw and enable the specified cinder-volume host.
transfer-accept,volume transfer accept,Accepts a volume transfer. transfer-accept,volume transfer accept,Accepts a volume transfer.
transfer-create,volume transfer create,Creates a volume transfer. transfer-create,volume transfer create,Creates a volume transfer.
@ -96,9 +136,11 @@ type-delete,volume type delete,Deletes a specified volume type.
type-key,volume type set --property k=v / volume type unset --property k,Sets or unsets extra_spec for a volume type. type-key,volume type set --property k=v / volume type unset --property k,Sets or unsets extra_spec for a volume type.
type-list,volume type list,Lists available 'volume types'. type-list,volume type list,Lists available 'volume types'.
type-show,volume type show,Show volume type details. type-show,volume type show,Show volume type details.
type-update,volume type set,"Updates volume type name, description, and/or is_public." type-update,volume type set,"Updates volume type name description and/or is_public."
unmanage,volume delete --remote,Stop managing a volume. unmanage,volume delete --remote,Stop managing a volume.
upload-to-image,image create --volume,Uploads volume to Image Service as an image. upload-to-image,image create --volume,Uploads volume to Image Service as an image.
version-list,versions show --service block-storage,List all API versions. (Supported by API versions 3.0 - 3.latest)
work-cleanup,block storage cleanup,Request cleanup of services with optional filtering. (Supported by API versions 3.24 - 3.latest)
bash-completion,complete,Prints arguments for bash_completion. bash-completion,complete,Prints arguments for bash_completion.
help,help,Shows help about this program or one of its subcommands. help,help,Shows help about this program or one of its subcommands.
list-extensions,extension list --volume,Lists all available os-api extensions. list-extensions,extension list --volume,Lists all available os-api extensions.

1 absolute-limits limits show --absolute Lists absolute limits for a user.
2 api-version openstack versions show --service volume Display the server API version information.
3 availability-zone-list availability zone list --volume Lists all availability zones.
4 attachment-complete volume attachment complete Complete an attachment for a cinder volume. (Supported by API versions 3.44 - 3.latest)
5 attachment-create volume attachment create Create an attachment for a cinder volume. (Supported by API versions 3.27 - 3.latest)
6 attachment-delete volume attachment delete Delete an attachment for a cinder volume. (Supported by API versions 3.27 - 3.latest)
7 attachment-list volume attachment list Lists all attachments. (Supported by API versions 3.27 - 3.latest)
8 attachment-show volume attachment show Show detailed information for attachment. (Supported by API versions 3.27 - 3.latest)
9 attachment-update volume attachment update Update an attachment for a cinder volume. (Supported by API versions 3.27 - 3.latest)
10 backup-create volume backup create Creates a volume backup.
11 backup-delete volume backup delete Removes a backup.
12 backup-export volume backup record export Export backup metadata record.
15 backup-reset-state volume backup set --state Explicitly updates the backup state.
16 backup-restore volume backup restore Restores a backup.
17 backup-show volume backup show Show backup details.
18 backup-update volume backup set Updates a backup. (Supported by API versions 3.9 - 3.latest)
19 cgsnapshot-create consistency group snapshot create Creates a cgsnapshot.
20 cgsnapshot-delete consistency group snapshot delete Removes one or more cgsnapshots.
21 cgsnapshot-list consistency group snapshot list Lists all cgsnapshots.
22 cgsnapshot-show consistency group snapshot show Shows cgsnapshot details.
23 cluster-disable block storage cluster set --disable Disables clustered services. (Supported by API versions 3.7 - 3.latest)
24 cluster-enable block storage cluster set --enable Enables clustered services. (Supported by API versions 3.7 - 3.latest)
25 cluster-list block storage cluster list Lists clustered services with optional filtering. (Supported by API versions 3.7 - 3.latest)
26 cluster-show block storage cluster show Show detailed information on a clustered service. (Supported by API versions 3.7 - 3.latest)
27 consisgroup-create consistency group create Creates a consistency group.
28 consisgroup-create-from-src consistency group create --consistency-group-snapshot Creates a consistency group from a cgsnapshot or a source CG
29 consisgroup-delete consistency group delete Removes one or more consistency groups.
31 consisgroup-show consistency group show Shows details of a consistency group.
32 consisgroup-update consistency group set Updates a consistencygroup.
33 create volume create Creates a volume.
credentials WONTFIX Shows user credentials returned from auth.
34 delete volume delete Removes one or more volumes.
35 encryption-type-create volume type create --encryption-provider --enc.. Creates encryption type for a volume type. Admin only.
36 encryption-type-delete volume type delete Deletes encryption type for a volume type. Admin only.
37 encryption-type-list volume type list --encryption-type Shows encryption type details for volume types. Admin only.
38 encryption-type-show volume type list --encryption-show Shows encryption type details for volume type. Admin only.
39 encryption-type-update volume type set --encryption-provider --enc.. Update encryption type information for a volume type (Admin Only).
endpoints catalog list Discovers endpoints registered by authentication service.
40 extend volume set --size Attempts to extend size of an existing volume.
41 extra-specs-list volume type list --long Lists current volume types and extra specs.
42 failover-host volume host failover Failover a replicating cinder-volume host.
43 force-delete volume delete --force Attempts force-delete of volume, regardless of state. Attempts force-delete of volume regardless of state.
44 freeze-host volume host set --disable Freeze and disable the specified cinder-volume host.
45 get-capabilities volume backend capability show Show capabilities of a volume backend. Admin only.
46 get-pools volume backend pool list Show pool information for backends. Admin only.
47 group-create volume group create Creates a group. (Supported by API versions 3.13 - 3.latest)
48 group-create-from-src volume group create [--source-group|--group-snapshot] Creates a group from a group snapshot or a source group. (Supported by API versions 3.14 - 3.latest)
49 group-delete volume group delete Removes one or more groups. (Supported by API versions 3.13 - 3.latest)
50 group-disable-replication volume group set --disable-replication Disables replication for group. (Supported by API versions 3.38 - 3.latest)
51 group-enable-replication volume group set --enable-replication Enables replication for group. (Supported by API versions 3.38 - 3.latest)
52 group-failover-replication volume group failover Fails over replication for group. (Supported by API versions 3.38 - 3.latest)
53 group-list volume group list Lists all groups. (Supported by API versions 3.13 - 3.latest)
54 group-list-replication-targets volume group list --replication-targets Lists replication targets for group. (Supported by API versions 3.38 - 3.latest)
55 group-show volume group show Shows details of a group. (Supported by API versions 3.13 - 3.latest)
56 group-snapshot-create volume group snapshot create Creates a group snapshot. (Supported by API versions 3.14 - 3.latest)
57 group-snapshot-delete volume group snapshot delete Removes one or more group snapshots. (Supported by API versions 3.14 - 3.latest)
58 group-snapshot-list volume group snapshot list Lists all group snapshots. (Supported by API versions 3.14 - 3.latest)
59 group-snapshot-show volume group snapshot show Shows group snapshot details. (Supported by API versions 3.14 - 3.latest)
60 group-specs-list volume group type list Lists current group types and specs. (Supported by API versions 3.11 - 3.latest)
61 group-type-create volume group type create Creates a group type. (Supported by API versions 3.11 - 3.latest)
62 group-type-default volume group type list --default List the default group type. (Supported by API versions 3.11 - 3.latest)
63 group-type-delete volume group type delete Deletes group type or types. (Supported by API versions 3.11 - 3.latest)
64 group-type-key volume group type set Sets or unsets group_spec for a group type. (Supported by API versions 3.11 - 3.latest)
65 group-type-list volume group type set Lists available 'group types'. (Admin only will see private types) (Supported by API versions 3.11 - 3.latest)
66 group-type-show volume group type show Show group type details. (Supported by API versions 3.11 - 3.latest)
67 group-type-update volume group type set Updates group type name description and/or is_public. (Supported by API versions 3.11 - 3.latest)
68 group-update volume group set Updates a group. (Supported by API versions 3.13 - 3.latest)
69 image-metadata volume set --image-property Sets or deletes volume image metadata.
70 image-metadata-show volume show Shows volume image metadata.
71 list volume list Lists all volumes.
72 list-filters block storage resource filter list List enabled filters. (Supported by API versions 3.33 - 3.latest)
73 manage volume create --remote-source k=v Manage an existing volume.
74 manageable-list block storage volume manageable list Lists all manageable volumes. (Supported by API versions 3.8 - 3.latest)
75 message-delete volume message delete Removes one or more messages. (Supported by API versions 3.3 - 3.latest)
76 message-list volume message list Lists all messages. (Supported by API versions 3.3 - 3.latest)
77 message-show volume message show Shows message details. (Supported by API versions 3.3 - 3.latest)
78 metadata volume set --property k=v / volume unset --property k Sets or deletes volume metadata.
79 metadata-show volume show Shows volume metadata.
80 metadata-update-all volume set --property k=v Updates volume metadata.
91 quota-class-show quota show --class Lists quotas for a quota class.
92 quota-class-update quota set --class Updates quotas for a quota class.
93 quota-defaults quota show --default Lists default quotas for a tenant.
94 quota-delete quota delete --volume Delete the quotas for a tenant.
95 quota-show quota show Lists quotas for a tenant.
96 quota-update quota set Updates quotas for a tenant.
97 quota-usage quota show --usage Lists quota usage for a tenant.
98 rate-limits limits show --rate Lists rate limits for a user.
99 readonly-mode-update volume set --read-only-mode | --read-write-mode Updates volume read-only access-mode flag.
100 rename volume set --name Renames a volume.
replication-promote WONTFIX Promote a secondary volume to primary for a relationship
replication-reenable WONTFIX Sync the secondary volume with primary for a relationship
101 reset-state volume set --state Explicitly updates the volume state.
102 retype volume type set --type Changes the volume type for a volume.
103 revert-to-snapshot volume revert Revert a volume to the specified snapshot. (Supported by API versions 3.40 - 3.latest)
104 service-disable volume service set --disable Disables the service.
105 service-enable volume service set --enable Enables the service.
106 service-get-log block storage log level list (Supported by API versions 3.32 - 3.latest)
107 service-list volume service list Lists all services. Filter by host and service binary.
108 service-set-log block storage log level set (Supported by API versions 3.32 - 3.latest)
109 set-bootable volume set --bootable / --not-bootable Update bootable status of a volume.
110 show volume show Shows volume details.
111 snapshot-create snapshot create volume snapshot create Creates a snapshot.
112 snapshot-delete snapshot delete volume snapshot delete Remove one or more snapshots.
113 snapshot-list snapshot list volume snapshot list Lists all snapshots.
114 snapshot-manage volume snapshot create --remote-source <key=value> Manage an existing snapshot.
115 snapshot-metadata snapshot-manageable-list snapshot set --property k=v / snapshot unset --property k block storage snapshot manageable list Sets or deletes snapshot metadata. Lists all manageable snapshots. (Supported by API versions 3.8 - 3.latest)
116 snapshot-metadata-show snapshot-metadata snapshot show volume snapshot set --property k=v / snapshot unset --property k Shows snapshot metadata. Sets or deletes snapshot metadata.
117 snapshot-metadata-update-all snapshot-metadata-show snapshot set --property k=v volume snapshot show Updates snapshot metadata. Shows snapshot metadata.
118 snapshot-rename snapshot-metadata-update-all snapshot set --name volume snapshot set --property k=v Renames a snapshot. Updates snapshot metadata.
119 snapshot-reset-state snapshot-rename snapshot set --state volume snapshot set --name Explicitly updates the snapshot state. Renames a snapshot.
120 snapshot-show snapshot-reset-state snapshot show volume snapshot set --state Shows snapshot details. Explicitly updates the snapshot state.
121 snapshot-show volume snapshot show Shows snapshot details.
122 snapshot-unmanage volume snapshot delete --remote Stop managing a snapshot.
123 summary volume summary Get volumes summary. (Supported by API versions 3.12 - 3.latest)
124 thaw-host volume host set --enable Thaw and enable the specified cinder-volume host.
125 transfer-accept volume transfer accept Accepts a volume transfer.
126 transfer-create volume transfer create Creates a volume transfer.
136 type-key volume type set --property k=v / volume type unset --property k Sets or unsets extra_spec for a volume type.
137 type-list volume type list Lists available 'volume types'.
138 type-show volume type show Show volume type details.
139 type-update volume type set Updates volume type name, description, and/or is_public. Updates volume type name description and/or is_public.
140 unmanage volume delete --remote Stop managing a volume.
141 upload-to-image image create --volume Uploads volume to Image Service as an image.
142 version-list versions show --service block-storage List all API versions. (Supported by API versions 3.0 - 3.latest)
143 work-cleanup block storage cleanup Request cleanup of services with optional filtering. (Supported by API versions 3.24 - 3.latest)
144 bash-completion complete Prints arguments for bash_completion.
145 help help Shows help about this program or one of its subcommands.
146 list-extensions extension list --volume Lists all available os-api extensions.

View file

@ -1,24 +1,67 @@
cache-clear,cached image clear,"Clear all images from cache, queue or both."
cache-delete,cached image delete,Delete image from cache/caching queue.
cache-list,cached image list,Get cache state.
cache-queue,cached image queue,Queue image(s) for caching.
explain,WONTFIX,Describe a specific model. explain,WONTFIX,Describe a specific model.
image-create,image create,Create a new image. image-create,image create,Create a new image.
image-create-via-import, image create --import,"EXPERIMENTAL: Create a new image via image import using glance-direct import method. Missing support for web-download, copy-image and glance-download import methods. The OSC command is also missing support for importing image to specified store as well as all stores (--store, --stores, --all-stores) and skip or stop processing if import fails to one of the store (--allow-failure)"
image-deactivate,image set --deactivate,Deactivate specified image. image-deactivate,image set --deactivate,Deactivate specified image.
image-delete,image delete,Delete specified image. image-delete,image delete,Delete specified image.
image-download,image save,Download a specific image. image-download,image save,Download a specific image.
image-import,image import,Initiate the image import taskflow.
image-list,image list,List images you can access. image-list,image list,List images you can access.
image-reactivate,image set --activate,Reactivate specified image. image-reactivate,image set --activate,Reactivate specified image.
image-show,image show,Describe a specific image. image-show,image show,Describe a specific image.
image-stage,image stage,Upload data for a specific image to staging.
image-tag-delete,image unset --tag <tag>,Delete the tag associated with the given image. image-tag-delete,image unset --tag <tag>,Delete the tag associated with the given image.
image-tag-update,image set --tag <tag>,Update an image with the given tag. image-tag-update,image set --tag <tag>,Update an image with the given tag.
image-tasks,,Get tasks associated with image.
image-update,image set,Update an existing image. image-update,image set,Update an existing image.
image-upload,,Upload data for a specific image. image-upload,,Upload data for a specific image.
import-info,image import info,Show available import methods from Glance.
location-add,,Add a location (and related metadata) to an image. location-add,,Add a location (and related metadata) to an image.
location-delete,,Remove locations (and related metadata) from an image. location-delete,,Remove locations (and related metadata) from an image.
location-update,,Update metadata of an image's location. location-update,,Update metadata of an image's location.
md-namespace-create,image metadef namespace create,Create a new metadata definitions namespace.
md-namespace-delete,image metadef namespace delete,Delete specified metadata definitions namespace with its contents.
md-namespace-import,WONTFIX,Import a metadata definitions namespace from file or standard input.
md-namespace-list,image metadef namespace list,List metadata definitions namespaces.
md-namespace-objects-delete,image metadef object delete,Delete all metadata definitions objects inside a specific namespace.
md-namespace-properties-delete,image metadef property delete,Delete all metadata definitions property inside a specific namespace.
md-namespace-resource-type-list,image metadef resource type association list,List resource types associated to specific namespace.
md-namespace-show,image metadef namespace show,Describe a specific metadata definitions namespace.
md-namespace-tags-delete,,Delete all metadata definitions tags inside a specific namespace.
md-namespace-update,,Update an existing metadata definitions namespace.
md-object-create,image metadef object create,Create a new metadata definitions object inside a namespace.
md-object-show,image metadef object show,Describe a specific metadata definitions object inside a namespace.
md-object-list,image metadef object list,List metadata definitions objects inside a specific namespace.
md-object-delete,image metadef object delete,Delete a specific metadata definitions object inside a namespace.
md-object-property-show,image metadef object property show,Describe a specific metadata definitions property inside an object.
md-object-update,image metadef object update,Update metadata definitions object inside a namespace.
md-property-create,image metadef property create,Create a new metadata definitions property inside a namespace.
md-property-delete,image metadef property delete,Delete a specific metadata definitions property inside a namespace.
md-property-list,image metadef property list,List metadata definitions properties inside a specific namespace.
md-property-show,image metadef property show,Describe a specific metadata definitions property inside a namespace.
md-property-update,image metadef property set,Update metadata definitions property inside a namespace.
md-resource-type-associate,image metadef resource type association create,Associate resource type with a metadata definitions namespace.
md-resource-type-deassociate,image metadef resource type association delete,Deassociate resource type with a metadata definitions namespace.
md-resource-type-list,image metadef resource type list,List available resource type names.
md-tag-create,,Add a new metadata definitions tag inside a namespace.
md-tag-create-multiple,,Create new metadata definitions tags inside a namespace.
md-tag-delete,,Delete a specific metadata definitions tag inside a namespace.
md-tag-list,,List metadata definitions tags inside a specific namespace.
md-tag-show,,Describe a specific metadata definitions tag inside a namespace.
md-tag-update,,Rename a metadata definitions tag inside a namespace.
member-create,image add project,Create member for a given image. member-create,image add project,Create member for a given image.
member-delete,image remove project,Delete image member. member-delete,image remove project,Delete image member.
member-list,,Describe sharing permissions by image. member-get,image member get,Show details of an image member
member-list,image member list,Describe sharing permissions by image.
member-update,image set --accept --reject --status,Update the status of a member for a given image. member-update,image set --accept --reject --status,Update the status of a member for a given image.
task-create,,Create a new task. stores-delete,image delete --store,Delete image from specific store.
task-list,,List tasks you can access. stores-info,,Print available backends from Glance.
task-show,,Describe a specific task. task-create,WONTFIX,Create a new task.
task-list,image task list,List tasks you can access.
task-show,image task show,Describe a specific task.
usage,,Get quota usage information.
bash-completion,complete,Prints arguments for bash_completion. bash-completion,complete,Prints arguments for bash_completion.
help,help,Display help about this program or one of its subcommands. help,help,Display help about this program or one of its subcommands.

1 explain cache-clear WONTFIX cached image clear Describe a specific model. Clear all images from cache, queue or both.
1 cache-clear cached image clear Clear all images from cache, queue or both.
2 cache-delete cached image delete Delete image from cache/caching queue.
3 cache-list cached image list Get cache state.
4 cache-queue cached image queue Queue image(s) for caching.
5 explain explain WONTFIX WONTFIX Describe a specific model. Describe a specific model.
6 image-create image-create image create image create Create a new image. Create a new image.
7 image-create-via-import image create --import EXPERIMENTAL: Create a new image via image import using glance-direct import method. Missing support for web-download, copy-image and glance-download import methods. The OSC command is also missing support for importing image to specified store as well as all stores (--store, --stores, --all-stores) and skip or stop processing if import fails to one of the store (--allow-failure)
8 image-deactivate image-deactivate image set --deactivate image set --deactivate Deactivate specified image. Deactivate specified image.
9 image-delete image-delete image delete image delete Delete specified image. Delete specified image.
10 image-download image-download image save image save Download a specific image. Download a specific image.
11 image-import image import Initiate the image import taskflow.
12 image-list image-list image list image list List images you can access. List images you can access.
13 image-reactivate image-reactivate image set --activate image set --activate Reactivate specified image. Reactivate specified image.
14 image-show image-show image show image show Describe a specific image. Describe a specific image.
15 image-stage image stage Upload data for a specific image to staging.
16 image-tag-delete image-tag-delete image unset --tag <tag> image unset --tag <tag> Delete the tag associated with the given image. Delete the tag associated with the given image.
17 image-tag-update image-tag-update image set --tag <tag> image set --tag <tag> Update an image with the given tag. Update an image with the given tag.
18 image-tasks Get tasks associated with image.
19 image-update image-update image set image set Update an existing image. Update an existing image.
20 image-upload image-upload Upload data for a specific image. Upload data for a specific image.
21 import-info image import info Show available import methods from Glance.
22 location-add location-add Add a location (and related metadata) to an image. Add a location (and related metadata) to an image.
23 location-delete location-delete Remove locations (and related metadata) from an image. Remove locations (and related metadata) from an image.
24 location-update location-update Update metadata of an image's location. Update metadata of an image's location.
25 md-namespace-create image metadef namespace create Create a new metadata definitions namespace.
26 md-namespace-delete image metadef namespace delete Delete specified metadata definitions namespace with its contents.
27 md-namespace-import WONTFIX Import a metadata definitions namespace from file or standard input.
28 md-namespace-list image metadef namespace list List metadata definitions namespaces.
29 md-namespace-objects-delete image metadef object delete Delete all metadata definitions objects inside a specific namespace.
30 md-namespace-properties-delete image metadef property delete Delete all metadata definitions property inside a specific namespace.
31 md-namespace-resource-type-list image metadef resource type association list List resource types associated to specific namespace.
32 md-namespace-show image metadef namespace show Describe a specific metadata definitions namespace.
33 md-namespace-tags-delete Delete all metadata definitions tags inside a specific namespace.
34 md-namespace-update Update an existing metadata definitions namespace.
35 md-object-create image metadef object create Create a new metadata definitions object inside a namespace.
36 md-object-show image metadef object show Describe a specific metadata definitions object inside a namespace.
37 md-object-list image metadef object list List metadata definitions objects inside a specific namespace.
38 md-object-delete image metadef object delete Delete a specific metadata definitions object inside a namespace.
39 md-object-property-show image metadef object property show Describe a specific metadata definitions property inside an object.
40 md-object-update image metadef object update Update metadata definitions object inside a namespace.
41 md-property-create image metadef property create Create a new metadata definitions property inside a namespace.
42 md-property-delete image metadef property delete Delete a specific metadata definitions property inside a namespace.
43 md-property-list image metadef property list List metadata definitions properties inside a specific namespace.
44 md-property-show image metadef property show Describe a specific metadata definitions property inside a namespace.
45 md-property-update image metadef property set Update metadata definitions property inside a namespace.
46 md-resource-type-associate image metadef resource type association create Associate resource type with a metadata definitions namespace.
47 md-resource-type-deassociate image metadef resource type association delete Deassociate resource type with a metadata definitions namespace.
48 md-resource-type-list image metadef resource type list List available resource type names.
49 md-tag-create Add a new metadata definitions tag inside a namespace.
50 md-tag-create-multiple Create new metadata definitions tags inside a namespace.
51 md-tag-delete Delete a specific metadata definitions tag inside a namespace.
52 md-tag-list List metadata definitions tags inside a specific namespace.
53 md-tag-show Describe a specific metadata definitions tag inside a namespace.
54 md-tag-update Rename a metadata definitions tag inside a namespace.
55 member-create member-create image add project image add project Create member for a given image. Create member for a given image.
56 member-delete member-delete image remove project image remove project Delete image member. Delete image member.
57 member-list member-get image member get Describe sharing permissions by image. Show details of an image member
58 member-list image member list Describe sharing permissions by image.
59 member-update member-update image set --accept --reject --status image set --accept --reject --status Update the status of a member for a given image. Update the status of a member for a given image.
60 task-create stores-delete image delete --store Create a new task. Delete image from specific store.
61 task-list stores-info List tasks you can access. Print available backends from Glance.
62 task-show task-create WONTFIX Describe a specific task. Create a new task.
63 task-list image task list List tasks you can access.
64 task-show image task show Describe a specific task.
65 usage Get quota usage information.
66 bash-completion bash-completion complete complete Prints arguments for bash_completion. Prints arguments for bash_completion.
67 help help help help Display help about this program or one of its subcommands. Display help about this program or one of its subcommands.

View file

@ -35,6 +35,23 @@ dhcp-agent-network-add,network agent add network,Add a network to a DHCP agent.
dhcp-agent-network-remove,network agent remove network,Remove a network from a DHCP agent. dhcp-agent-network-remove,network agent remove network,Remove a network from a DHCP agent.
ext-list,extension list,List all extensions. ext-list,extension list,List all extensions.
ext-show,extension show,Show information of a given resource. ext-show,extension show,Show information of a given resource.
firewall-create,,Create a firewall.
firewall-delete,,Delete a given firewall.
firewall-list,,List firewalls that belong to a given tenant.
firewall-policy-create,,Create a firewall policy.
firewall-policy-delete,,Delete a given firewall policy.
firewall-policy-insert-rule,,Insert a rule into a given firewall policy.
firewall-policy-list,,List firewall policies that belong to a given tenant.
firewall-policy-remove-rule,,Remove a rule from a given firewall policy.
firewall-policy-show,,Show information of a given firewall policy.
firewall-policy-update,,Update a given firewall policy.
firewall-rule-create,,Create a firewall rule.
firewall-rule-delete,,Delete a given firewall rule.
firewall-rule-list,,List firewall rules that belong to a given tenant.
firewall-rule-show,,Show information of a given firewall rule.
firewall-rule-update,,Update a given firewall rule.
firewall-show,,Show information of a given firewall.
firewall-update,,Update a given firewall.
flavor-associate,network flavor add profile,Add a Neutron service flavor with a flavor profile. flavor-associate,network flavor add profile,Add a Neutron service flavor with a flavor profile.
flavor-create,network flavor create,Create a Neutron service flavor. flavor-create,network flavor create,Create a Neutron service flavor.
flavor-delete,network flavor delete,Delete a given Neutron service flavor. flavor-delete,network flavor delete,Delete a given Neutron service flavor.
@ -171,7 +188,7 @@ qos-policy-list,network qos policy list,List QoS policies that belong to a given
qos-policy-show,network qos policy show,Show information of a given qos policy. qos-policy-show,network qos policy show,Show information of a given qos policy.
qos-policy-update,network qos policy set,Update a given qos policy. qos-policy-update,network qos policy set,Update a given qos policy.
quota-default-show,quota show --default,Show default quotas for a given tenant. quota-default-show,quota show --default,Show default quotas for a given tenant.
quota-delete,,Delete defined quotas of a given tenant. quota-delete,quota delete --network,Delete defined quotas of a given tenant.
quota-list,quota list,List quotas of all tenants who have non-default quota values. quota-list,quota list,List quotas of all tenants who have non-default quota values.
quota-show,quota show,Show quotas for a given tenant. quota-show,quota show,Show quotas for a given tenant.
quota-update,quota set,Define tenant's quotas not to use defaults. quota-update,quota set,Define tenant's quotas not to use defaults.
@ -213,15 +230,7 @@ subnetpool-show,subnet pool show,Show information of a given subnetpool.
subnetpool-update,subnet pool set / subnet pool unset,Update subnetpool's information. subnetpool-update,subnet pool set / subnet pool unset,Update subnetpool's information.
tag-add,network set --tag,Add a tag into the resource. tag-add,network set --tag,Add a tag into the resource.
tag-remove,network unset --tag,Remove a tag on the resource. tag-remove,network unset --tag,Remove a tag on the resource.
tag-replace,,Replace all tags on the resource. tag-replace,network set --no-tag --tag,Replace all tags on the resource.
tap-flow-create,tapflow create,Create a tap flow
tap-flow-delete,tapflow delete,Delete a tap flow
tap-flow-list,tapflow list,List all tap flows
tap-flow-show,tapflow show,Show details of the tap flow
tap-service-create,tapservice create,Create a tap service
tap-service-delete,tapservice delete,Delete a tap service
tap-service-list,tapservice list,List all tap services
tap-service-show,tapservice show,Show details of the tap service
vpn-endpoint-group-create,,Create a VPN endpoint group. vpn-endpoint-group-create,,Create a VPN endpoint group.
vpn-endpoint-group-delete,,Delete a given VPN endpoint group. vpn-endpoint-group-delete,,Delete a given VPN endpoint group.
vpn-endpoint-group-list,,List VPN endpoint groups that belong to a given tenant. vpn-endpoint-group-list,,List VPN endpoint groups that belong to a given tenant.
@ -242,3 +251,12 @@ vpn-service-delete,,Delete a given VPN service.
vpn-service-list,,List VPN service configurations that belong to a given tenant. vpn-service-list,,List VPN service configurations that belong to a given tenant.
vpn-service-show,,Show information of a given VPN service. vpn-service-show,,Show information of a given VPN service.
vpn-service-update,,Update a given VPN service. vpn-service-update,,Update a given VPN service.
tap-flow-create,tapflow create,Create a tap flow
tap-flow-delete,tapflow delete,Delete a tap flow
tap-flow-list,tapflow list,List all tap flows
tap-flow-show,tapflow show,Show details of the tap flow
tap-service-create,tapservice create,Create a tap service
tap-service-delete,tapservice delete,Delete a tap service
tap-service-list,tapservice list,List all tap services
tap-service-show,tapservice show,Show details of the tap service

1 address-scope-create address scope create Create an address scope for a given tenant.
35 dhcp-agent-network-remove network agent remove network Remove a network from a DHCP agent.
36 ext-list extension list List all extensions.
37 ext-show extension show Show information of a given resource.
38 firewall-create Create a firewall.
39 firewall-delete Delete a given firewall.
40 firewall-list List firewalls that belong to a given tenant.
41 firewall-policy-create Create a firewall policy.
42 firewall-policy-delete Delete a given firewall policy.
43 firewall-policy-insert-rule Insert a rule into a given firewall policy.
44 firewall-policy-list List firewall policies that belong to a given tenant.
45 firewall-policy-remove-rule Remove a rule from a given firewall policy.
46 firewall-policy-show Show information of a given firewall policy.
47 firewall-policy-update Update a given firewall policy.
48 firewall-rule-create Create a firewall rule.
49 firewall-rule-delete Delete a given firewall rule.
50 firewall-rule-list List firewall rules that belong to a given tenant.
51 firewall-rule-show Show information of a given firewall rule.
52 firewall-rule-update Update a given firewall rule.
53 firewall-show Show information of a given firewall.
54 firewall-update Update a given firewall.
55 flavor-associate network flavor add profile Add a Neutron service flavor with a flavor profile.
56 flavor-create network flavor create Create a Neutron service flavor.
57 flavor-delete network flavor delete Delete a given Neutron service flavor.
188 qos-policy-show network qos policy show Show information of a given qos policy.
189 qos-policy-update network qos policy set Update a given qos policy.
190 quota-default-show quota show --default Show default quotas for a given tenant.
191 quota-delete quota delete --network Delete defined quotas of a given tenant.
192 quota-list quota list List quotas of all tenants who have non-default quota values.
193 quota-show quota show Show quotas for a given tenant.
194 quota-update quota set Define tenant's quotas not to use defaults.
230 subnetpool-update subnet pool set / subnet pool unset Update subnetpool's information.
231 tag-add network set --tag Add a tag into the resource.
232 tag-remove network unset --tag Remove a tag on the resource.
233 tag-replace network set --no-tag --tag Replace all tags on the resource.
tap-flow-create tapflow create Create a tap flow
tap-flow-delete tapflow delete Delete a tap flow
tap-flow-list tapflow list List all tap flows
tap-flow-show tapflow show Show details of the tap flow
tap-service-create tapservice create Create a tap service
tap-service-delete tapservice delete Delete a tap service
tap-service-list tapservice list List all tap services
tap-service-show tapservice show Show details of the tap service
234 vpn-endpoint-group-create Create a VPN endpoint group.
235 vpn-endpoint-group-delete Delete a given VPN endpoint group.
236 vpn-endpoint-group-list List VPN endpoint groups that belong to a given tenant.
251 vpn-service-list List VPN service configurations that belong to a given tenant.
252 vpn-service-show Show information of a given VPN service.
253 vpn-service-update Update a given VPN service.
254 tap-flow-create tapflow create Create a tap flow
255 tap-flow-delete tapflow delete Delete a tap flow
256 tap-flow-list tapflow list List all tap flows
257 tap-flow-show tapflow show Show details of the tap flow
258 tap-service-create tapservice create Create a tap service
259 tap-service-delete tapservice delete Delete a tap service
260 tap-service-list tapservice list List all tap services
261 tap-service-show tapservice show Show details of the tap service
262

View file

@ -1,10 +1,10 @@
add-fixed-ip,server add fixed ip,Add new IP address on a network to server.
add-secgroup,server add security group,Add a Security Group to a server. add-secgroup,server add security group,Add a Security Group to a server.
agent-create,compute agent create,Create new agent build. agent-create,compute agent create,Create new agent build.
agent-delete,compute agent delete,Delete existing agent build. agent-delete,compute agent delete,Delete existing agent build.
agent-list,compute agent list,List all builds. agent-list,compute agent list,List all builds.
agent-modify,compute agent set,Modify existing agent build. agent-modify,compute agent set,Modify existing agent build.
aggregate-add-host,aggregate add host,Add the host to the specified aggregate. aggregate-add-host,aggregate add host,Add the host to the specified aggregate.
aggregate-cache-images,aggregate cache image,Request images be cached. (Supported by API versions '2.81' - '2.latest') [hint: use '-- os-compute-api-version' flag to show help message for proper version]
aggregate-create,aggregate create,Create a new aggregate with the specified details. aggregate-create,aggregate create,Create a new aggregate with the specified details.
aggregate-delete,aggregate delete,Delete the aggregate. aggregate-delete,aggregate delete,Delete the aggregate.
aggregate-list,aggregate list,Print a list of all aggregates. aggregate-list,aggregate list,Print a list of all aggregates.
@ -15,51 +15,42 @@ aggregate-update,aggregate set / unset,Update the aggregate's name and optionall
availability-zone-list,availability zone list,List all the availability zones. availability-zone-list,availability zone list,List all the availability zones.
backup,server backup create,Backup a server by creating a 'backup' type snapshot. backup,server backup create,Backup a server by creating a 'backup' type snapshot.
boot,server create,Boot a new server. boot,server create,Boot a new server.
cell-capacities,,Get cell capacities for all cells or a given cell. clear-password,server set --root-password,Clear the admin password for a server from the metadata server. This action does not actually change the instance server password.
cell-show,,Show details of a given cell.
clear-password,server set --root-password,Clear the admin password for a server from the metadata server.
cloudpipe-configure,WONTFIX,Update the VPN IP/port of a cloudpipe instance.
cloudpipe-create,WONTFIX,Create a cloudpipe instance for the given project.
cloudpipe-list,WONTFIX,Print a list of all cloudpipe instances.
console-log,console log show,Get console log output of a server. console-log,console log show,Get console log output of a server.
delete,server delete,Immediately shut down and delete specified server(s). delete,server delete,Immediately shut down and delete specified server(s).
diagnostics,openstack server show --diagnostics,Retrieve server diagnostics. diagnostics,openstack server show --diagnostics,Retrieve server diagnostics.
evacuate,,Evacuate server from failed host. evacuate,server evacuate,Evacuate server from failed host.
flavor-access-add,,Add flavor access for the given tenant. flavor-access-add,flavor set --project,Add flavor access for the given tenant.
flavor-access-list,,Print access information about the given flavor. flavor-access-list,flavor show,Print access information about the given flavor.
flavor-access-remove,,Remove flavor access for the given tenant. flavor-access-remove,flavor unset,Remove flavor access for the given tenant.
flavor-create,flavor create,Create a new flavor. flavor-create,flavor create,Create a new flavor.
flavor-delete,flavor delete,Delete a specific flavor flavor-delete,flavor delete,Delete a specific flavor
flavor-key,flavor set / unset,Set or unset extra_spec for a flavor. flavor-key,flavor set / unset --property,Set or unset extra_spec for a flavor.
flavor-list,flavor list,Print a list of available 'flavors' flavor-list,flavor list,Print a list of available 'flavors'
flavor-show,flavor show,Show details about the given flavor. flavor-show,flavor show,Show details about the given flavor.
floating-ip-associate,server add floating ip,Associate a floating IP address to a server. flavor-update,flavor set --description,Update the description of an existing flavor. (Supported by API versions '2.55' - '2.latest') [hint: use '--os-compute-api-version' flag to show help message for proper version]
floating-ip-disassociate,server remove floating ip,Disassociate a floating IP address from a server.
force-delete,server delete,Force delete a server. force-delete,server delete,Force delete a server.
get-mks-console,console url show --mks,Get an MKS console to a server. get-mks-console,console url show --mks,Get an MKS console to a server. (Supported by API versions '2.8' - '2.latest') [hint: use ' --os-compute-api-version' flag to show help message for proper version]
get-password,WONTFIX,Get the admin password for a server. get-password,WONTFIX,Get the admin password for a server. This operation calls the metadata service to query metadata information and does not read password information from the server itself.
get-rdp-console,console url show --rdp,Get a rdp console to a server. get-rdp-console,console url show --rdp,Get a rdp console to a server.
get-serial-console,console url show --serial,Get a serial console to a server. get-serial-console,console url show --serial,Get a serial console to a server.
get-spice-console,console url show --spice,Get a spice console to a server. get-spice-console,console url show --spice,Get a spice console to a server.
get-vnc-console,console url show --novnc | --xvpvnc,Get a vnc console to a server. get-vnc-console,console url show --novnc,Get a vnc console to a server.
host-action,,Perform a power action on a host. host-evacuate,WONTFIX,Evacuate all instances from failed host.
host-describe,host show,Describe a specific host. host-evacuate-live,WONTFIX,Live migrate all instances off the specified host to other available hosts.
host-evacuate,,Evacuate all instances from failed host. host-meta,WONTFIX,Set or Delete metadata on all instances of a host.
host-evacuate-live,,Live migrate all instances off the specified host to other available hosts. host-servers-migrate,WONTFIX,Cold migrate all instances off the specified host to other available hosts.
host-list,host list,List all hosts by service. hypervisor-list,hypervisor list,List hypervisors. (Supported by API versions '2.0' - '2.latest')
host-meta,,Set or Delete metadata on all instances of a host. hypervisor-servers,server list --host,List servers belonging to specific hypervisors.
host-servers-migrate,,Cold migrate all instances off the specified host to other available hosts.
host-update,host set,Update host settings.
hypervisor-list,hypervisor list,List hypervisors.
hypervisor-servers,,List servers belonging to specific hypervisors.
hypervisor-show,hypervisor show,Display the details of the specified hypervisor. hypervisor-show,hypervisor show,Display the details of the specified hypervisor.
hypervisor-stats,hypervisor stats show,Get hypervisor statistics over all compute nodes. hypervisor-stats,hypervisor stats show,Get hypervisor statistics over all compute nodes.
hypervisor-uptime,,Display the uptime of the specified hypervisor. hypervisor-uptime,hypervisor show,Display the uptime of the specified hypervisor.
image-create,server image create,Create a new image by taking a snapshot of a running server. image-create,server image create,Create a new image by taking a snapshot of a running server.
instance-action,,Show an action. instance-action,server event show,Show an action.
instance-action-list,,List actions on a server. instance-action-list,server event list,List actions on a server.
interface-attach,,Attach a network interface to a server. instance-usage-audit-log,WONTFIX,List/Get server usage audits.
interface-detach,,Detach a network interface from a server. interface-attach,server add port / server add floating ip / server add fixed ip,Attach a network interface to a server.
interface-detach,server remove port,Detach a network interface from a server.
interface-list,port list --server,List interfaces attached to a server. interface-list,port list --server,List interfaces attached to a server.
keypair-add,keypair create,Create a new key pair for use with servers. keypair-add,keypair create,Create a new key pair for use with servers.
keypair-delete,keypair delete,Delete keypair given by its name. keypair-delete,keypair delete,Delete keypair given by its name.
@ -67,26 +58,24 @@ keypair-list,keypair list,Print a list of keypairs for a user
keypair-show,keypair show,Show details about the given keypair. keypair-show,keypair show,Show details about the given keypair.
limits,limits show,Print rate and absolute limits. limits,limits show,Print rate and absolute limits.
list,server list,List active servers. list,server list,List active servers.
list-extensions,extension list,List all the os-api extensions that are available.
list-secgroup,security group list,List Security Group(s) of a server. list-secgroup,security group list,List Security Group(s) of a server.
live-migration,,Migrate running server to a new machine. live-migration,server migration list,Migrate running server to a new machine.
live-migration-abort,,Abort an on-going live migration. live-migration-abort,server migration abort,Abort an on-going live migration.
live-migration-force-comp,,Force on-going live migration to complete. live-migration-force-comp,server migration force complete,Force on-going live migration to complete.
lock,server lock,Lock a server. lock,server lock,Lock a server.
meta,server set --property / unset,Set or delete metadata on a server. meta,server set --property / unset,Set or delete metadata on a server.
migrate,server migrate,Migrate a server. The new host will be selected by the scheduler. migrate,server migrate,Migrate a server. The new host will be selected by the scheduler.
migration-list,,Print a list of migrations. migration-list,server migration list,Print a list of migrations.
pause,server pause,Pause a server. pause,server pause,Pause a server.
quota-class-show,,List the quotas for a quota class. quota-class-show,quota show --class,List the quotas for a quota class.
quota-class-update,quota set --class,Update the quotas for a quota class. quota-class-update,quota set --class,Update the quotas for a quota class.
quota-defaults,quota list,List the default quotas for a tenant. quota-defaults,quota list,List the default quotas for a tenant.
quota-delete,quota set,Delete quota for a tenant/user so their quota will Revert back to default. quota-delete,quota delete --compute,Delete quota for a tenant/user so their quota will Revert back to default.
quota-show,quota show,List the quotas for a tenant/user. quota-show,quota show,List the quotas for a tenant/user.
quota-update,quota set,Update the quotas for a tenant/user. quota-update,quota set,Update the quotas for a tenant/user.
reboot,server reboot,Reboot a server. reboot,server reboot,Reboot a server.
rebuild,server rebuild,"Shutdown, re-image, and re-boot a server." rebuild,server rebuild,"Shutdown, re-image, and re-boot a server."
refresh-network,WONTFIX,Refresh server network information. refresh-network,WONTFIX,Refresh server network information.
remove-fixed-ip,server remove fixed ip,Remove an IP address from a server.
remove-secgroup,server remove security group,Remove a Security Group from a server. remove-secgroup,server remove security group,Remove a Security Group from a server.
rescue,server rescue,Reboots a server into rescue mode. rescue,server rescue,Reboots a server into rescue mode.
reset-network,WONTFIX,Reset network of a server. reset-network,WONTFIX,Reset network of a server.
@ -100,13 +89,14 @@ server-group-create,server group create,Create a new server group with the speci
server-group-delete,server group delete,Delete specific server group(s). server-group-delete,server group delete,Delete specific server group(s).
server-group-get,server group show,Get a specific server group. server-group-get,server group show,Get a specific server group.
server-group-list,server group list,Print a list of all server groups. server-group-list,server group list,Print a list of all server groups.
server-migration-list,,Get the migrations list of specified server. server-migration-list,server migration list,Get the migrations list of specified server.
server-migration-show,,Get the migration of specified server. server-migration-show,server migration show,Get the migration of specified server.
server-tag-add,,Add one or more tags to a server. server-tag-add,server set --tag,Add one or more tags to a server.
server-tag-delete,,Delete one or more tags from a server. server-tag-delete,server unset --tag,Delete one or more tags from a server.
server-tag-delete-all,,Delete all tags from a server. server-tag-delete-all,server unset --tag,Delete all tags from a server.
server-tag-list,,Get list of tags from a server. server-tag-list,server list --tag,Get list of tags from a server.
server-tag-set,,Set list of tags to a server. server-tag-set,server set --tag,Set list of tags to a server.
server-topology,openstack server show --topology,Retrieve server topology. (Supported by API versions '2.78' - '2.latest') [hint: use '-- os-compute-api-version' flag to show help message for proper version]
service-delete,compute service delete,Delete the service. service-delete,compute service delete,Delete the service.
service-disable,compute service set --disable,Disable the service. service-disable,compute service set --disable,Disable the service.
service-enable,compute service set --enable,Enable the service. service-enable,compute service set --enable,Enable the service.
@ -121,22 +111,17 @@ start,server start,Start the server(s).
stop,server stop,Stop the server(s). stop,server stop,Stop the server(s).
suspend,server suspend,Suspend a server. suspend,server suspend,Suspend a server.
trigger-crash-dump,server dump create,Trigger crash dump in an instance. trigger-crash-dump,server dump create,Trigger crash dump in an instance.
topology,openstack server show --topology,Retrieve server NUMA topology.
unlock,server unlock,Unlock a server. unlock,server unlock,Unlock a server.
unpause,server unpause,Unpause a server. unpause,server unpause,Unpause a server.
unrescue,server unrescue,Restart the server from normal boot disk again. unrescue,server unrescue,Restart the server from normal boot disk again.
unshelve,server unshelve,Unshelve a server. unshelve,server unshelve,Unshelve a server.
update,server set / unset --description,Update or unset the description for a server. update,server set / unset,Update the name or the description for a server.
update,server set --name,Update the name for a server.
usage,usage show,Show usage data for a single tenant. usage,usage show,Show usage data for a single tenant.
usage-list,usage list,List usage data for all tenants. usage-list,usage list,List usage data for all tenants.
version-list,,List all API versions. version-list,versions show --service compute,List all API versions.
virtual-interface-list,,Show virtual interface info about the given server.
volume-attach,server add volume,Attach a volume to a server. volume-attach,server add volume,Attach a volume to a server.
volume-attachments,server show,List all the volumes attached to a server. volume-attachments,server volume list,List all the volumes attached to a server.
volume-detach,server remove volume,Detach a volume from a server. volume-detach,server remove volume,Detach a volume from a server.
volume-update,,Update volume attachment. volume-update,server volume update,Update volume attachment.
x509-create-cert,WONTFIX,Create x509 cert for a user in tenant. bash-completion,complete,Prints all of the commands and options to stdout so that the nova.bash_completion script doesn't have to hard code them.
x509-get-root-cert,WONTFIX,Fetch the x509 root cert.
bash-completion,complete,Prints all of the commands and options to
help,help,Display help about this program or one of its subcommands. help,help,Display help about this program or one of its subcommands.

1 add-fixed-ip add-secgroup server add fixed ip server add security group Add new IP address on a network to server. Add a Security Group to a server.
add-fixed-ip server add fixed ip Add new IP address on a network to server.
1 add-secgroup add-secgroup server add security group server add security group Add a Security Group to a server. Add a Security Group to a server.
2 agent-create agent-create compute agent create compute agent create Create new agent build. Create new agent build.
3 agent-delete agent-delete compute agent delete compute agent delete Delete existing agent build. Delete existing agent build.
4 agent-list agent-list compute agent list compute agent list List all builds. List all builds.
5 agent-modify agent-modify compute agent set compute agent set Modify existing agent build. Modify existing agent build.
6 aggregate-add-host aggregate-add-host aggregate add host aggregate add host Add the host to the specified aggregate. Add the host to the specified aggregate.
7 aggregate-cache-images aggregate cache image Request images be cached. (Supported by API versions '2.81' - '2.latest') [hint: use '-- os-compute-api-version' flag to show help message for proper version]
8 aggregate-create aggregate-create aggregate create aggregate create Create a new aggregate with the specified details. Create a new aggregate with the specified details.
9 aggregate-delete aggregate-delete aggregate delete aggregate delete Delete the aggregate. Delete the aggregate.
10 aggregate-list aggregate-list aggregate list aggregate list Print a list of all aggregates. Print a list of all aggregates.
15 availability-zone-list availability-zone-list availability zone list availability zone list List all the availability zones. List all the availability zones.
16 backup backup server backup create server backup create Backup a server by creating a 'backup' type snapshot. Backup a server by creating a 'backup' type snapshot.
17 boot boot server create server create Boot a new server. Boot a new server.
18 cell-capacities clear-password server set --root-password Get cell capacities for all cells or a given cell. Clear the admin password for a server from the metadata server. This action does not actually change the instance server password.
cell-show Show details of a given cell.
clear-password server set --root-password Clear the admin password for a server from the metadata server.
cloudpipe-configure WONTFIX Update the VPN IP/port of a cloudpipe instance.
cloudpipe-create WONTFIX Create a cloudpipe instance for the given project.
cloudpipe-list WONTFIX Print a list of all cloudpipe instances.
19 console-log console-log console log show console log show Get console log output of a server. Get console log output of a server.
20 delete delete server delete server delete Immediately shut down and delete specified server(s). Immediately shut down and delete specified server(s).
21 diagnostics diagnostics openstack server show --diagnostics openstack server show --diagnostics Retrieve server diagnostics. Retrieve server diagnostics.
22 evacuate evacuate server evacuate Evacuate server from failed host. Evacuate server from failed host.
23 flavor-access-add flavor-access-add flavor set --project Add flavor access for the given tenant. Add flavor access for the given tenant.
24 flavor-access-list flavor-access-list flavor show Print access information about the given flavor. Print access information about the given flavor.
25 flavor-access-remove flavor-access-remove flavor unset Remove flavor access for the given tenant. Remove flavor access for the given tenant.
26 flavor-create flavor-create flavor create flavor create Create a new flavor. Create a new flavor.
27 flavor-delete flavor-delete flavor delete flavor delete Delete a specific flavor Delete a specific flavor
28 flavor-key flavor-key flavor set / unset flavor set / unset --property Set or unset extra_spec for a flavor. Set or unset extra_spec for a flavor.
29 flavor-list flavor-list flavor list flavor list Print a list of available 'flavors' Print a list of available 'flavors'
30 flavor-show flavor-show flavor show flavor show Show details about the given flavor. Show details about the given flavor.
31 floating-ip-associate flavor-update server add floating ip flavor set --description Associate a floating IP address to a server. Update the description of an existing flavor. (Supported by API versions '2.55' - '2.latest') [hint: use '--os-compute-api-version' flag to show help message for proper version]
floating-ip-disassociate server remove floating ip Disassociate a floating IP address from a server.
32 force-delete force-delete server delete server delete Force delete a server. Force delete a server.
33 get-mks-console get-mks-console console url show --mks console url show --mks Get an MKS console to a server. Get an MKS console to a server. (Supported by API versions '2.8' - '2.latest') [hint: use ' --os-compute-api-version' flag to show help message for proper version]
34 get-password get-password WONTFIX WONTFIX Get the admin password for a server. Get the admin password for a server. This operation calls the metadata service to query metadata information and does not read password information from the server itself.
35 get-rdp-console get-rdp-console console url show --rdp console url show --rdp Get a rdp console to a server. Get a rdp console to a server.
36 get-serial-console get-serial-console console url show --serial console url show --serial Get a serial console to a server. Get a serial console to a server.
37 get-spice-console get-spice-console console url show --spice console url show --spice Get a spice console to a server. Get a spice console to a server.
38 get-vnc-console get-vnc-console console url show --novnc | --xvpvnc console url show --novnc Get a vnc console to a server. Get a vnc console to a server.
39 host-action host-evacuate WONTFIX Perform a power action on a host. Evacuate all instances from failed host.
40 host-describe host-evacuate-live host show WONTFIX Describe a specific host. Live migrate all instances off the specified host to other available hosts.
41 host-evacuate host-meta WONTFIX Evacuate all instances from failed host. Set or Delete metadata on all instances of a host.
42 host-evacuate-live host-servers-migrate WONTFIX Live migrate all instances off the specified host to other available hosts. Cold migrate all instances off the specified host to other available hosts.
43 host-list hypervisor-list host list hypervisor list List all hosts by service. List hypervisors. (Supported by API versions '2.0' - '2.latest')
44 host-meta hypervisor-servers server list --host Set or Delete metadata on all instances of a host. List servers belonging to specific hypervisors.
host-servers-migrate Cold migrate all instances off the specified host to other available hosts.
host-update host set Update host settings.
hypervisor-list hypervisor list List hypervisors.
hypervisor-servers List servers belonging to specific hypervisors.
45 hypervisor-show hypervisor-show hypervisor show hypervisor show Display the details of the specified hypervisor. Display the details of the specified hypervisor.
46 hypervisor-stats hypervisor-stats hypervisor stats show hypervisor stats show Get hypervisor statistics over all compute nodes. Get hypervisor statistics over all compute nodes.
47 hypervisor-uptime hypervisor-uptime hypervisor show Display the uptime of the specified hypervisor. Display the uptime of the specified hypervisor.
48 image-create image-create server image create server image create Create a new image by taking a snapshot of a running server. Create a new image by taking a snapshot of a running server.
49 instance-action instance-action server event show Show an action. Show an action.
50 instance-action-list instance-action-list server event list List actions on a server. List actions on a server.
51 interface-attach instance-usage-audit-log WONTFIX Attach a network interface to a server. List/Get server usage audits.
52 interface-detach interface-attach server add port / server add floating ip / server add fixed ip Detach a network interface from a server. Attach a network interface to a server.
53 interface-detach server remove port Detach a network interface from a server.
54 interface-list interface-list port list --server port list --server List interfaces attached to a server. List interfaces attached to a server.
55 keypair-add keypair-add keypair create keypair create Create a new key pair for use with servers. Create a new key pair for use with servers.
56 keypair-delete keypair-delete keypair delete keypair delete Delete keypair given by its name. Delete keypair given by its name.
58 keypair-show keypair-show keypair show keypair show Show details about the given keypair. Show details about the given keypair.
59 limits limits limits show limits show Print rate and absolute limits. Print rate and absolute limits.
60 list list server list server list List active servers. List active servers.
list-extensions extension list List all the os-api extensions that are available.
61 list-secgroup list-secgroup security group list security group list List Security Group(s) of a server. List Security Group(s) of a server.
62 live-migration live-migration server migration list Migrate running server to a new machine. Migrate running server to a new machine.
63 live-migration-abort live-migration-abort server migration abort Abort an on-going live migration. Abort an on-going live migration.
64 live-migration-force-comp live-migration-force-comp server migration force complete Force on-going live migration to complete. Force on-going live migration to complete.
65 lock lock server lock server lock Lock a server. Lock a server.
66 meta meta server set --property / unset server set --property / unset Set or delete metadata on a server. Set or delete metadata on a server.
67 migrate migrate server migrate server migrate Migrate a server. The new host will be selected by the scheduler. Migrate a server. The new host will be selected by the scheduler.
68 migration-list migration-list server migration list Print a list of migrations. Print a list of migrations.
69 pause pause server pause server pause Pause a server. Pause a server.
70 quota-class-show quota-class-show quota show --class List the quotas for a quota class. List the quotas for a quota class.
71 quota-class-update quota-class-update quota set --class quota set --class Update the quotas for a quota class. Update the quotas for a quota class.
72 quota-defaults quota-defaults quota list quota list List the default quotas for a tenant. List the default quotas for a tenant.
73 quota-delete quota-delete quota set quota delete --compute Delete quota for a tenant/user so their quota will Revert back to default. Delete quota for a tenant/user so their quota will Revert back to default.
74 quota-show quota-show quota show quota show List the quotas for a tenant/user. List the quotas for a tenant/user.
75 quota-update quota-update quota set quota set Update the quotas for a tenant/user. Update the quotas for a tenant/user.
76 reboot reboot server reboot server reboot Reboot a server. Reboot a server.
77 rebuild rebuild server rebuild server rebuild Shutdown, re-image, and re-boot a server. Shutdown, re-image, and re-boot a server.
78 refresh-network refresh-network WONTFIX WONTFIX Refresh server network information. Refresh server network information.
remove-fixed-ip server remove fixed ip Remove an IP address from a server.
79 remove-secgroup remove-secgroup server remove security group server remove security group Remove a Security Group from a server. Remove a Security Group from a server.
80 rescue rescue server rescue server rescue Reboots a server into rescue mode. Reboots a server into rescue mode.
81 reset-network reset-network WONTFIX WONTFIX Reset network of a server. Reset network of a server.
89 server-group-delete server-group-delete server group delete server group delete Delete specific server group(s). Delete specific server group(s).
90 server-group-get server-group-get server group show server group show Get a specific server group. Get a specific server group.
91 server-group-list server-group-list server group list server group list Print a list of all server groups. Print a list of all server groups.
92 server-migration-list server-migration-list server migration list Get the migrations list of specified server. Get the migrations list of specified server.
93 server-migration-show server-migration-show server migration show Get the migration of specified server. Get the migration of specified server.
94 server-tag-add server-tag-add server set --tag Add one or more tags to a server. Add one or more tags to a server.
95 server-tag-delete server-tag-delete server unset --tag Delete one or more tags from a server. Delete one or more tags from a server.
96 server-tag-delete-all server-tag-delete-all server unset --tag Delete all tags from a server. Delete all tags from a server.
97 server-tag-list server-tag-list server list --tag Get list of tags from a server. Get list of tags from a server.
98 server-tag-set server-tag-set server set --tag Set list of tags to a server. Set list of tags to a server.
99 server-topology openstack server show --topology Retrieve server topology. (Supported by API versions '2.78' - '2.latest') [hint: use '-- os-compute-api-version' flag to show help message for proper version]
100 service-delete service-delete compute service delete compute service delete Delete the service. Delete the service.
101 service-disable service-disable compute service set --disable compute service set --disable Disable the service. Disable the service.
102 service-enable service-enable compute service set --enable compute service set --enable Enable the service. Enable the service.
111 stop stop server stop server stop Stop the server(s). Stop the server(s).
112 suspend suspend server suspend server suspend Suspend a server. Suspend a server.
113 trigger-crash-dump trigger-crash-dump server dump create server dump create Trigger crash dump in an instance. Trigger crash dump in an instance.
topology openstack server show --topology Retrieve server NUMA topology.
114 unlock unlock server unlock server unlock Unlock a server. Unlock a server.
115 unpause unpause server unpause server unpause Unpause a server. Unpause a server.
116 unrescue unrescue server unrescue server unrescue Restart the server from normal boot disk again. Restart the server from normal boot disk again.
117 unshelve unshelve server unshelve server unshelve Unshelve a server. Unshelve a server.
118 update update server set / unset --description server set / unset Update or unset the description for a server. Update the name or the description for a server.
update server set --name Update the name for a server.
119 usage usage usage show usage show Show usage data for a single tenant. Show usage data for a single tenant.
120 usage-list usage-list usage list usage list List usage data for all tenants. List usage data for all tenants.
121 version-list version-list versions show --service compute List all API versions. List all API versions.
virtual-interface-list Show virtual interface info about the given server.
122 volume-attach volume-attach server add volume server add volume Attach a volume to a server. Attach a volume to a server.
123 volume-attachments volume-attachments server show server volume list List all the volumes attached to a server. List all the volumes attached to a server.
124 volume-detach volume-detach server remove volume server remove volume Detach a volume from a server. Detach a volume from a server.
125 volume-update volume-update server volume update Update volume attachment. Update volume attachment.
126 x509-create-cert bash-completion WONTFIX complete Create x509 cert for a user in tenant. Prints all of the commands and options to stdout so that the nova.bash_completion script doesn't have to hard code them.
x509-get-root-cert WONTFIX Fetch the x509 root cert.
bash-completion complete Prints all of the commands and options to
127 help help help help Display help about this program or one of its subcommands. Display help about this program or one of its subcommands.

View file

@ -49,7 +49,7 @@ command line. The primary difference is the use of 'project' in the name of the
Refer to the keystoneclient library documentation for more details about these plugins and their options, and for a complete list of available plugins. Refer to the keystoneclient library documentation for more details about these plugins and their options, and for a complete list of available plugins.
Please bear in mind that some plugins might not support all of the functionalities of :program:`openstack`; for example the v3unscopedsaml plugin can deliver only unscoped tokens, some commands might not be available through this authentication method. Please bear in mind that some plugins might not support all of the functionalities of :program:`openstack`; for example the v3unscopedsaml plugin can deliver only unscoped tokens, some commands might not be available through this authentication method.
Additionally, it is possible to use Keystone's service token to authenticate, by setting the options :option:`--os-token` and :option:`--os-url` (or the environment variables :envvar:`OS_TOKEN` and :envvar:`OS_URL` respectively). This method takes precedence over authentication plugins. Additionally, it is possible to use Keystone's service token to authenticate, by setting the options :option:`--os-token` and :option:`--os-endpoint` (or the environment variables :envvar:`OS_TOKEN` and :envvar:`OS_ENDPOINT` respectively). This method takes precedence over authentication plugins.
.. NOTE:: .. NOTE::
To use the ``v3unscopedsaml`` method, the lxml package will need to be installed. To use the ``v3unscopedsaml`` method, the lxml package will need to be installed.
@ -106,9 +106,9 @@ OPTIONS
Authentication URL Authentication URL
.. option:: --os-url <service-url> .. option:: --os-endpoint <service-url>
Service URL, when using a service token for authentication Service ENDPOINT, when using a service token for authentication
.. option:: --os-domain-name <auth-domain-name> .. option:: --os-domain-name <auth-domain-name>
@ -349,7 +349,7 @@ file, but if those are incomplete it may be impossible to know which
auth type is intended. The :option:`--os-auth-type` option can always be auth type is intended. The :option:`--os-auth-type` option can always be
used to force a specific type. used to force a specific type.
When :option:`--os-token` and :option:`--os-url` are both present the When :option:`--os-token` and :option:`--os-endpoint` are both present the
``token_endpoint`` auth type is selected automatically. If ``token_endpoint`` auth type is selected automatically. If
:option:`--os-auth-url` and :option:`--os-username` are present ``password`` :option:`--os-auth-url` and :option:`--os-username` are present ``password``
auth type is selected. auth type is selected.
@ -466,9 +466,9 @@ The following environment variables can be set to alter the behaviour of :progra
- ``v3applicationcredential`` - ``v3applicationcredential``
- ``v3multifactor`` - ``v3multifactor``
.. envvar:: OS_URL .. envvar:: OS_ENDPOINT
Service URL (when using the service token) Service ENDPOINT (when using the service token)
.. envvar:: OS_DOMAIN_NAME .. envvar:: OS_DOMAIN_NAME
@ -593,8 +593,8 @@ The following environment variables can be set to alter the behaviour of :progra
BUGS BUGS
==== ====
Bug reports are accepted at the python-openstackclient StoryBoard project Bug reports are accepted at the python-openstackclient Launchpad project
"https://storyboard.openstack.org/#!/project/975". "https://bugs.launchpad.net/python-openstackclient".
AUTHORS AUTHORS

View file

@ -0,0 +1,4 @@
cyborg
------
.. autoprogram-cliff:: openstack.accelerator.v2

View file

@ -9,37 +9,19 @@ Plugin Commands
aodh aodh
barbican barbican
cyborg
designate designate
gnocchi gnocchi
heat heat
ironic ironic
ironic-inspector ironic-inspector
magnum
manila manila
mistral mistral
neutron neutron
octavia octavia
placement placement
rsd
sahara
senlin
trove trove
watcher watcher
zaqar zaqar
zun zun
.. TODO(efried): Make pages for the following once they're fixed.
.. cue
.. # cueclient is not in global-requirements
.. # list-plugins:: openstack.mb.v1
.. # :detailed:
.. murano
.. # the murano docs cause warnings and a broken docs build
.. # .. list-plugins:: openstack.application_catalog.v1
.. # :detailed:
.. tripleo
.. # tripleoclient is not in global-requirements
.. # list-plugins:: openstack.tripleoclient.v1
.. # :detailed:

View file

@ -0,0 +1,4 @@
magnum
------
.. autoprogram-cliff:: openstack.container_infra.v1

View file

@ -1,4 +0,0 @@
rsd
---
.. autoprogram-cliff:: openstack.rsd.v2

View file

@ -1,4 +0,0 @@
sahara
------
.. autoprogram-cliff:: openstack.data_processing.v1

View file

@ -1,4 +0,0 @@
senlin
------
.. autoprogram-cliff:: openstack.clustering.v1

View file

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# #
# OpenStack Command Line Client documentation build configuration file, created # OpenStack Command Line Client documentation build configuration file, created
# by sphinx-quickstart on Wed May 16 12:05:58 2012. # by sphinx-quickstart on Wed May 16 12:05:58 2012.
@ -15,22 +14,22 @@
# -- General configuration ---------------------------------------------------- # -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0' # needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be # Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', extensions = [
'sphinx.ext.doctest', 'sphinx.ext.autodoc',
'sphinx.ext.todo', 'sphinx.ext.doctest',
'openstackdocstheme', 'sphinx.ext.todo',
'stevedore.sphinxext', 'openstackdocstheme',
'cliff.sphinxext', 'stevedore.sphinxext',
'sphinxcontrib.apidoc', 'cliff.sphinxext',
] 'sphinxcontrib.apidoc',
]
# openstackdocstheme options # openstackdocstheme options
openstackdocs_repo_name = 'openstack/python-openstackclient' openstackdocs_repo_name = 'openstack/python-openstackclient'
openstackdocs_use_storyboard = True
openstackdocs_auto_name = False openstackdocs_auto_name = False
# Add project 'foo' to this list to enable the :foo-doc: role # Add project 'foo' to this list to enable the :foo-doc: role
@ -39,30 +38,30 @@ openstackdocs_projects = [
] ]
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates'] # templates_path = ['_templates']
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = '.rst'
# The encoding of source files. # The encoding of source files.
#source_encoding = 'utf-8-sig' # source_encoding = 'utf-8-sig'
# The master toctree document. # The master toctree document.
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'OpenStack Command Line Client' project = 'OpenStack Command Line Client'
copyright = u'2012-2013 OpenStack Foundation' copyright = '2012-2013 OpenStack Foundation'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.
#language = None # language = None
# There are two options for replacing |today|: either, you set today to some # There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used: # non-false value, then it is used:
#today = '' # today = ''
# Else, today_fmt is used as the format for a strftime call. # Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y' # today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
@ -70,18 +69,18 @@ exclude_patterns = ['**tests**']
# The reST default role (used for this markup: `text`) to use for all # The reST default role (used for this markup: `text`) to use for all
# documents. # documents.
#default_role = None # default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True # add_function_parentheses = True
# If true, the current module name will be prepended to all description # If true, the current module name will be prepended to all description
# unit titles (such as .. function::). # unit titles (such as .. function::).
#add_module_names = True # add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the # If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default. # output. They are ignored by default.
#show_authors = False # show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native' pygments_style = 'native'
@ -94,75 +93,75 @@ modindex_common_prefix = ['openstackclient.']
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
#html_theme_path = ["."] # html_theme_path = ["."]
#html_theme = '_theme' # html_theme = '_theme'
html_theme = 'openstackdocs' html_theme = 'openstackdocs'
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
# documentation. # documentation.
#html_theme_options = {} # html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory. # Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = [] # html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to # The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation". # "<project> v<release> documentation".
#html_title = None # html_title = None
# A shorter title for the navigation bar. Default is the same as html_title. # A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None # html_short_title = None
# The name of an image file (relative to this directory) to place at the top # The name of an image file (relative to this directory) to place at the top
# of the sidebar. # of the sidebar.
#html_logo = None # html_logo = None
# The name of an image file (within the static path) to use as favicon of the # The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large. # pixels large.
#html_favicon = None # html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static'] # html_static_path = ['_static']
# If true, SmartyPants will be used to convert quotes and dashes to # If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities. # typographically correct entities.
#html_use_smartypants = True # html_use_smartypants = True
# Custom sidebar templates, maps document names to template names. # Custom sidebar templates, maps document names to template names.
#html_sidebars = {} # html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to # Additional templates that should be rendered to pages, maps page names to
# template names. # template names.
#html_additional_pages = {} # html_additional_pages = {}
# If false, no module index is generated. # If false, no module index is generated.
#html_domain_indices = True # html_domain_indices = True
# If false, no index is generated. # If false, no index is generated.
#html_use_index = True # html_use_index = True
# If true, the index is split into individual pages for each letter. # If true, the index is split into individual pages for each letter.
#html_split_index = False # html_split_index = False
# If true, links to the reST sources are added to the pages. # If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True # html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True # html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True # html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will # If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the # contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served. # base URL from which the finished HTML is served.
#html_use_opensearch = '' # html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml"). # This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None # html_file_suffix = None
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = 'OpenStackCommandLineClientdoc' htmlhelp_basename = 'OpenStackCommandLineClientdoc'
@ -174,44 +173,46 @@ html_extra_path = ['_extra']
# -- Options for LaTeX output ------------------------------------------------- # -- Options for LaTeX output -------------------------------------------------
latex_elements = { latex_elements = {
# The paper size ('letterpaper' or 'a4paper'). # The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper', #'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt',
#'pointsize': '10pt', # Additional stuff for the LaTeX preamble.
#'preamble': '',
# Additional stuff for the LaTeX preamble.
#'preamble': '',
} }
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]) # (source start file, target name, title, author, documentclass [howto/manual])
# . # .
latex_documents = [ latex_documents = [
('index', 'OpenStackCommandLineClient.tex', (
u'OpenStack Command Line Client Documentation', 'index',
u'OpenStack', 'manual'), 'OpenStackCommandLineClient.tex',
'OpenStack Command Line Client Documentation',
'OpenStack',
'manual',
),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
# the title page. # the title page.
#latex_logo = None # latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts, # For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters. # not chapters.
#latex_use_parts = False # latex_use_parts = False
# If true, show page references after internal links. # If true, show page references after internal links.
#latex_show_pagerefs = False # latex_show_pagerefs = False
# If true, show URL addresses after external links. # If true, show URL addresses after external links.
#latex_show_urls = False # latex_show_urls = False
# Documents to append as an appendix to all manuals. # Documents to append as an appendix to all manuals.
#latex_appendices = [] # latex_appendices = []
# If false, no module index is generated. # If false, no module index is generated.
#latex_domain_indices = True # latex_domain_indices = True
# -- Options for manual page output ------------------------------------------- # -- Options for manual page output -------------------------------------------
@ -222,14 +223,14 @@ man_pages = [
( (
'cli/man/openstack', 'cli/man/openstack',
'openstack', 'openstack',
u'OpenStack Command Line Client', 'OpenStack Command Line Client',
[u'OpenStack contributors'], ['OpenStack contributors'],
1, 1,
), ),
] ]
# If true, show URL addresses after external links. # If true, show URL addresses after external links.
#man_show_urls = False # man_show_urls = False
# -- Options for Texinfo output ----------------------------------------------- # -- Options for Texinfo output -----------------------------------------------
@ -238,21 +239,25 @@ man_pages = [
# (source start file, target name, title, author, # (source start file, target name, title, author,
# dir menu entry, description, category) # dir menu entry, description, category)
texinfo_documents = [ texinfo_documents = [
('index', 'OpenStackCommandLineClient', (
u'OpenStack Command Line Client Documentation', 'index',
u'OpenStack', 'OpenStackCommandLineClient', 'OpenStackCommandLineClient',
'One line description of project.', 'OpenStack Command Line Client Documentation',
'Miscellaneous'), 'OpenStack',
'OpenStackCommandLineClient',
'One line description of project.',
'Miscellaneous',
),
] ]
# Documents to append as an appendix to all manuals. # Documents to append as an appendix to all manuals.
#texinfo_appendices = [] # texinfo_appendices = []
# If false, no module index is generated. # If false, no module index is generated.
#texinfo_domain_indices = True # texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'. # How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote' # texinfo_show_urls = 'footnote'
# -- Options for cliff.sphinxext plugin --------------------------------------- # -- Options for cliff.sphinxext plugin ---------------------------------------
@ -260,8 +265,16 @@ texinfo_documents = [
autoprogram_cliff_application = 'openstack' autoprogram_cliff_application = 'openstack'
autoprogram_cliff_ignored = [ autoprogram_cliff_ignored = [
'--help', '--format', '--column', '--max-width', '--fit-width', '--help',
'--print-empty', '--prefix', '--noindent', '--quote'] '--format',
'--column',
'--max-width',
'--fit-width',
'--print-empty',
'--prefix',
'--noindent',
'--quote',
]
# Prevent cliff from generating "This command is provided by the # Prevent cliff from generating "This command is provided by the
# python-openstackclient plugin." # python-openstackclient plugin."

View file

@ -29,8 +29,9 @@ Example
This example is taken from ``keypair create`` where the ``--public-key`` option This example is taken from ``keypair create`` where the ``--public-key`` option
specifies a file containing the public key to upload. If the file is not found, specifies a file containing the public key to upload. If the file is not found,
the IOError exception is trapped and a more specific CommandError exception is the ``IOError`` exception is trapped and a more specific ``CommandError``
raised that includes the name of the file that was attempted to be opened. exception is raised that includes the name of the file that was attempted to be
opened.
.. code-block:: python .. code-block:: python
@ -45,7 +46,7 @@ raised that includes the name of the file that was attempted to be opened.
public_key = parsed_args.public_key public_key = parsed_args.public_key
if public_key: if public_key:
try: try:
with io.open( with open(
os.path.expanduser(parsed_args.public_key), os.path.expanduser(parsed_args.public_key),
"rb" "rb"
) as p: ) as p:
@ -56,8 +57,8 @@ raised that includes the name of the file that was attempted to be opened.
msg % (parsed_args.public_key, e), msg % (parsed_args.public_key, e),
) )
keypair = compute_client.keypairs.create( keypair = compute_client.create_keypair(
parsed_args.name, name=parsed_args.name,
public_key=public_key, public_key=public_key,
) )

View file

@ -6,16 +6,18 @@ Communication
------------- -------------
IRC Channel IRC Channel
=========== ~~~~~~~~~~~
The OpenStackClient team doesn't have regular meetings so if you have The OpenStackClient team doesn't have regular meetings so if you have
questions or anything you want to discuss, come to our channel: questions or anything you want to discuss, come to our channel:
#openstack-sdks #openstack-sdks
Testing Testing
------- -------
Tox prerequisites and installation Tox prerequisites and installation
================================== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Install the prerequisites for Tox: Install the prerequisites for Tox:
@ -23,23 +25,22 @@ Install the prerequisites for Tox:
.. code-block:: bash .. code-block:: bash
$ apt-get install gcc gettext python-dev libxml2-dev libxslt1-dev \ $ apt-get install gcc gettext python3-dev libxml2-dev libxslt1-dev \
zlib1g-dev zlib1g-dev
You may need to use pip install for some packages. You may need to use pip install for some packages.
* On RHEL or CentOS including Fedora: * On RHEL or CentOS including Fedora:
.. code-block:: bash .. code-block:: bash
$ yum install gcc python-devel libxml2-devel libxslt-devel $ yum install gcc python3-devel libxml2-devel libxslt-devel
* On openSUSE or SUSE linux Enterprise: * On openSUSE or SUSE linux Enterprise:
.. code-block:: bash .. code-block:: bash
$ zypper install gcc python-devel libxml2-devel libxslt-devel $ zypper install gcc python3-devel libxml2-devel libxslt-devel
Install python-tox: Install python-tox:
@ -59,7 +60,7 @@ To run the full suite of tests maintained within OpenStackClient.
virtualenvs. You can later use the ``-r`` option with ``tox`` to rebuild virtualenvs. You can later use the ``-r`` option with ``tox`` to rebuild
your virtualenv in a similar manner. your virtualenv in a similar manner.
To run tests for one or more specific test environments(for example, the most To run tests for one or more specific test environments (for example, the most
common configuration of the latest Python version and PEP-8), list the common configuration of the latest Python version and PEP-8), list the
environments with the ``-e`` option, separated by spaces: environments with the ``-e`` option, separated by spaces:
@ -70,7 +71,7 @@ environments with the ``-e`` option, separated by spaces:
See ``tox.ini`` for the full list of available test environments. See ``tox.ini`` for the full list of available test environments.
Running functional tests Running functional tests
======================== ~~~~~~~~~~~~~~~~~~~~~~~~
OpenStackClient also maintains a set of functional tests that are optimally OpenStackClient also maintains a set of functional tests that are optimally
designed to be run against OpenStack's gate. Optionally, a developer may designed to be run against OpenStack's gate. Optionally, a developer may
@ -87,10 +88,10 @@ To run a specific functional test:
.. code-block:: bash .. code-block:: bash
$ tox -e functional -- --regex functional.tests.compute.v2.test_server $ tox -e functional -- --regex tests.functional.compute.v2.test_server
Running with PDB Running with PDB
================ ~~~~~~~~~~~~~~~~
Using PDB breakpoints with ``tox`` and ``testr`` normally does not work since Using PDB breakpoints with ``tox`` and ``testr`` normally does not work since
the tests fail with a `BdbQuit` exception rather than stopping at the the tests fail with a `BdbQuit` exception rather than stopping at the
@ -109,8 +110,32 @@ For reference, the `debug`_ ``tox`` environment implements the instructions
.. _`debug`: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests .. _`debug`: https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests
Building the Documentation Coding Style
-------------------------- ------------
OpenStackClient uses `flake8`__ along with `hacking`__, an OpenStack-specific
superset of ``flake8`` rules, to enforce coding style. This can be run manually
using ``tox``:
.. code-block:: bash
$ tox -e pep8
Alternatively, you can use the `pre-commit framework`__ to allow running of
some linters on each commit. This must be enabled locally to function:
.. code-block:: bash
$ pip install --user pre-commit
$ pre-commit install --allow-missing-config
.. __: https://flake8.pycqa.org/en/latest/
.. __: https://docs.openstack.org/hacking/latest/user/hacking.html
.. __: https://pre-commit.com/
Documentation
-------------
The documentation is generated with Sphinx using the ``tox`` command. To The documentation is generated with Sphinx using the ``tox`` command. To
create HTML docs, run the commands: create HTML docs, run the commands:
@ -121,6 +146,7 @@ create HTML docs, run the commands:
The resultant HTML will be in the ``doc/build/html`` directory. The resultant HTML will be in the ``doc/build/html`` directory.
Release Notes Release Notes
------------- -------------
@ -156,6 +182,7 @@ To run the commands and see results:
At last, look at the generated release notes files in ``releasenotes/build/html`` in your browser. At last, look at the generated release notes files in ``releasenotes/build/html`` in your browser.
Testing new code Testing new code
---------------- ----------------
@ -174,7 +201,7 @@ or
$ pip install -e . $ pip install -e .
Standardize Import Format Standardize Import Format
========================= ~~~~~~~~~~~~~~~~~~~~~~~~~
More information about Import Format, see `Import Order Guide More information about Import Format, see `Import Order Guide
<https://docs.openstack.org/hacking/latest/user/hacking.html#imports>`__. <https://docs.openstack.org/hacking/latest/user/hacking.html#imports>`__.
@ -193,7 +220,7 @@ The import order shows below:
{{begin your code}} {{begin your code}}
Example Example
~~~~~~~ ^^^^^^^
.. code-block:: python .. code-block:: python

View file

@ -117,14 +117,14 @@ interface to the user, not the user to the interface.
Commands should be discoverable via the interface itself. Commands should be discoverable via the interface itself.
To determine a list of available commands, use the :code:`-h` or To determine a list of available commands, use the ``-h`` or
:code:`--help` options: ``--help`` options:
.. code-block:: bash .. code-block:: bash
$ openstack --help $ openstack --help
For help with an individual command, use the :code:`help` command: For help with an individual command, use the ``help`` command:
.. code-block:: bash .. code-block:: bash
@ -167,7 +167,7 @@ Command Structure
OpenStackClient has a consistent and predictable format for all of its commands. OpenStackClient has a consistent and predictable format for all of its commands.
* The top level command name is :code:`openstack` * The top level command name is ``openstack``
* Sub-commands take the form: * Sub-commands take the form:
.. code-block:: bash .. code-block:: bash
@ -185,6 +185,21 @@ Output formats:
* user-friendly tables with headers, etc * user-friendly tables with headers, etc
* machine-parsable delimited * machine-parsable delimited
.. note::
A note on terminology. An **argument** is a positional parameter to the
command. As discussed later, these should be used sparingly in
OpenStackClient. An **option** - also known as a **flag** - is a named
parameter denoted with either a hyphen and a single-letter name (``-r``) or
a double hyphen and a multiple-letter name (``--recursive``). They may or
may not also include a user-specified value (``--file foo.txt`` or
``--file=foo.txt``).
For more information on this topic and CLIs in general, refer to the
excellent `Command Line Interface Guidelines website`__.
.. __: https://clig.dev/#arguments-and-flags
Global Options Global Options
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
@ -193,84 +208,151 @@ invocation regardless of action to be performed. They include authentication
credentials and API version selection. Most global options have a corresponding credentials and API version selection. Most global options have a corresponding
environment variable that may also be used to set the value. If both are present, environment variable that may also be used to set the value. If both are present,
the command-line option takes priority. The environment variable names are derived the command-line option takes priority. The environment variable names are derived
from the option name by dropping the leading dashes ('--'), converting each embedded from the option name by dropping the leading dashes (``--``), converting each embedded
dash ('-') to an underscore ('_'), and converting to upper case. dash (``-``) to an underscore (``_``), and converting to upper case.
* Global options shall always have a long option name, certain common options may * Global options shall always have a long option name, certain common options may
also have short names. Short names should be reserved for global options to limit also have short names. Short names should be reserved for global options to limit
the potential for duplication and multiple meanings between commands given the the potential for duplication and multiple meanings between commands given the
limited set of available short names. limited set of available short names.
* All long options names shall begin with two dashes ('--') and use a single dash
('-') internally between words (:code:`--like-this`). Underscores ('_') shall not * All long options names shall begin with two dashes (``--``) and use a single dash
(``-``) internally between words (``--like-this``). Underscores (``_``) shall not
be used in option names. be used in option names.
* Authentication options conform to the common CLI authentication guidelines in * Authentication options conform to the common CLI authentication guidelines in
:ref:`authentication`. :ref:`authentication`.
For example, :code:`--os-username` can be set from the environment via For example, ``--os-username`` can be set from the environment via
:code:`OS_USERNAME`. ``OS_USERNAME``.
--help ``--help``
++++++ ++++++++++
The standard :code:`--help` global option displays the documentation for invoking The standard ``--help`` global option displays the documentation for invoking
the program and a list of the available commands on standard output. All other the program and a list of the available commands on standard output. All other
options and commands are ignored when this is present. The traditional short options and commands are ignored when this is present. The traditional short
form help option (:code:`-h`) is also available. form help option (``-h``) is also available.
--version ``--version``
+++++++++ +++++++++++++
The standard :code:`--version` option displays the name and version on standard The standard ``--version`` option displays the name and version on standard
output. All other options and commands are ignored when this is present. output. All other options and commands are ignored when this is present.
Command Object(s) and Action Objects and Actions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
Commands consist of an object described by one or more words followed by an action. Commands that require two objects have the primary object ahead of the action and the secondary object after the action. Any positional arguments identifying the objects shall appear in the same order as the objects. In badly formed English it is expressed as "(Take) object1 (and perform) action (using) object2 (to it)." Commands consist of an object, described by one or more words, followed by an
action. ::
<object-1> <action> [<object-2>] <object> <action>
Examples: For example:
* :code:`group add user <group> <user>` * ``group create``
* :code:`volume type list` # Note that :code:`volume type` is a two-word * ``server set``
single object * ``volume type list``
The :code:`help` command is unique as it appears in front of a normal command (note that ``volume type`` is a two-word single object)
and displays the help text for that command rather than execute it.
Some commands require two objects. These commands have the primary object ahead of the
action and the secondary object after the action. In badly formed English it is
expressed as "(Take) object-1 (and perform) action (using) object-2 (to it)." ::
<object-1> <action> <object-2>
For example:
* ``group add user``
* ``aggregate add host``
* ``image remove project``
Object names are always specified in command in their singular form. This is Object names are always specified in command in their singular form. This is
contrary to natural language use. contrary to natural language use.
Command Arguments and Options ``help``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++++++++
The ``help`` command is unique as it appears in front of a normal command
and displays the help text for that command rather than execute it.
Arguments
~~~~~~~~~
Commands that interact with a specific instance of an object should accept a
single argument. This argument should be a name or identifier for the object.
::
<object> <action> [<name-or-id>]
For example:
* ``group create <group>``
* ``server set <server>``
(note that ``volume type`` is a two-word single object)
For commands that require two objects, the commands should accept two
arguments when interacting with specific instances of the two objects. These
arguments should appear in the same order as the objects. ::
<object-1> <action> <object-2> [<object-1-name-or-id> <object-2-name-or-id>]
For example:
* ``group add user <group> <user>``
* ``aggregate add host <aggregate> <host>``
* ``image remove project <image> <project>``
Options
~~~~~~~
Each command may have its own set of options distinct from the global options. Each command may have its own set of options distinct from the global options.
They follow the same style as the global options and always appear between They follow the same style as the global options and always appear between
the command and any positional arguments the command requires. the command and any arguments the command requires.
Command options shall only have long names. The small range of available Command options should only have long names. The small range of available short
short names makes it hard for a single short option name to have a consistent names makes it hard for a single short option name to have a consistent meaning
meaning across multiple commands. across multiple commands.
Option Forms Option Forms
++++++++++++ ++++++++++++
* **boolean**: boolean options shall use a form of :code:`--<true>|--<false>` * **datetime**: Datetime options shall accept a value in `ISO-8061`__ format.
(preferred) or :code:`--<option>|--no-<option>`. For example, the For example, you can list servers last modified before a given date using
:code:`enabled` state of a project is set with :code:`--enable|--disable`. ``--changes-before``. ::
server list --changes-before 2020-01-01T12:30:00+00:00
* **list**: List options shall be passed via multiple options rather than as
a single delimited option. For example, you can set multiple properties on a
compute flavor using multiple ``--property`` options. ::
flavor set --property quota:read_bytes_sec=10240000 \
--property quota:write_bytes_sec=10240000 \
<flavor>
* **boolean**: Boolean options shall use a form of ``--<true>|--<false>``
(preferred) or ``--<option>|--no-<option>``. These must be mutually
exclusive and should be adjective rather than verbs. For example, the
``enabled`` state of a project is set with ``--enable|--disable``. ::
project set --enable <project>
.. __: https://en.wikipedia.org/wiki/ISO_8601
Command Output Command Output
-------------- --------------
The default command output is pretty-printed using the Python The default command output is pretty-printed using the Python
:code:`prettytable` module. ``prettytable`` module.
Machine-parsable output format may be specified with the :code:`--format` Machine-parsable output format may be specified with the ``--format``
option to :code:`list` and :code:`show` commands. :code:`list` commands option to ``list`` and ``show`` commands. ``list`` commands
have an option (:code:`--format csv`) for CSV output and :code:`show` commands have an option (``--format csv``) for CSV output and ``show`` commands
have an option (:code:`--format shell`) for the shell variable assignment have an option (``--format shell``) for the shell variable assignment
syntax of :code:`var="value"`. In both cases, all data fields are quoted with `"` syntax of ``var="value"``. In both cases, all data fields are quoted with ``"``
Help Commands Help Commands
------------- -------------
@ -278,19 +360,292 @@ Help Commands
The help system is considered separately due to its special status The help system is considered separately due to its special status
among the commands. Rather than performing tasks against a system, it among the commands. Rather than performing tasks against a system, it
provides information about the commands available to perform those provides information about the commands available to perform those
tasks. The format of the :code:`help` command therefore varies from the tasks. The format of the ``help`` command therefore varies from the
form for other commands in that the :code:`help` command appears in front form for other commands in that the ``help`` command appears in front
of the first object in the command. of the first object in the command.
The options :code:`--help` and :code:`-h` display the global options and a The options ``--help`` and ``-h`` display the global options and a
list of the supported commands. Note that the commands shown depend on the API list of the supported commands. Note that the commands shown depend on the API
versions that are in effect; i.e. if :code:`--os-identity-api-version=3` is versions that are in effect; i.e. if ``--os-identity-api-version=3`` is
present Identity API v3 commands are shown. present Identity API v3 commands are shown.
Common Actions
==============
There are a number of common actions or patterns in use across OpenStackClient.
When adding new commands, they should aim to match one of these action formats.
``create``
----------
``create`` will create a new instance of ``<object>``. Only a name should be
accepted as an argument. All other required and optional information
should be provided as options. If a name is not required, it can be marked as
optional. If it is not possible to specify a name when creating a new instance,
no arguments should be accepted. ::
<object> create <name>
For example:
* ``flavor create <name>`` (compute flavors require a name)
* ``volume create [<name>] ...`` (block storage volumes don't *need* names)
* ``consumer create ...`` (identity consumers don't have names)
* ``container create --public <name>`` (additional information should be
provided as options)
``show``
--------
``show`` will fetch a single instance of ``object``. Only a name or identifier
should be accepted as a argument. Any filters or additional information should
be provided as options. Where names are not unique or an instance is not found,
an error must be shown so the user can try again using a unique or valid ID,
respectively. ::
<object> show <name-or-id>
For example:
* ``server show <name-or-id>`` (compute servers have names or IDs and can be
referenced by both)
* ``consumer show <id>`` (identity consumers only have IDs, not names)
* ``server show --topology <name-or-id>`` (additional information should be
provided as options)
``list``
--------
``list`` will list multiple instances of ``object``. No arguments should be
accepted. Any filters or pagination requests should be requested via option
arguments. ::
<object> list
For example:
* ``image list`` (no arguments should be accepted)
* ``server list --status ACTIVE`` (filters should be provided as option
arguments)
``delete``
----------
``delete`` will delete one or more instances of ``object``. Where possible,
this command should handle deleting instances of ``object`` by either name or
ID. Where names are not unique or an instance is not found, the command should
continue deleting any other instances requested before returning an error
indicating the instances that failed to delete. ::
<object> delete <name-or-id> [<name-or-id> ...]
For example:
* ``network delete <name-or-id>``
* ``region delete <name-or-id>``
``set``, ``unset``
------------------
``set`` and ``unset`` will add or remove one or more attributes of an instance
of ``object``, respectively. Only a name or identifier should be accepted as a
argument. All other information should be provided as option
arguments. Where names are not unique or an instance is not found, an error
must be shown so the user can try again using a unique or valid ID,
respectively. This command may result in multiple API calls but it must not
result in the creation or modification of child object. ::
<object> set <name-or-id>
For example:
* ``network set <name-or-id>``
* ``floating ip unset --port <port> <name-or-id>`` (additional information
should be provided as options)
``add``, ``remove``
-------------------
``add`` and ``remove`` will associate or disassociate a child object with a
parent object. Only a name or identifier for both parent and child objects
should be accepted as arguments. All other information should be provided as
options. Where names are not unique or an instance is not found, an error must
be shown so the user can try again using a unique or valid ID, respectively. ::
<parent-object> add <child-object> <parent-name-or-id> <child-name-or-id>
<parent-object> remove <child-object> <parent-name-or-id> <child-name-or-id>
For example:
* ``aggregate add host <aggregate-name-or-id> <host>``
* ``consistency group add volume <consistency-group-name-or-id> <volume-name-or-id>``
Other actions
-------------
There are other actions that do not fit neatly into any of the above actions.
Typically, these are used where an action would create a child object but that
child object is only exposed as part of the parent object. They are also used
where fitting the action into one of the above actions, particularly ``set``,
would be deemed to be confusing or otherwise inappropriate. These are permitted
once this has been discussed among reviewers and context provided in either the
commit message or via comments in the code.
For example:
* ``server ssh`` (this would not naturally fit into any of the other actions)
* ``server migrate`` (this results in the creation of a server migration record
and could be implemented as ``server migration create`` but this feels
unnatural)
* ``server migration confirm`` (this could be implemented as ``server migration
set --confirm`` but this feels unnatural)
* ``volume backup record export`` (this could be implemented as ``volume backup
record show --exportable`` but this feels unnatural)
.. note::
The guidelines below are best practices but exceptions do exist in
OpenStackClient and in various plugins. Where possible, these exceptions
should be addressed over time.
API versioning
==============
OpenStackClient will strive to behave sensibly for services that version their
API. The API versioning schemes in use vary between services and have evolved
since the early days of OpenStack. There are two types of API versioning to
consider: the major version and the minor version. Today, most OpenStack
services have settled on a single major API version and have chosen to evolve
the API without bumping the major API version any further. There are three API
"minor" versioning schemes in common use.
.. rubric:: Per-release versions
This is used by the Image service (glance). All changes to the API during a
given release cycle are gathered into a single new API version. As such, the
API version will increase at most once per release. You can continue to request
older versions.
Example:
.. list-table:: Image (glance) API versions per release
* - Release
- Supported 2.x API versions
* - Grizzly
- 2.0 - 2.1
* - Havana
- 2.0 - 2.2
* - Kilo
- 2.0 - 2.3
* - ...
- ...
.. rubric:: Microversions
This is used by multiple services including the Compute service (nova), Block
Storage service (cinder), and Shared Filesystem service (manila). Each change
to the API will result in a new API version. As such, the API version can
increase multiple times per release. You can continue to request older
versions.
Example:
.. list-table:: Compute (nova) API versions per release
* - Release
- Supported 2.x API versions
* - Kilo
- 2.1 - 2.3
* - Liberty
- 2.1 - 2.12
* - Mitaka
- 2.1 - 2.25
* - ...
- ...
.. rubric:: Extensions
This is used by the Networking service (neutron). It's a versioning scheme that
doesn't use API versions. Instead, it exposes a list of available extensions.
An extension can add, remove or modify features and vendor-specific
functionality to the API. This can include API resources/routes as well as new
fields in API requests and responses. If you want to depend on a feature added
by an extension, you should check if the extension is present.
Major API version support
-------------------------
Major API version support has become less important over time as the various
OpenStack services have chosen to focus on the "minor" versioning mechanisms
described above. However, OpenStackClient aims to support **all** OpenStack
clouds, not just those running the most recent OpenStack release. This means it
must aim to support older major API versions that have since been removed from
the services in question. For example, the Volume service's (cinder) v2 API was
deprecated in cinder 11.0.0 (Pike) and was removed in cinder 19.0.0 (Xena),
however, OpenStackClient continues to support this API since not all OpenStack
deployments have updated or will update to Xena or later. This should remain
the case for as long as this support is technically feasible.
.. note::
While OpenStackClient will continue to support existing command
implementations for older APIs, there is no requirement to add **new**
commands that implement support for deprecated or removed APIs.
OpenStackClient provides different command implementations depending on the API
version used. On startup, OpenStackClient will attempt to identify the API
version using the service catalog. Where a service provides multiple API major
versions, OpenStackClient defaults to the latest one. This can be configured by
the user using options (``--os-{service}-api-version``), environment variables
(``OS_{service}_API_VERSION``) or configuration in the ``clouds.yaml`` file.
Minor API version and extension support
---------------------------------------
As most services implement some form of versioning and use this to both add new
functionality and to modify or remove existing functionality, it is imperative
that OpenStackClient provides a mechanism to configure the API version used.
Unlike major API versions, support for API microversions or API extensions is
implemented via logic in the command itself. OpenStackClient commands should
indicate the minimum or maximum API microversion or the API extension required
for given actions and options in the help string for same. Where a user
attempts to use a feature that requires a particular microversion or extension
that the service does not support, OpenStackClient should fail with an error
message describing these requirements. Like API versions, the requested can be
configured by the user using options (``--os-{service}-api-version``),
environment variables (``OS_{service}_API_VERSION``) or configuration in
``clouds.yaml`` file.
.. important::
Historically, OpenStackClient has defaulted to the lowest supported
microversion for each service. This was not by design but rather a side
effect of relying on legacy clients who implement this behavior.
openstacksdk does not implement this behavior and instead auto-negotiates a
version based on the versions that SDK knows about. For now, this means we
have some commands that require explicit microversion configuration to get
the latest and greatest behavior, while others will handle this
transparently. For humans, this should not matter. For scripts, which are
more fragile, it is recommended that an explicit microversion is always
requested.
Examples Examples
======== ========
The following examples depict common command and output formats expected to be produces by the OpenStack client. The following examples depict common command and output formats expected to be
produces by the OpenStackClient.
Authentication Authentication
-------------- --------------
@ -342,7 +697,7 @@ Using environment variables:
Machine Output Format Machine Output Format
--------------------- ---------------------
Using the csv output format with a list command: Using the CSV output format with a list command:
.. code-block:: bash .. code-block:: bash
@ -351,7 +706,7 @@ Using the csv output format with a list command:
"ead97d84-6988-47fc-9637-3564fc36bc4b","appweb01","ACTIVE","10.4.128.13" "ead97d84-6988-47fc-9637-3564fc36bc4b","appweb01","ACTIVE","10.4.128.13"
Using the show command options of shell output format and adding a prefix of Using the show command options of shell output format and adding a prefix of
:code:`my_` to avoid collisions with existing environment variables: ``my_`` to avoid collisions with existing environment variables:
.. code-block:: bash .. code-block:: bash

View file

@ -11,7 +11,6 @@
command-wrappers command-wrappers
command-errors command-errors
command-logs command-logs
specs/commands
plugins plugins
humaninterfaceguide humaninterfaceguide
api/modules api/modules

View file

@ -26,32 +26,26 @@ The following is a list of projects that are an OpenStackClient plugin.
- gnocchiclient - gnocchiclient
- osc-placement - osc-placement
- python-barbicanclient - python-barbicanclient
- python-cyborgclient
- python-designateclient - python-designateclient
- python-heatclient - python-heatclient
- python-ironicclient - python-ironicclient
- python-ironic-inspector-client - python-ironic-inspector-client
- python-magnumclient
- python-manilaclient
- python-mistralclient - python-mistralclient
- python-muranoclient - python-neutronclient\*\*
- python-neutronclient\*\*\*
- python-octaviaclient - python-octaviaclient
- python-rsdclient
- python-saharaclient
- python-senlinclient
- python-tripleoclient\*\*
- python-troveclient - python-troveclient
- python-watcherclient - python-watcherclient
- python-zaqarclient - python-zaqarclient
- python-zunclient - python-zunclient
\*\* Note that some clients are not listed in global-requirements. \*\* Project contains advanced network services.
\*\*\* Project contains advanced network services.
The following is a list of projects that are not an OpenStackClient plugin. The following is a list of projects that are not an OpenStackClient plugin.
- python-magnumclient
- python-monascaclient - python-monascaclient
- python-solumclient
Implementation Implementation
============== ==============

View file

@ -1,86 +0,0 @@
=======
example
=======
This is a specification for the ``example`` command object. It is not intended
to be a complete template for new commands since other actions, options
and/or arguments may be used. You can include general specification information
before the commands below. This information could include links to related material
or descriptions of similar commands.
[example API name] [example API version]
example create
--------------
Create new example
.. program:: example create
.. code:: bash
openstack example create
<name>
.. describe:: <name>
New example name
example delete
--------------
Delete example(s)
.. program:: example delete
.. code:: bash
openstack example delete
<example> [<example> ...]
.. describe:: <example>
Example(s) to delete (name or ID)
example list
------------
List examples
.. program:: example list
.. code:: bash
openstack example list
example set
-----------
Set example properties
.. program:: example set
.. code:: bash
openstack example set
[--name <new-name>]
<example>
.. option:: --name <new-name>
New example name
.. describe:: <example>
Example to modify (name or ID)
example show
------------
Display example details
.. program:: example show
.. code:: bash
openstack example show
<example>
.. describe:: <example>
Example to display (name or ID)

View file

@ -1,44 +0,0 @@
=============
Command Specs
=============
Specifications for new commands, objects and actions are listed below.
These specifications have not been implemented. See
:ref:`command-list` for implemented commands and
:ref:`command-structure` for implemented objects and actions.
It is optional to propose a specifications patch for new commands,
objects and actions here before submitting the implementation. Once your
specifications patch merges then you may proceed with the implementation.
Your implementation patches should move applicable portions of the
specifications patch to the official :ref:`command-list`
and :ref:`command-structure` documentation.
Objects Specs
-------------
Add specifications for new objects based on the ``example`` object.
Actions Specs
-------------
Add specifications for new actions based on the ``example`` action.
.. toctree::
:maxdepth: 1
network-topology
Commands Specs
--------------
Add specifications for new commands based on the commands for the
``example`` object. The ``example`` commands are not intended to
be a complete template for new commands since other actions, options
and/or arguments may be used.
.. toctree::
:glob:
:maxdepth: 2
command-objects/*

View file

@ -1,44 +0,0 @@
================
network topology
================
A **network topology** shows a topological graph about
devices which connect to the specific network. Also, it
will return availability information for each individual
device within the network as well. One other thing to note
is that it is the intention for OSC to collect data from
existing REST APIs
Network v2
network topology list
---------------------
List network topologies
.. program:: network topology list
.. code:: bash
openstack network topology list
[--project <project>]
.. option:: --project <project>
List network topologies for given project
(name or ID)
network topology show
---------------------
Show network topology details
.. program:: network topology show
.. code:: bash
openstack network topology show
<network>
.. _network_topology_show-network:
.. describe:: <network>
Show network topology for a specific network (name or ID)

View file

@ -54,16 +54,15 @@ Contributing
============ ============
OpenStackClient utilizes all of the usual OpenStack processes and requirements for OpenStackClient utilizes all of the usual OpenStack processes and requirements for
contributions. The code is hosted `on OpenStack's Git server`_. `Bug reports`_ contributions. The code is hosted `on OpenStack's Git server`_. Bug reports
may be submitted to the :code:`python-openstackclient` `Storyboard project`_. may be submitted to the :code:`python-openstackclient` `Launchpad project`_.
Code may be submitted to the :code:`openstack/python-openstackclient` project Code may be submitted to the :code:`openstack/python-openstackclient` project
using `Gerrit`_. Developers may also be found in the `IRC channel`_ using `Gerrit`_. Developers may also be found in the `IRC channel`_
``#openstack-sdks``. ``#openstack-sdks``.
.. _`on OpenStack's Git server`: https://opendev.org/openstack/python-openstackclient/ .. _`on OpenStack's Git server`: https://opendev.org/openstack/python-openstackclient/
.. _`Storyboard project`: https://storyboard.openstack.org/#!/project/openstack/python-openstackclient .. _`Launchpad project`: https://bugs.launchpad.net/python-openstackclient
.. _Gerrit: http://docs.openstack.org/infra/manual/developers.html#development-workflow .. _Gerrit: http://docs.openstack.org/infra/manual/developers.html#development-workflow
.. _Bug reports: https://storyboard.openstack.org/#!/project/975
.. _PyPi: https://pypi.org/project/python-openstackclient .. _PyPi: https://pypi.org/project/python-openstackclient
.. _tarball: http://tarballs.openstack.org/python-openstackclient .. _tarball: http://tarballs.openstack.org/python-openstackclient
.. _IRC channel: https://wiki.openstack.org/wiki/IRC .. _IRC channel: https://wiki.openstack.org/wiki/IRC

View file

@ -57,6 +57,7 @@ dump_stack_trace = False
# Generally useful stuff often found in a utils module # Generally useful stuff often found in a utils module
def env(*vars, **kwargs): def env(*vars, **kwargs):
"""Search for the first defined of possibly many env vars """Search for the first defined of possibly many env vars
@ -73,6 +74,7 @@ def env(*vars, **kwargs):
# Common Example functions # Common Example functions
def base_parser(parser): def base_parser(parser):
"""Set up some of the common CLI options """Set up some of the common CLI options
@ -128,7 +130,8 @@ def base_parser(parser):
help="Print API call timing info", help="Print API call timing info",
) )
parser.add_argument( parser.add_argument(
'-v', '--verbose', '-v',
'--verbose',
action='count', action='count',
dest='verbose_level', dest='verbose_level',
default=1, default=1,
@ -225,24 +228,22 @@ def make_session(opts, **kwargs):
) )
auth_p = auth_plugin.load_from_options(**auth_params) auth_p = auth_plugin.load_from_options(**auth_params)
session = ks_session.Session( session = ks_session.Session(auth=auth_p, **kwargs)
auth=auth_p,
**kwargs
)
return session return session
# Top-level functions # Top-level functions
def run(opts): def run(opts):
"""Default run command""" """Default run command"""
# Do some basic testing here # Do some basic testing here
sys.stdout.write("Default run command\n") sys.stdout.write("Default run command\n")
sys.stdout.write("Verbose level: %s\n" % opts.verbose_level) sys.stdout.write(f"Verbose level: {opts.verbose_level}\n")
sys.stdout.write("Debug: %s\n" % opts.debug) sys.stdout.write(f"Debug: {opts.debug}\n")
sys.stdout.write("dump_stack_trace: %s\n" % dump_stack_trace) sys.stdout.write(f"dump_stack_trace: {dump_stack_trace}\n")
def setup(): def setup():

View file

@ -94,14 +94,14 @@ def run(opts):
c_list = obj_api.container_list() c_list = obj_api.container_list()
print("Name\tCount\tBytes") print("Name\tCount\tBytes")
for c in c_list: for c in c_list:
print("%s\t%d\t%d" % (c['name'], c['count'], c['bytes'])) print(f"{c['name']}\t{c['count']}\t{c['bytes']}")
if len(c_list) > 0: if len(c_list) > 0:
# See what is in the first container # See what is in the first container
o_list = obj_api.object_list(c_list[0]['name']) o_list = obj_api.object_list(c_list[0]['name'])
print("\nObject") print("\nObject")
for o in o_list: for o in o_list:
print("%s" % o) print(f"{o}")
if __name__ == "__main__": if __name__ == "__main__":

View file

@ -87,20 +87,20 @@ def run(opts):
c_list = client_manager.object_store.container_list() c_list = client_manager.object_store.container_list()
print("Name\tCount\tBytes") print("Name\tCount\tBytes")
for c in c_list: for c in c_list:
print("%s\t%d\t%d" % (c['name'], c['count'], c['bytes'])) print(f"{c['name']}\t{c['count']}\t{c['bytes']}")
if len(c_list) > 0: if len(c_list) > 0:
# See what is in the first container # See what is in the first container
o_list = client_manager.object_store.object_list(c_list[0]['name']) o_list = client_manager.object_store.object_list(c_list[0]['name'])
print("\nObject") print("\nObject")
for o in o_list: for o in o_list:
print("%s" % o) print(f"{o}")
# Look at the compute flavors # Look at the compute flavors
flavor_list = client_manager.compute.flavors.list() flavor_list = client_manager.compute.flavors.list()
print("\nFlavors:") print("\nFlavors:")
for f in flavor_list: for f in flavor_list:
print("%s" % f) print(f"{f}")
if __name__ == "__main__": if __name__ == "__main__":

179
hacking/checks.py Normal file
View file

@ -0,0 +1,179 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import ast
import os
import re
from hacking import core
"""
Guidelines for writing new hacking checks
- Use only for python-openstackclient specific tests. OpenStack general tests
should be submitted to the common 'hacking' module.
- Pick numbers in the range O4xx. Find the current test with the highest
allocated number and then pick the next value.
"""
@core.flake8ext
def assert_no_oslo(logical_line):
"""Check for use of oslo libraries.
O400
"""
if re.match(r'(from|import) oslo_.*', logical_line):
yield (0, "0400: oslo libraries should not be used in SDK projects")
@core.flake8ext
def assert_no_duplicated_setup(logical_line, filename):
"""Check for use of various unnecessary test duplications.
O401
"""
if os.path.join('openstackclient', 'tests', 'unit') not in filename:
return
if re.match(r'self.app = .*\(self.app, self.namespace\)', logical_line):
yield (
0,
'O401: It is not necessary to create dummy Namespace objects',
)
if os.path.basename(filename) != 'fakes.py':
if re.match(
r'self.[a-z_]+_client = self.app.client_manager.*', logical_line
):
yield (
0,
"O401: Aliases for mocks of the service client are already "
"provided by the respective service's FakeClientMixin class",
)
if match := re.match(
r'self.app.client_manager.([a-z_]+) = mock.Mock', logical_line
):
service = match.group(1)
if service == 'auth_ref':
return
yield (
0,
f"O401: client_manager.{service} mocks are already provided "
f"by the {service} service's FakeClientMixin class",
)
@core.flake8ext
def assert_use_of_client_aliases(logical_line):
"""Ensure we use $service_client instead of $sdk_connection.service.
O402
"""
# we should expand the list of services as we drop legacy clients
if match := re.match(
r'self\.app\.client_manager\.sdk_connnection\.(compute|network|image)',
logical_line,
):
service = match.group(1)
yield (0, f"0402: prefer {service}_client to sdk_connection.{service}")
if match := re.match(
r'(self\.app\.client_manager\.(compute|network|image)+\.[a-z_]+) = mock.Mock', # noqa: E501
logical_line,
):
yield (
0,
f"O402: {match.group(1)} is already a mock: there's no need to "
f"assign a new mock.Mock instance.",
)
if match := re.match(
r'(self\.(compute|network|image)_client\.[a-z_]+) = mock.Mock',
logical_line,
):
yield (
0,
f"O402: {match.group(1)} is already a mock: there's no need to "
f"assign a new mock.Mock instance.",
)
class SDKProxyFindChecker(ast.NodeVisitor):
"""NodeVisitor to find ``*_client.find_*`` statements."""
def __init__(self):
self.error = False
def visit_Call(self, node):
# No need to keep visiting the AST if we already found something.
if self.error:
return
self.generic_visit(node)
if not (
isinstance(node.func, ast.Attribute)
and node.func.attr.startswith('find_') # and
# isinstance(node.func.value, ast.Attribute) and
# node.func.value.attr.endswith('_client')
):
# print(f'skipping: got {node.func}')
return
if not (
(
# handle calls like 'identity_client.find_project'
isinstance(node.func.value, ast.Name)
and node.func.value.id.endswith('client')
)
or (
# handle calls like 'self.app.client_manager.image.find_image'
isinstance(node.func.value, ast.Attribute)
and node.func.value.attr
in ('identity', 'network', 'image', 'compute')
)
):
return
if not any(kw.arg == 'ignore_missing' for kw in node.keywords):
self.error = True
@core.flake8ext
def assert_find_ignore_missing_kwargs(logical_line, filename):
"""Ensure ignore_missing is always used for ``find_*`` SDK proxy calls.
Okay: self.compute_client.find_server(foo, ignore_missing=True)
Okay: self.image_client.find_server(foo, ignore_missing=False)
Okay: self.volume_client.volumes.find(name='foo')
O403: self.network_client.find_network(parsed_args.network)
O403: self.compute_client.find_flavor(flavor_id, get_extra_specs=True)
"""
if 'tests' in filename:
return
checker = SDKProxyFindChecker()
try:
parsed_logical_line = ast.parse(logical_line)
except SyntaxError:
# let flake8 catch this itself
# https://github.com/PyCQA/flake8/issues/1948
return
checker.visit(parsed_logical_line)
if checker.error:
yield (
0,
'O403: Calls to find_* proxy methods must explicitly set '
'ignore_missing',
)

View file

@ -1,99 +0,0 @@
amqp==2.1.1
appdirs==1.3.0
asn1crypto==0.23.0
Babel==2.6.0
bcrypt==3.2.0
cachetools==2.0.0
cffi==1.14.0
cliff==3.5.0
cmd2==0.8.0
coverage==4.0
cryptography==2.7
ddt==1.0.1
debtcollector==1.2.0
decorator==4.4.1
dogpile.cache==0.6.5
eventlet==0.18.2
extras==1.0.0
fasteners==0.7.0
fixtures==3.0.0
future==0.16.0
futurist==2.1.0
greenlet==0.4.15
importlib-metadata==3.1.1
iso8601==0.1.11
Jinja2==2.10
jmespath==0.9.0
jsonpatch==1.16
jsonpointer==1.13
jsonschema==2.6.0
keystoneauth1==3.18.0
kombu==4.0.0
linecache2==1.0.0
MarkupSafe==1.1.1
mock==4.0.2
monotonic==0.6
mox3==0.20.0
msgpack-python==0.4.0
munch==2.1.0
netaddr==0.7.18
netifaces==0.10.4
openstacksdk==0.53.0
os-client-config==2.1.0
os-service-types==1.7.0
os-testr==1.0.0
osc-lib==2.3.0
oslo.concurrency==3.26.0
oslo.config==5.2.0
oslo.context==2.19.2
oslo.i18n==3.15.3
oslo.log==3.36.0
oslo.messaging==5.29.0
oslo.middleware==3.31.0
oslo.serialization==2.18.0
oslo.service==1.24.0
oslo.utils==3.33.0
oslotest==3.2.0
osprofiler==1.4.0
paramiko==2.7.1
Paste==2.0.2
PasteDeploy==1.5.0
pbr==2.0.0
pika==0.10.0
pika-pool==0.1.3
prettytable==0.7.2
pycparser==2.18
pyinotify==0.9.6
PyNaCl==1.4.0
pyparsing==2.1.0
pyperclip==1.5.27
python-cinderclient==3.3.0
python-dateutil==2.5.3
python-keystoneclient==3.22.0
python-mimeparse==1.6.0
python-novaclient==17.0.0
python-subunit==1.0.0
pytz==2013.6
PyYAML==3.13
repoze.lru==0.7
requests==2.14.2
requests-mock==1.2.0
requestsexceptions==1.2.0
rfc3986==0.3.1
Routes==2.3.1
simplejson==3.5.1
six==1.15.0
statsd==3.2.1
stestr==1.0.0
stevedore==2.0.1
tempest==17.1.0
tenacity==3.2.1
testrepository==0.0.18
testtools==2.2.0
traceback2==1.4.0
unittest2==1.1.0
urllib3==1.21.1
vine==1.1.4
WebOb==1.7.1
wrapt==1.7.0
zipp==3.4.0

View file

@ -16,12 +16,12 @@
from keystoneauth1 import exceptions as ks_exceptions from keystoneauth1 import exceptions as ks_exceptions
from keystoneauth1 import session as ks_session from keystoneauth1 import session as ks_session
from osc_lib import exceptions from osc_lib import exceptions
import simplejson as json import requests
from openstackclient.i18n import _ from openstackclient.i18n import _
class KeystoneSession(object): class KeystoneSession:
"""Wrapper for the Keystone Session """Wrapper for the Keystone Session
Restore some requests.session.Session compatibility; Restore some requests.session.Session compatibility;
@ -30,12 +30,7 @@ class KeystoneSession(object):
""" """
def __init__( def __init__(self, session=None, endpoint=None, **kwargs):
self,
session=None,
endpoint=None,
**kwargs
):
"""Base object that contains some common API objects and methods """Base object that contains some common API objects and methods
:param Session session: :param Session session:
@ -45,7 +40,7 @@ class KeystoneSession(object):
requests on this API. requests on this API.
""" """
super(KeystoneSession, self).__init__() super().__init__()
# a requests.Session-style interface # a requests.Session-style interface
self.session = session self.session = session
@ -87,11 +82,7 @@ class BaseAPI(KeystoneSession):
"""Base API""" """Base API"""
def __init__( def __init__(
self, self, session=None, service_type=None, endpoint=None, **kwargs
session=None,
service_type=None,
endpoint=None,
**kwargs
): ):
"""Base object that contains some common API objects and methods """Base object that contains some common API objects and methods
@ -104,19 +95,13 @@ class BaseAPI(KeystoneSession):
requests on this API. requests on this API.
""" """
super(BaseAPI, self).__init__(session=session, endpoint=endpoint) super().__init__(session=session, endpoint=endpoint)
self.service_type = service_type self.service_type = service_type
# The basic action methods all take a Session and return dict/lists # The basic action methods all take a Session and return dict/lists
def create( def create(self, url, session=None, method=None, **params):
self,
url,
session=None,
method=None,
**params
):
"""Create a new resource """Create a new resource
:param string url: :param string url:
@ -133,15 +118,10 @@ class BaseAPI(KeystoneSession):
# Should this move into _requests()? # Should this move into _requests()?
try: try:
return ret.json() return ret.json()
except json.JSONDecodeError: except requests.JSONDecodeError:
return ret return ret
def delete( def delete(self, url, session=None, **params):
self,
url,
session=None,
**params
):
"""Delete a resource """Delete a resource
:param string url: :param string url:
@ -152,14 +132,7 @@ class BaseAPI(KeystoneSession):
return self._request('DELETE', url, **params) return self._request('DELETE', url, **params)
def list( def list(self, path, session=None, body=None, detailed=False, **params):
self,
path,
session=None,
body=None,
detailed=False,
**params
):
"""Return a list of resources """Return a list of resources
GET ${ENDPOINT}/${PATH}?${PARAMS} GET ${ENDPOINT}/${PATH}?${PARAMS}
@ -196,7 +169,7 @@ class BaseAPI(KeystoneSession):
) )
try: try:
return ret.json() return ret.json()
except json.JSONDecodeError: except requests.JSONDecodeError:
return ret return ret
# Layered actions built on top of the basic action methods do not # Layered actions built on top of the basic action methods do not
@ -255,9 +228,7 @@ class BaseAPI(KeystoneSession):
if len(data) > 1: if len(data) > 1:
msg = _("Multiple %(resource)s exist with %(attr)s='%(value)s'") msg = _("Multiple %(resource)s exist with %(attr)s='%(value)s'")
raise exceptions.CommandError( raise exceptions.CommandError(
msg % {'resource': resource, msg % {'resource': resource, 'attr': attr, 'value': value}
'attr': attr,
'value': value}
) )
# Search by id # Search by id
@ -267,16 +238,10 @@ class BaseAPI(KeystoneSession):
return data[0] return data[0]
msg = _("No %(resource)s with a %(attr)s or ID of '%(value)s' found") msg = _("No %(resource)s with a %(attr)s or ID of '%(value)s' found")
raise exceptions.CommandError( raise exceptions.CommandError(
msg % {'resource': resource, msg % {'resource': resource, 'attr': attr, 'value': value}
'attr': attr,
'value': value}
) )
def find_bulk( def find_bulk(self, path, **kwargs):
self,
path,
**kwargs
):
"""Bulk load and filter locally """Bulk load and filter locally
:param string path: :param string path:
@ -302,11 +267,7 @@ class BaseAPI(KeystoneSession):
return ret return ret
def find_one( def find_one(self, path, **kwargs):
self,
path,
**kwargs
):
"""Find a resource by name or ID """Find a resource by name or ID
:param string path: :param string path:
@ -342,11 +303,11 @@ class BaseAPI(KeystoneSession):
""" """
try: try:
ret = self._request('GET', "/%s/%s" % (path, value)).json() ret = self._request('GET', f"/{path}/{value}").json()
except ks_exceptions.NotFound: except ks_exceptions.NotFound:
kwargs = {attr: value} kwargs = {attr: value}
try: try:
ret = self.find_one("/%s/detail" % (path), **kwargs) ret = self.find_one(f"/{path}/detail", **kwargs)
except ks_exceptions.NotFound: except ks_exceptions.NotFound:
msg = _("%s not found") % value msg = _("%s not found") % value
raise exceptions.NotFound(msg) raise exceptions.NotFound(msg)

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,7 @@ class APIv1(api.BaseAPI):
_endpoint_suffix = '/v1' _endpoint_suffix = '/v1'
def __init__(self, endpoint=None, **kwargs): def __init__(self, endpoint=None, **kwargs):
super(APIv1, self).__init__(endpoint=endpoint, **kwargs) super().__init__(endpoint=endpoint, **kwargs)
self.endpoint = self.endpoint.rstrip('/') self.endpoint = self.endpoint.rstrip('/')
self._munge_url() self._munge_url()
@ -33,11 +33,7 @@ class APIv1(api.BaseAPI):
self.endpoint = self.endpoint + self._endpoint_suffix self.endpoint = self.endpoint + self._endpoint_suffix
def image_list( def image_list(
self, self, detailed=False, public=False, private=False, **filter
detailed=False,
public=False,
private=False,
**filter
): ):
"""Get available images """Get available images

View file

@ -33,7 +33,7 @@ class APIv2(image_v1.APIv1):
private=False, private=False,
community=False, community=False,
shared=False, shared=False,
**filter **filter,
): ):
"""Get available images """Get available images

View file

@ -13,7 +13,6 @@
"""Object Store v1 API Library""" """Object Store v1 API Library"""
import io
import logging import logging
import os import os
import sys import sys
@ -33,13 +32,10 @@ class APIv1(api.BaseAPI):
"""Object Store v1 API""" """Object Store v1 API"""
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(APIv1, self).__init__(**kwargs) super().__init__(**kwargs)
def container_create( def container_create(
self, self, container=None, public=False, storage_policy=None
container=None,
public=False,
storage_policy=None
): ):
"""Create a container """Create a container
@ -62,7 +58,8 @@ class APIv1(api.BaseAPI):
headers['x-storage-policy'] = storage_policy headers['x-storage-policy'] = storage_policy
response = self.create( response = self.create(
urllib.parse.quote(container), method='PUT', headers=headers) urllib.parse.quote(container), method='PUT', headers=headers
)
data = { data = {
'account': self._find_account_id(), 'account': self._find_account_id(),
@ -92,7 +89,7 @@ class APIv1(api.BaseAPI):
marker=None, marker=None,
end_marker=None, end_marker=None,
prefix=None, prefix=None,
**params **params,
): ):
"""Get containers in an account """Get containers in an account
@ -119,7 +116,7 @@ class APIv1(api.BaseAPI):
marker=marker, marker=marker,
end_marker=end_marker, end_marker=end_marker,
prefix=prefix, prefix=prefix,
**params **params,
) )
while listing: while listing:
marker = listing[-1]['name'] marker = listing[-1]['name']
@ -128,7 +125,7 @@ class APIv1(api.BaseAPI):
marker=marker, marker=marker,
end_marker=end_marker, end_marker=end_marker,
prefix=prefix, prefix=prefix,
**params **params,
) )
if listing: if listing:
data.extend(listing) data.extend(listing)
@ -192,9 +189,7 @@ class APIv1(api.BaseAPI):
data = { data = {
'account': self._find_account_id(), 'account': self._find_account_id(),
'container': container, 'container': container,
'object_count': response.headers.get( 'object_count': response.headers.get('x-container-object-count'),
'x-container-object-count'
),
'bytes_used': response.headers.get('x-container-bytes-used'), 'bytes_used': response.headers.get('x-container-bytes-used'),
'storage_policy': response.headers.get('x-storage-policy'), 'storage_policy': response.headers.get('x-storage-policy'),
} }
@ -208,8 +203,9 @@ class APIv1(api.BaseAPI):
if 'x-container-sync-key' in response.headers: if 'x-container-sync-key' in response.headers:
data['sync_key'] = response.headers.get('x-container-sync-key') data['sync_key'] = response.headers.get('x-container-sync-key')
properties = self._get_properties(response.headers, properties = self._get_properties(
'x-container-meta-') response.headers, 'x-container-meta-'
)
if properties: if properties:
data['properties'] = properties data['properties'] = properties
@ -228,8 +224,9 @@ class APIv1(api.BaseAPI):
properties to remove from the container properties to remove from the container
""" """
headers = self._unset_properties(properties, headers = self._unset_properties(
'X-Remove-Container-Meta-%s') properties, 'X-Remove-Container-Meta-%s'
)
if headers: if headers:
self.create(urllib.parse.quote(container), headers=headers) self.create(urllib.parse.quote(container), headers=headers)
@ -259,9 +256,11 @@ class APIv1(api.BaseAPI):
# object's name in the container. # object's name in the container.
object_name_str = name if name else object object_name_str = name if name else object
full_url = "%s/%s" % (urllib.parse.quote(container), full_url = (
urllib.parse.quote(object_name_str)) f"{urllib.parse.quote(container)}/"
with io.open(object, 'rb') as f: f"{urllib.parse.quote(object_name_str)}"
)
with open(object, 'rb') as f:
response = self.create( response = self.create(
full_url, full_url,
method='PUT', method='PUT',
@ -293,8 +292,9 @@ class APIv1(api.BaseAPI):
if container is None or object is None: if container is None or object is None:
return return
self.delete("%s/%s" % (urllib.parse.quote(container), self.delete(
urllib.parse.quote(object))) f"{urllib.parse.quote(container)}/{urllib.parse.quote(object)}"
)
def object_list( def object_list(
self, self,
@ -305,7 +305,7 @@ class APIv1(api.BaseAPI):
end_marker=None, end_marker=None,
delimiter=None, delimiter=None,
prefix=None, prefix=None,
**params **params,
): ):
"""List objects in a container """List objects in a container
@ -340,7 +340,7 @@ class APIv1(api.BaseAPI):
end_marker=end_marker, end_marker=end_marker,
prefix=prefix, prefix=prefix,
delimiter=delimiter, delimiter=delimiter,
**params **params,
) )
while listing: while listing:
if delimiter: if delimiter:
@ -354,7 +354,7 @@ class APIv1(api.BaseAPI):
end_marker=end_marker, end_marker=end_marker,
prefix=prefix, prefix=prefix,
delimiter=delimiter, delimiter=delimiter,
**params **params,
) )
if listing: if listing:
data.extend(listing) data.extend(listing)
@ -394,8 +394,7 @@ class APIv1(api.BaseAPI):
response = self._request( response = self._request(
'GET', 'GET',
"%s/%s" % (urllib.parse.quote(container), f"{urllib.parse.quote(container)}/{urllib.parse.quote(object)}",
urllib.parse.quote(object)),
stream=True, stream=True,
) )
if response.status_code == 200: if response.status_code == 200:
@ -429,9 +428,10 @@ class APIv1(api.BaseAPI):
headers = self._set_properties(properties, 'X-Object-Meta-%s') headers = self._set_properties(properties, 'X-Object-Meta-%s')
if headers: if headers:
self.create("%s/%s" % (urllib.parse.quote(container), self.create(
urllib.parse.quote(object)), f"{urllib.parse.quote(container)}/{urllib.parse.quote(object)}",
headers=headers) headers=headers,
)
def object_unset( def object_unset(
self, self,
@ -451,9 +451,10 @@ class APIv1(api.BaseAPI):
headers = self._unset_properties(properties, 'X-Remove-Object-Meta-%s') headers = self._unset_properties(properties, 'X-Remove-Object-Meta-%s')
if headers: if headers:
self.create("%s/%s" % (urllib.parse.quote(container), self.create(
urllib.parse.quote(object)), f"{urllib.parse.quote(container)}/{urllib.parse.quote(object)}",
headers=headers) headers=headers,
)
def object_show( def object_show(
self, self,
@ -473,9 +474,10 @@ class APIv1(api.BaseAPI):
if container is None or object is None: if container is None or object is None:
return {} return {}
response = self._request('HEAD', "%s/%s" % response = self._request(
(urllib.parse.quote(container), 'HEAD',
urllib.parse.quote(object))) f"{urllib.parse.quote(container)}/{urllib.parse.quote(object)}",
)
data = { data = {
'account': self._find_account_id(), 'account': self._find_account_id(),
@ -484,9 +486,7 @@ class APIv1(api.BaseAPI):
'content-type': response.headers.get('content-type'), 'content-type': response.headers.get('content-type'),
} }
if 'content-length' in response.headers: if 'content-length' in response.headers:
data['content-length'] = response.headers.get( data['content-length'] = response.headers.get('content-length')
'content-length'
)
if 'last-modified' in response.headers: if 'last-modified' in response.headers:
data['last-modified'] = response.headers.get('last-modified') data['last-modified'] = response.headers.get('last-modified')
if 'etag' in response.headers: if 'etag' in response.headers:
@ -549,8 +549,9 @@ class APIv1(api.BaseAPI):
properties to remove from the account properties to remove from the account
""" """
headers = self._unset_properties(properties, headers = self._unset_properties(
'X-Remove-Account-Meta-%s') properties, 'X-Remove-Account-Meta-%s'
)
if headers: if headers:
self.create("", headers=headers) self.create("", headers=headers)
@ -596,5 +597,5 @@ class APIv1(api.BaseAPI):
properties = {} properties = {}
for k, v in headers.items(): for k, v in headers.items():
if k.lower().startswith(header_tag): if k.lower().startswith(header_tag):
properties[k[len(header_tag):]] = v properties[k[len(header_tag) :]] = v
return properties return properties

View file

@ -0,0 +1,60 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Volume v2 API Library
A collection of wrappers for deprecated Block Storage v2 APIs that are not
intentionally supported by SDK.
"""
import http
from openstack import exceptions as sdk_exceptions
from osc_lib import exceptions
# consistency groups
def find_consistency_group(compute_client, name_or_id):
"""Find the consistency group for a given name or ID
https://docs.openstack.org/api-ref/block-storage/v3/#show-a-consistency-group-s-details
:param volume_client: A volume client
:param name_or_id: The name or ID of the consistency group to look up
:returns: A consistency group object
:raises exception.NotFound: If a matching consistency group could not be
found or more than one match was found
"""
response = compute_client.get(f'/consistencygroups/{name_or_id}')
if response.status_code != http.HTTPStatus.NOT_FOUND:
# there might be other, non-404 errors
sdk_exceptions.raise_from_response(response)
return response.json()['consistencygroup']
response = compute_client.get('/consistencygroups')
sdk_exceptions.raise_from_response(response)
found = None
consistency_groups = response.json()['consistencygroups']
for consistency_group in consistency_groups:
if consistency_group['name'] == name_or_id:
if found:
raise exceptions.NotFound(
f'multiple matches found for {name_or_id}'
)
found = consistency_group
if not found:
raise exceptions.NotFound(f'{name_or_id} not found')
return found

View file

@ -0,0 +1,60 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Volume v3 API Library
A collection of wrappers for deprecated Block Storage v3 APIs that are not
intentionally supported by SDK.
"""
import http
from openstack import exceptions as sdk_exceptions
from osc_lib import exceptions
# consistency groups
def find_consistency_group(compute_client, name_or_id):
"""Find the consistency group for a given name or ID
https://docs.openstack.org/api-ref/block-storage/v3/#show-a-consistency-group-s-details
:param volume_client: A volume client
:param name_or_id: The name or ID of the consistency group to look up
:returns: A consistency group object
:raises exception.NotFound: If a matching consistency group could not be
found or more than one match was found
"""
response = compute_client.get(f'/consistencygroups/{name_or_id}')
if response.status_code != http.HTTPStatus.NOT_FOUND:
# there might be other, non-404 errors
sdk_exceptions.raise_from_response(response)
return response.json()['consistencygroup']
response = compute_client.get('/consistencygroups')
sdk_exceptions.raise_from_response(response)
found = None
consistency_groups = response.json()['consistencygroups']
for consistency_group in consistency_groups:
if consistency_group['name'] == name_or_id:
if found:
raise exceptions.NotFound(
f'multiple matches found for {name_or_id}'
)
found = consistency_group
if not found:
raise exceptions.NotFound(f'{name_or_id} not found')
return found

View file

@ -0,0 +1,27 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from cliff import lister
from cliff import show
from osc_lib.command import command
from openstackclient import shell
class Command(command.Command):
app: shell.OpenStackShell
class Lister(Command, lister.Lister): ...
class ShowOne(Command, show.ShowOne): ...

View file

@ -16,36 +16,30 @@
import copy import copy
import logging import logging
from novaclient import exceptions as nova_exceptions from openstack import exceptions as sdk_exceptions
from osc_lib.command import command
from osc_lib import utils from osc_lib import utils
from openstackclient import command
from openstackclient.i18n import _ from openstackclient.i18n import _
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
def _xform_common_availability_zone(az, zone_info):
if hasattr(az, 'zoneState'):
zone_info['zone_status'] = ('available' if az.zoneState['available']
else 'not available')
if hasattr(az, 'zoneName'):
zone_info['zone_name'] = az.zoneName
zone_info['zone_resource'] = ''
def _xform_compute_availability_zone(az, include_extra): def _xform_compute_availability_zone(az, include_extra):
result = [] result = []
zone_info = {} zone_info = {
_xform_common_availability_zone(az, zone_info) 'zone_name': az.name,
'zone_status': (
'available' if az.state['available'] else 'not available'
),
}
if not include_extra: if not include_extra:
result.append(zone_info) result.append(zone_info)
return result return result
if hasattr(az, 'hosts') and az.hosts: if az.hosts:
for host, services in az.hosts.items(): for host, services in az.hosts.items():
host_info = copy.deepcopy(zone_info) host_info = copy.deepcopy(zone_info)
host_info['host_name'] = host host_info['host_name'] = host
@ -53,10 +47,11 @@ def _xform_compute_availability_zone(az, include_extra):
for svc, state in services.items(): for svc, state in services.items():
info = copy.deepcopy(host_info) info = copy.deepcopy(host_info)
info['service_name'] = svc info['service_name'] = svc
info['service_status'] = '%s %s %s' % ( info['service_status'] = '{} {} {}'.format(
'enabled' if state['active'] else 'disabled', 'enabled' if state['active'] else 'disabled',
':-)' if state['available'] else 'XXX', ':-)' if state['available'] else 'XXX',
state['updated_at']) state['updated_at'],
)
result.append(info) result.append(info)
else: else:
zone_info['host_name'] = '' zone_info['host_name'] = ''
@ -68,8 +63,12 @@ def _xform_compute_availability_zone(az, include_extra):
def _xform_volume_availability_zone(az): def _xform_volume_availability_zone(az):
result = [] result = []
zone_info = {} zone_info = {
_xform_common_availability_zone(az, zone_info) 'zone_name': az.name,
'zone_status': (
'available' if az.state['available'] else 'not available'
),
}
result.append(zone_info) result.append(zone_info)
return result return result
@ -77,11 +76,11 @@ def _xform_volume_availability_zone(az):
def _xform_network_availability_zone(az): def _xform_network_availability_zone(az):
result = [] result = []
zone_info = {} zone_info = {}
zone_info['zone_name'] = getattr(az, 'name', '') zone_info['zone_name'] = az.name
zone_info['zone_status'] = getattr(az, 'state', '') zone_info['zone_status'] = az.state
if 'unavailable' == zone_info['zone_status']: if 'unavailable' == zone_info['zone_status']:
zone_info['zone_status'] = 'not available' zone_info['zone_status'] = 'not available'
zone_info['zone_resource'] = getattr(az, 'resource', '') zone_info['zone_resource'] = az.resource
result.append(zone_info) result.append(zone_info)
return result return result
@ -90,7 +89,7 @@ class ListAvailabilityZone(command.Lister):
_description = _("List availability zones and their status") _description = _("List availability zones and their status")
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ListAvailabilityZone, self).get_parser(prog_name) parser = super().get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--compute', '--compute',
action='store_true', action='store_true',
@ -120,29 +119,30 @@ class ListAvailabilityZone(command.Lister):
def _get_compute_availability_zones(self, parsed_args): def _get_compute_availability_zones(self, parsed_args):
compute_client = self.app.client_manager.compute compute_client = self.app.client_manager.compute
try: try:
data = compute_client.availability_zones.list() data = list(compute_client.availability_zones(details=True))
except nova_exceptions.Forbidden: # policy doesn't allow except sdk_exceptions.ForbiddenException: # policy doesn't allow
try: try:
data = compute_client.availability_zones.list(detailed=False) data = compute_client.availability_zones(details=False)
except Exception: except Exception:
raise raise
# Argh, the availability zones are not iterable...
result = [] result = []
for zone in data: for zone in data:
result += _xform_compute_availability_zone(zone, parsed_args.long) result += _xform_compute_availability_zone(zone, parsed_args.long)
return result return result
def _get_volume_availability_zones(self, parsed_args): def _get_volume_availability_zones(self, parsed_args):
volume_client = self.app.client_manager.volume volume_client = self.app.client_manager.sdk_connection.volume
data = [] data = []
try: try:
data = volume_client.availability_zones.list() data = list(volume_client.availability_zones())
except Exception as e: except Exception as e:
LOG.debug('Volume availability zone exception: %s', e) LOG.debug('Volume availability zone exception: %s', e)
if parsed_args.volume: if parsed_args.volume:
message = _("Availability zones list not supported by " message = _(
"Block Storage API") "Availability zones list not supported by "
"Block Storage API"
)
LOG.warning(message) LOG.warning(message)
result = [] result = []
@ -154,13 +154,15 @@ class ListAvailabilityZone(command.Lister):
network_client = self.app.client_manager.network network_client = self.app.client_manager.network
try: try:
# Verify that the extension exists. # Verify that the extension exists.
network_client.find_extension('Availability Zone', network_client.find_extension(
ignore_missing=False) 'Availability Zone', ignore_missing=False
)
except Exception as e: except Exception as e:
LOG.debug('Network availability zone exception: ', e) LOG.debug('Network availability zone exception: ', e)
if parsed_args.network: if parsed_args.network:
message = _("Availability zones list not supported by " message = _(
"Network API") "Availability zones list not supported by Network API"
)
LOG.warning(message) LOG.warning(message)
return [] return []
@ -170,17 +172,21 @@ class ListAvailabilityZone(command.Lister):
return result return result
def take_action(self, parsed_args): def take_action(self, parsed_args):
columns: tuple[str, ...] = ('Zone Name', 'Zone Status')
if parsed_args.long: if parsed_args.long:
columns = ('Zone Name', 'Zone Status', 'Zone Resource', columns += (
'Host Name', 'Service Name', 'Service Status') 'Zone Resource',
else: 'Host Name',
columns = ('Zone Name', 'Zone Status') 'Service Name',
'Service Status',
)
# Show everything by default. # Show everything by default.
show_all = (not parsed_args.compute and show_all = (
not parsed_args.volume and not parsed_args.compute
not parsed_args.network) and not parsed_args.volume
and not parsed_args.network
)
result = [] result = []
if parsed_args.compute or show_all: if parsed_args.compute or show_all:
@ -190,7 +196,7 @@ class ListAvailabilityZone(command.Lister):
if parsed_args.network or show_all: if parsed_args.network or show_all:
result += self._get_network_availability_zones(parsed_args) result += self._get_network_availability_zones(parsed_args)
return (columns, return (
(utils.get_dict_properties( columns,
s, columns (utils.get_dict_properties(s, columns) for s in result),
) for s in result)) )

View file

@ -15,18 +15,29 @@
"""Manage access to the clients, including authenticating when needed.""" """Manage access to the clients, including authenticating when needed."""
import argparse
from collections.abc import Callable
import importlib import importlib
import logging import logging
import sys import sys
import typing as ty
from osc_lib.cli import client_config
from osc_lib import clientmanager from osc_lib import clientmanager
from osc_lib import shell from osc_lib import shell
import stevedore import stevedore
if ty.TYPE_CHECKING:
from keystoneauth1 import access as ksa_access
from openstack.compute.v2 import _proxy as compute_proxy
from openstack.image.v2 import _proxy as image_proxy
from openstack.network.v2 import _proxy as network_proxy
from openstackclient.api import object_store_v1
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
PLUGIN_MODULES = [] PLUGIN_MODULES: list[ty.Any] = []
USER_AGENT = 'python-openstackclient' USER_AGENT = 'python-openstackclient'
@ -39,11 +50,23 @@ class ClientManager(clientmanager.ClientManager):
in osc-lib so we need to maintain a transition period. in osc-lib so we need to maintain a transition period.
""" """
# A simple incrementing version for the plugin to know what is available if ty.TYPE_CHECKING:
PLUGIN_INTERFACE_VERSION = "2" # we know this will be set by us and will not be nullable
auth_ref: ksa_access.AccessInfo
# Let the commands set this # this is a hack to keep mypy happy: the actual attributes are set in
_auth_required = False # get_plugin_modules below
# TODO(stephenfin): Change the types of identity and volume once we've
# migrated everything to SDK. Hopefully by then we'll have figured out
# how to statically distinguish between the v2 and v3 versions of both
# services...
# TODO(stephenfin): We also need to migrate object storage...
compute: compute_proxy.Proxy
identity: ty.Any
image: image_proxy.Proxy
network: network_proxy.Proxy
object_store: object_store_v1.APIv1
volume: ty.Any
def __init__( def __init__(
self, self,
@ -51,7 +74,7 @@ class ClientManager(clientmanager.ClientManager):
api_version=None, api_version=None,
pw_func=None, pw_func=None,
): ):
super(ClientManager, self).__init__( super().__init__(
cli_options=cli_options, cli_options=cli_options,
api_version=api_version, api_version=api_version,
pw_func=pw_func, pw_func=pw_func,
@ -77,42 +100,58 @@ class ClientManager(clientmanager.ClientManager):
# CloudConfig.__init__() and we'll die if it was not # CloudConfig.__init__() and we'll die if it was not
# passed. # passed.
if ( if (
self._auth_required and self._auth_required
self._cli_options._openstack_config is not None and self._cli_options._openstack_config is not None
): ):
self._cli_options._openstack_config._pw_callback = \ if not isinstance(
self._cli_options._openstack_config, client_config.OSC_Config
):
# programmer error
raise TypeError('unexpected type for _openstack_config')
self._cli_options._openstack_config._pw_callback = (
shell.prompt_for_password shell.prompt_for_password
)
try: try:
self._cli_options._auth = \ # We might already get auth from SDK caching
self._cli_options._openstack_config.load_auth_plugin( if not self._cli_options._auth:
self._cli_options.config, self._cli_options._auth = (
self._cli_options._openstack_config.load_auth_plugin(
self._cli_options.config,
)
) )
except TypeError as e: except TypeError as e:
self._fallback_load_auth_plugin(e) self._fallback_load_auth_plugin(e)
return super(ClientManager, self).setup_auth() return super().setup_auth()
def _fallback_load_auth_plugin(self, e): def _fallback_load_auth_plugin(self, e):
# NOTES(RuiChen): Hack to avoid auth plugins choking on data they don't # NOTES(RuiChen): Hack to avoid auth plugins choking on data they don't
# expect, delete fake token and endpoint, then try to # expect, delete fake token and endpoint, then try to
# load auth plugin again with user specified options. # load auth plugin again with user specified options.
# We know it looks ugly, but it's necessary. # We know it looks ugly, but it's necessary.
if self._cli_options.config['auth']['token'] == 'x': if self._cli_options.config['auth']['token'] == 'x': # noqa: S105
# restore original auth_type # restore original auth_type
self._cli_options.config['auth_type'] = \ self._cli_options.config['auth_type'] = self._original_auth_type
self._original_auth_type
del self._cli_options.config['auth']['token'] del self._cli_options.config['auth']['token']
del self._cli_options.config['auth']['endpoint'] del self._cli_options.config['auth']['endpoint']
self._cli_options._auth = \
if not isinstance(
self._cli_options._openstack_config, client_config.OSC_Config
):
# programmer error
raise TypeError('unexpected type for _openstack_config')
self._cli_options._auth = (
self._cli_options._openstack_config.load_auth_plugin( self._cli_options._openstack_config.load_auth_plugin(
self._cli_options.config, self._cli_options.config,
) )
)
else: else:
raise e raise e
def is_network_endpoint_enabled(self): def is_network_endpoint_enabled(self):
"""Check if the network endpoint is enabled""" """Check if the network endpoint is enabled"""
# NOTE(dtroyer): is_service_available() can also return None if # NOTE(dtroyer): is_service_available() can also return None if
# there is no Service Catalog, callers here are # there is no Service Catalog, callers here are
# not expecting that so fold None into True to # not expecting that so fold None into True to
@ -121,55 +160,72 @@ class ClientManager(clientmanager.ClientManager):
def is_compute_endpoint_enabled(self): def is_compute_endpoint_enabled(self):
"""Check if Compute endpoint is enabled""" """Check if Compute endpoint is enabled"""
return self.is_service_available('compute') is not False return self.is_service_available('compute') is not False
def is_volume_endpoint_enabled(self, volume_client): # TODO(stephenfin): Drop volume_client argument in OSC 8.0 or later.
def is_volume_endpoint_enabled(self, volume_client=None):
"""Check if volume endpoint is enabled""" """Check if volume endpoint is enabled"""
# NOTE(jcross): Cinder did some interesting things with their service # We check against the service type and all aliases defined by the
# name so we need to figure out which version to look # Service Types Authority
# for when calling is_service_available() # https://service-types.openstack.org/service-types.json
volume_version = volume_client.api_version.ver_major return (
if self.is_service_available( self.is_service_available('block-storage') is not False
"volumev%s" % volume_version) is not False: or self.is_service_available('volume') is not False
return True or self.is_service_available('volumev3') is not False
elif self.is_service_available('volume') is not False: or self.is_service_available('volumev2') is not False
return True or self.is_service_available('block-store') is not False
else: )
return False
# Plugin Support # Plugin Support
ArgumentParserT = ty.TypeVar('ArgumentParserT', bound=argparse.ArgumentParser)
@ty.runtime_checkable # Optional: allows usage with isinstance()
class PluginModule(ty.Protocol):
DEFAULT_API_VERSION: str
API_VERSION_OPTION: str
API_NAME: str
API_VERSIONS: tuple[str]
make_client: Callable[..., ty.Any]
build_option_parser: Callable[[ArgumentParserT], ArgumentParserT]
check_api_version: Callable[[str], bool]
def _on_load_failure_callback(
manager: stevedore.ExtensionManager,
ep: importlib.metadata.EntryPoint,
err: BaseException,
) -> None:
sys.stderr.write(
f"WARNING: Failed to import plugin {ep.group}:{ep.name}: {err}.\n"
)
def get_plugin_modules(group): def get_plugin_modules(group):
"""Find plugin entry points""" """Find plugin entry points"""
mod_list = [] mod_list = []
mgr = stevedore.ExtensionManager(group) mgr: stevedore.ExtensionManager[PluginModule]
mgr = stevedore.ExtensionManager(
group, on_load_failure_callback=_on_load_failure_callback
)
for ep in mgr: for ep in mgr:
LOG.debug('Found plugin %s', ep.name) LOG.debug('Found plugin %s', ep.name)
# Different versions of stevedore use different module_name = ep.entry_point.module
# implementations of EntryPoint from other libraries, which
# are not API-compatible.
try:
module_name = ep.entry_point.module_name
except AttributeError:
try:
module_name = ep.entry_point.module
except AttributeError:
module_name = ep.entry_point.value
try: try:
module = importlib.import_module(module_name) module = importlib.import_module(module_name)
except Exception as err: except Exception as err:
sys.stderr.write( sys.stderr.write(
"WARNING: Failed to import plugin %s: %s.\n" % (ep.name, err)) f"WARNING: Failed to import plugin "
f"{ep.module_name}:{ep.name}: {err}.\n"
)
continue continue
mod_list.append(module) mod_list.append(module)
init_func = getattr(module, 'Initialize', None)
if init_func:
init_func('x')
# Add the plugin to the ClientManager # Add the plugin to the ClientManager
setattr( setattr(
@ -196,6 +252,8 @@ PLUGIN_MODULES = get_plugin_modules(
'openstack.cli.base', 'openstack.cli.base',
) )
# Append list of external plugin modules # Append list of external plugin modules
PLUGIN_MODULES.extend(get_plugin_modules( PLUGIN_MODULES.extend(
'openstack.cli.extension', get_plugin_modules(
)) 'openstack.cli.extension',
)
)

View file

@ -14,8 +14,8 @@
"""Configuration action implementations""" """Configuration action implementations"""
from keystoneauth1.loading import base from keystoneauth1.loading import base
from osc_lib.command import command
from openstackclient import command
from openstackclient.i18n import _ from openstackclient.i18n import _
REDACTED = "<redacted>" REDACTED = "<redacted>"
@ -27,7 +27,7 @@ class ShowConfiguration(command.ShowOne):
auth_required = False auth_required = False
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ShowConfiguration, self).get_parser(prog_name) parser = super().get_parser(prog_name)
mask_group = parser.add_mutually_exclusive_group() mask_group = parser.add_mutually_exclusive_group()
mask_group.add_argument( mask_group.add_argument(
"--mask", "--mask",
@ -45,7 +45,6 @@ class ShowConfiguration(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
info = self.app.client_manager.get_configuration() info = self.app.client_manager.get_configuration()
# Assume a default secret list in case we do not have an auth_plugin # Assume a default secret list in case we do not have an auth_plugin
@ -54,7 +53,8 @@ class ShowConfiguration(command.ShowOne):
if getattr(self.app.client_manager, "auth_plugin_name", None): if getattr(self.app.client_manager, "auth_plugin_name", None):
auth_plg_name = self.app.client_manager.auth_plugin_name auth_plg_name = self.app.client_manager.auth_plugin_name
secret_opts = [ secret_opts = [
o.dest for o in base.get_plugin_options(auth_plg_name) o.dest
for o in base.get_plugin_options(auth_plg_name)
if o.secret if o.secret
] ]
@ -63,4 +63,9 @@ class ShowConfiguration(command.ShowOne):
value = REDACTED value = REDACTED
info['auth.' + key] = value info['auth.' + key] = value
if parsed_args.mask:
for secret_opt in secret_opts:
if secret_opt in info:
info[secret_opt] = REDACTED
return zip(*sorted(info.items())) return zip(*sorted(info.items()))

View file

@ -0,0 +1,57 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
from openstackclient.i18n import _
def bool_from_str(value, strict=False):
true_strings = ('1', 't', 'true', 'on', 'y', 'yes')
false_strings = ('0', 'f', 'false', 'off', 'n', 'no')
if isinstance(value, bool):
return value
lowered = value.strip().lower()
if lowered in true_strings:
return True
elif lowered in false_strings or not strict:
return False
msg = _(
"Unrecognized value '%(value)s'; acceptable values are: %(valid)s"
) % {
'value': value,
'valid': ', '.join(
f"'{s}'" for s in sorted(true_strings + false_strings)
),
}
raise ValueError(msg)
def boolenv(*vars, default=False):
"""Search for the first defined of possibly many bool-like env vars.
Returns the first environment variable defined in vars, or returns the
default.
:param vars: Arbitrary strings to search for. Case sensitive.
:param default: The default to return if no value found.
:returns: A boolean corresponding to the value found, else the default if
no value found.
"""
for v in vars:
value = os.environ.get(v, None)
if value:
return bool_from_str(value)
return default

View file

@ -17,20 +17,29 @@
import logging import logging
from osc_lib.command import command
from osc_lib import utils from osc_lib import utils
from openstackclient import command
from openstackclient.i18n import _ from openstackclient.i18n import _
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
def _get_extension_columns(item):
column_map = {
'updated': 'updated_at',
}
hidden_columns = ['id', 'links', 'location']
return utils.get_osc_show_columns_for_sdk_resource(
item, column_map, hidden_columns
)
class ListExtension(command.Lister): class ListExtension(command.Lister):
_description = _("List API extensions") _description = _("List API extensions")
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ListExtension, self).get_parser(prog_name) parser = super().get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--compute', '--compute',
action='store_true', action='store_true',
@ -64,21 +73,21 @@ class ListExtension(command.Lister):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
columns: tuple[str, ...] = ('Name', 'Alias', 'Description')
if parsed_args.long: if parsed_args.long:
columns = ('Name', 'Alias', 'Description', columns += ('Namespace', 'Updated At', 'Links')
'Namespace', 'Updated', 'Links')
else:
columns = ('Name', 'Alias', 'Description')
data = [] data = []
# by default we want to show everything, unless the # by default we want to show everything, unless the
# user specifies one or more of the APIs to show # user specifies one or more of the APIs to show
# for now, only identity and compute are supported. # for now, only identity and compute are supported.
show_all = (not parsed_args.identity and show_all = (
not parsed_args.compute and not parsed_args.identity
not parsed_args.volume and and not parsed_args.compute
not parsed_args.network) and not parsed_args.volume
and not parsed_args.network
)
if parsed_args.identity or show_all: if parsed_args.identity or show_all:
identity_client = self.app.client_manager.identity identity_client = self.app.client_manager.identity
@ -89,7 +98,7 @@ class ListExtension(command.Lister):
LOG.warning(message) LOG.warning(message)
if parsed_args.compute or show_all: if parsed_args.compute or show_all:
compute_client = self.app.client_manager.sdk_connection.compute compute_client = self.app.client_manager.compute
try: try:
data += compute_client.extensions() data += compute_client.extensions()
except Exception: except Exception:
@ -97,12 +106,13 @@ class ListExtension(command.Lister):
LOG.warning(message) LOG.warning(message)
if parsed_args.volume or show_all: if parsed_args.volume or show_all:
volume_client = self.app.client_manager.volume volume_client = self.app.client_manager.sdk_connection.volume
try: try:
data += volume_client.list_extensions.show_all() data += volume_client.extensions()
except Exception: except Exception:
message = _("Extensions list not supported by " message = _(
"Block Storage API") "Extensions list not supported by Block Storage API"
)
LOG.warning(message) LOG.warning(message)
if parsed_args.network or show_all: if parsed_args.network or show_all:
@ -110,15 +120,17 @@ class ListExtension(command.Lister):
try: try:
data += network_client.extensions() data += network_client.extensions()
except Exception: except Exception:
message = _("Failed to retrieve extensions list " message = _(
"from Network API") "Failed to retrieve extensions list from Network API"
)
LOG.warning(message) LOG.warning(message)
extension_tuples = ( extension_tuples = (
utils.get_item_properties( utils.get_item_properties(
s, s,
columns, columns,
) for s in data )
for s in data
) )
return (columns, extension_tuples) return (columns, extension_tuples)
@ -128,19 +140,26 @@ class ShowExtension(command.ShowOne):
_description = _("Show API extension") _description = _("Show API extension")
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ShowExtension, self).get_parser(prog_name) parser = super().get_parser(prog_name)
parser.add_argument( parser.add_argument(
'extension', 'extension',
metavar='<extension>', metavar='<extension>',
help=_('Extension to display. ' help=_(
'Currently, only network extensions are supported. ' 'Extension to display. '
'(Name or Alias)'), 'Currently, only network extensions are supported. '
'(Name or Alias)'
),
) )
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
client = self.app.client_manager.network client = self.app.client_manager.network
ext = str(parsed_args.extension)
obj = client.find_extension(ext, ignore_missing=False).to_dict()
return zip(*sorted(obj.items())) extension = client.find_extension(
parsed_args.extension,
ignore_missing=False,
)
display_columns, columns = _get_extension_columns(extension)
data = utils.get_dict_properties(extension, columns)
return display_columns, data

View file

@ -17,18 +17,43 @@
import itertools import itertools
from osc_lib.command import command
from osc_lib import utils from osc_lib import utils
from openstackclient import command
from openstackclient.i18n import _ from openstackclient.i18n import _
from openstackclient.identity import common as identity_common from openstackclient.identity import common as identity_common
def _format_absolute_limit(absolute_limits):
info = {}
for key in set(absolute_limits):
if key in ('id', 'name', 'location'):
continue
info[key] = absolute_limits[key]
return info
def _format_rate_limit(rate_limits):
# flatten this:
#
# {'uri': '<uri>', 'limit': [{'value': '<value>', ...], ...}
#
# to this:
#
# {'uri': '<uri>', 'value': '<value>', ...}, ...}
return itertools.chain(
*[[{'uri': x['uri'], **y} for y in x['limit']] for x in rate_limits]
)
class ShowLimits(command.Lister): class ShowLimits(command.Lister):
_description = _("Show compute and block storage limits") _description = _("Show compute and block storage limits")
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ShowLimits, self).get_parser(prog_name) parser = super().get_parser(prog_name)
type_group = parser.add_mutually_exclusive_group(required=True) type_group = parser.add_mutually_exclusive_group(required=True)
type_group.add_argument( type_group.add_argument(
"--absolute", "--absolute",
@ -42,75 +67,107 @@ class ShowLimits(command.Lister):
dest="is_rate", dest="is_rate",
action="store_true", action="store_true",
default=False, default=False,
help=_("Show rate limits"), help=_(
'Show rate limits. This is not supported by the compute '
'service since the 12.0.0 (Liberty) release and is only '
'supported by the block storage service when the '
'rate-limiting middleware is enabled. It is therefore a no-op '
'in most deployments.'
),
) )
parser.add_argument( parser.add_argument(
"--reserved", "--reserved",
dest="is_reserved", dest="is_reserved",
action="store_true", action="store_true",
default=False, default=False,
help=_("Include reservations count [only valid with --absolute]"), help=_("Include reservations count (only valid with --absolute)"),
) )
parser.add_argument( parser.add_argument(
'--project', '--project',
metavar='<project>', metavar='<project>',
help=_('Show limits for a specific project (name or ID)' help=_(
' [only valid with --absolute]'), 'Show limits for a specific project (name or ID) '
'(only valid with --absolute)'
),
) )
parser.add_argument( parser.add_argument(
'--domain', '--domain',
metavar='<domain>', metavar='<domain>',
help=_('Domain the project belongs to (name or ID)' help=_(
' [only valid with --absolute]'), 'Domain the project belongs to (name or ID) '
'(only valid with --absolute)'
),
) )
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
compute_client = self.app.client_manager.compute
volume_client = self.app.client_manager.volume
project_id = None project_id = None
if parsed_args.project is not None: if parsed_args.project is not None:
identity_client = self.app.client_manager.identity identity_client = self.app.client_manager.identity
if parsed_args.domain is not None: if parsed_args.domain is not None:
domain = identity_common.find_domain(identity_client, domain = identity_common.find_domain(
parsed_args.domain) identity_client, parsed_args.domain
project_id = utils.find_resource(identity_client.projects, )
parsed_args.project, project_id = utils.find_resource(
domain_id=domain.id).id identity_client.projects,
parsed_args.project,
domain_id=domain.id,
).id
else: else:
project_id = utils.find_resource(identity_client.projects, project_id = utils.find_resource(
parsed_args.project).id identity_client.projects, parsed_args.project
).id
compute_limits = None compute_limits = None
volume_limits = None volume_limits = None
if self.app.client_manager.is_compute_endpoint_enabled(): if self.app.client_manager.is_compute_endpoint_enabled():
compute_limits = compute_client.limits.get(parsed_args.is_reserved, compute_client = self.app.client_manager.compute
tenant_id=project_id) compute_limits = compute_client.get_limits(
reserved=parsed_args.is_reserved, tenant_id=project_id
)
if self.app.client_manager.is_volume_endpoint_enabled(volume_client): if self.app.client_manager.is_volume_endpoint_enabled():
volume_limits = volume_client.limits.get() volume_client = self.app.client_manager.sdk_connection.volume
volume_limits = volume_client.get_limits(
project=project_id,
)
data = []
if parsed_args.is_absolute: if parsed_args.is_absolute:
if compute_limits:
data.append(compute_limits.absolute)
if volume_limits:
data.append(volume_limits.absolute)
columns = ["Name", "Value"] columns = ["Name", "Value"]
return (columns, (utils.get_item_properties(s, columns) info = {}
for s in itertools.chain(*data)))
elif parsed_args.is_rate:
if compute_limits: if compute_limits:
data.append(compute_limits.rate) info.update(_format_absolute_limit(compute_limits.absolute))
if volume_limits: if volume_limits:
data.append(volume_limits.rate) info.update(_format_absolute_limit(volume_limits.absolute))
columns = ["Verb", "URI", "Value", "Remain", "Unit",
"Next Available"] return (columns, sorted(info.items(), key=lambda x: x[0]))
return (columns, (utils.get_item_properties(s, columns) else: # parsed_args.is_rate
for s in itertools.chain(*data))) data = []
else: if compute_limits:
return {}, {} data.extend(_format_rate_limit(compute_limits.rate))
if volume_limits:
data.extend(_format_rate_limit(volume_limits.rate))
columns = [
"Verb",
"URI",
"Value",
"Remain",
"Unit",
"Next Available",
]
return (
columns,
[
(
s['verb'],
s['uri'],
s['value'],
s['remaining'],
s['unit'],
s.get('next-available') or s['next_available'],
)
for s in data
],
)

View file

@ -17,9 +17,9 @@
import sys import sys
from osc_lib.command import command
from osc_lib import utils from osc_lib import utils
from openstackclient import command
from openstackclient.i18n import _ from openstackclient.i18n import _
@ -29,13 +29,15 @@ class ListCommand(command.Lister):
auth_required = False auth_required = False
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ListCommand, self).get_parser(prog_name) parser = super().get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--group', '--group',
metavar='<group-keyword>', metavar='<group-keyword>',
help=_('Show commands filtered by a command group, for example: ' help=_(
'identity, volume, compute, image, network and ' 'Show commands filtered by a command group, for example: '
'other keywords'), 'identity, volume, compute, image, network and '
'other keywords'
),
) )
return parser return parser
@ -46,7 +48,9 @@ class ListCommand(command.Lister):
columns = ('Command Group', 'Commands') columns = ('Command Group', 'Commands')
if parsed_args.group: if parsed_args.group:
groups = (group for group in groups if parsed_args.group in group) groups = sorted(
group for group in groups if parsed_args.group in group
)
commands = [] commands = []
for group in groups: for group in groups:
@ -54,7 +58,6 @@ class ListCommand(command.Lister):
command_names = sorted(command_names) command_names = sorted(command_names)
if command_names != []: if command_names != []:
# TODO(bapalm): Fix this when cliff properly supports # TODO(bapalm): Fix this when cliff properly supports
# handling the detection rather than using the hard-code below. # handling the detection rather than using the hard-code below.
if parsed_args.formatter == 'table': if parsed_args.formatter == 'table':
@ -71,7 +74,7 @@ class ListModule(command.ShowOne):
auth_required = False auth_required = False
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ListModule, self).get_parser(prog_name) parser = super().get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--all', '--all',
action='store_true', action='store_true',
@ -81,7 +84,6 @@ class ListModule(command.ShowOne):
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
data = {} data = {}
# Get module versions # Get module versions
mods = sys.modules mods = sys.modules
@ -95,9 +97,12 @@ class ListModule(command.ShowOne):
# show for the default (not --all) invocation. # show for the default (not --all) invocation.
# It should be just the things we actually care # It should be just the things we actually care
# about like client and plugin modules... # about like client and plugin modules...
if (parsed_args.all or if (
# Handle xxxclient and openstacksdk parsed_args.all
(k.endswith('client') or k == 'openstack')): or
# Handle xxxclient and openstacksdk
(k.endswith('client') or k == 'openstack')
):
try: try:
# NOTE(RuiChen): openstacksdk bug/1588823 exist, # NOTE(RuiChen): openstacksdk bug/1588823 exist,
# no good way to add __version__ for # no good way to add __version__ for
@ -108,7 +113,7 @@ class ListModule(command.ShowOne):
data[k] = mods[k].version.__version__ data[k] = mods[k].version.__version__
else: else:
data[k] = mods[k].__version__ data[k] = mods[k].__version__
except Exception: except Exception: # noqa: S110
# Catch all exceptions, just skip it # Catch all exceptions, just skip it
pass pass

View file

@ -0,0 +1,82 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from osc_lib.cli import parseractions
from openstackclient.i18n import _
# TODO(stephenfin): Consider moving these to osc-lib since they're broadly
# useful
def add_marker_pagination_option_to_parser(parser):
"""Add marker-based pagination options to the parser.
APIs that use marker-based paging use the marker and limit query parameters
to paginate through items in a collection.
Marker-based pagination is often used in cases where the length of the
total set of items is either changing frequently, or where the total length
might not be known upfront.
"""
parser.add_argument(
'--limit',
metavar='<limit>',
type=int,
action=parseractions.NonNegativeAction,
help=_(
'The maximum number of entries to return. If the value exceeds '
'the server-defined maximum, then the maximum value will be used.'
),
)
parser.add_argument(
'--marker',
metavar='<marker>',
default=None,
help=_(
'The first position in the collection to return results from. '
'This should be a value that was returned in a previous request.'
),
)
def add_offset_pagination_option_to_parser(parser):
"""Add offset-based pagination options to the parser.
APIs that use offset-based paging use the offset and limit query parameters
to paginate through items in a collection.
Offset-based pagination is often used where the list of items is of a fixed
and predetermined length.
"""
parser.add_argument(
'--limit',
metavar='<limit>',
type=int,
action=parseractions.NonNegativeAction,
help=_(
'The maximum number of entries to return. If the value exceeds '
'the server-defined maximum, then the maximum value will be used.'
),
)
parser.add_argument(
'--offset',
metavar='<offset>',
type=int,
action=parseractions.NonNegativeAction,
default=None,
help=_(
'The (zero-based) offset of the first item in the collection to '
'return.'
),
)

View file

@ -16,8 +16,8 @@
import sys import sys
class _ProgressBarBase(object): class _ProgressBarBase:
"""A progress bar provider for a wrapped obect. """A progress bar provider for a wrapped object.
Base abstract class used by specific class wrapper to show Base abstract class used by specific class wrapper to show
a progress bar when the wrapped object are consumed. a progress bar when the wrapped object are consumed.
@ -38,9 +38,11 @@ class _ProgressBarBase(object):
if self._show_progress: if self._show_progress:
self._percent += size_read / self._totalsize self._percent += size_read / self._totalsize
# Output something like this: [==========> ] 49% # Output something like this: [==========> ] 49%
sys.stdout.write('\r[{0:<30}] {1:.0%}'.format( sys.stdout.write(
'=' * int(round(self._percent * 29)) + '>', self._percent '\r[{:<30}] {:.0%}'.format(
)) '=' * int(round(self._percent * 29)) + '>', self._percent
)
)
sys.stdout.flush() sys.stdout.flush()
def __getattr__(self, attr): def __getattr__(self, attr):

View file

@ -17,10 +17,11 @@ import getpass
import logging import logging
import os import os
import queue import queue
import typing as ty
from cliff.formatters import table from cliff.formatters import table
from osc_lib.command import command
from openstackclient import command
from openstackclient.i18n import _ from openstackclient.i18n import _
from openstackclient.identity import common as identity_common from openstackclient.identity import common as identity_common
@ -28,16 +29,14 @@ from openstackclient.identity import common as identity_common
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
def ask_user_yesno(msg, default=True): def ask_user_yesno(msg):
"""Ask user Y/N question """Ask user Y/N question
:param str msg: question text :param str msg: question text
:param bool default: default value
:return bool: User choice :return bool: User choice
""" """
while True: while True:
answer = getpass._raw_input( answer = getpass.getpass('{} [{}]: '.format(msg, 'y/n'))
'{} [{}]: '.format(msg, 'y/N' if not default else 'Y/n'))
if answer in ('y', 'Y', 'yes'): if answer in ('y', 'Y', 'yes'):
return True return True
elif answer in ('n', 'N', 'no'): elif answer in ('n', 'N', 'no'):
@ -48,53 +47,69 @@ class ProjectCleanup(command.Command):
_description = _("Clean resources associated with a project") _description = _("Clean resources associated with a project")
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ProjectCleanup, self).get_parser(prog_name) parser = super().get_parser(prog_name)
parser.add_argument( action_group = parser.add_mutually_exclusive_group()
action_group.add_argument(
'--dry-run', '--dry-run',
action='store_true', action='store_true',
help=_("List a project's resources") help=_("List a project's resources but do not delete them"),
)
action_group.add_argument(
'--auto-approve',
action='store_true',
help=_("Delete resources without asking for confirmation"),
) )
project_group = parser.add_mutually_exclusive_group(required=True) project_group = parser.add_mutually_exclusive_group(required=True)
project_group.add_argument( project_group.add_argument(
'--auth-project', '--auth-project',
action='store_true', action='store_true',
help=_('Delete resources of the project used to authenticate') help=_('Delete resources of the project used to authenticate'),
) )
project_group.add_argument( project_group.add_argument(
'--project', '--project',
metavar='<project>', metavar='<project>',
help=_('Project to clean (name or ID)') help=_('Project to clean (name or ID)'),
) )
parser.add_argument( parser.add_argument(
'--created-before', '--created-before',
metavar='<YYYY-MM-DDTHH24:MI:SS>', metavar='<YYYY-MM-DDTHH24:MI:SS>',
help=_('Drop resources created before the given time') help=_('Only delete resources created before the given time'),
) )
parser.add_argument( parser.add_argument(
'--updated-before', '--updated-before',
metavar='<YYYY-MM-DDTHH24:MI:SS>', metavar='<YYYY-MM-DDTHH24:MI:SS>',
help=_('Drop resources updated before the given time') help=_('Only delete resources updated before the given time'),
)
parser.add_argument(
'--skip-resource',
metavar='<resource>',
help='Skip cleanup of specific resource (repeat if necessary)',
action='append',
) )
identity_common.add_project_domain_option_to_parser(parser) identity_common.add_project_domain_option_to_parser(parser)
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
sdk = self.app.client_manager.sdk_connection connection = self.app.client_manager.sdk_connection
if parsed_args.auth_project: if parsed_args.auth_project:
project_connect = sdk # is we've got a project already configured, use the connection
# as-is
pass
elif parsed_args.project: elif parsed_args.project:
project = sdk.identity.find_project( project = connection.identity.find_project(
name_or_id=parsed_args.project, name_or_id=parsed_args.project, ignore_missing=False
ignore_missing=False) )
project_connect = sdk.connect_as_project(project) connection = connection.connect_as_project(project)
if project_connect: if connection:
status_queue = queue.Queue() status_queue: queue.Queue[ty.Any] = queue.Queue()
parsed_args.max_width = int(os.environ.get('CLIFF_MAX_TERM_WIDTH', parsed_args.max_width = int(
0)) os.environ.get('CLIFF_MAX_TERM_WIDTH', 0)
parsed_args.fit_width = bool(int(os.environ.get('CLIFF_FIT_WIDTH', )
0))) parsed_args.fit_width = bool(
int(os.environ.get('CLIFF_FIT_WIDTH', 0))
)
parsed_args.print_empty = False parsed_args.print_empty = False
table_fmt = table.TableFormatter() table_fmt = table.TableFormatter()
@ -107,34 +122,39 @@ class ProjectCleanup(command.Command):
if parsed_args.updated_before: if parsed_args.updated_before:
filters['updated_at'] = parsed_args.updated_before filters['updated_at'] = parsed_args.updated_before
project_connect.project_cleanup(dry_run=True, connection.project_cleanup(
status_queue=status_queue, dry_run=True,
filters=filters) status_queue=status_queue,
filters=filters,
skip_resources=parsed_args.skip_resource,
)
data = [] data = []
while not status_queue.empty(): while not status_queue.empty():
resource = status_queue.get_nowait() resource = status_queue.get_nowait()
data.append( data.append(
(type(resource).__name__, resource.id, resource.name)) (type(resource).__name__, resource.id, resource.name)
)
status_queue.task_done() status_queue.task_done()
status_queue.join() status_queue.join()
table_fmt.emit_list( table_fmt.emit_list(
('Type', 'ID', 'Name'), ('Type', 'ID', 'Name'), data, self.app.stdout, parsed_args
data,
self.app.stdout,
parsed_args
) )
if parsed_args.dry_run: if parsed_args.dry_run:
return return
confirm = ask_user_yesno( if not parsed_args.auto_approve:
_("These resources will be deleted. Are you sure"), if not ask_user_yesno(
default=False) _("These resources will be deleted. Are you sure")
):
return
if confirm: self.log.warning(_('Deleting resources'))
self.log.warning(_('Deleting resources'))
project_connect.project_cleanup(dry_run=False, connection.project_cleanup(
status_queue=status_queue, dry_run=False,
filters=filters) status_queue=status_queue,
filters=filters,
skip_resources=parsed_args.skip_resource,
)

View file

@ -1,175 +0,0 @@
# Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
import logging
from osc_lib.command import command
from osc_lib import utils
from openstackclient.i18n import _
from openstackclient.identity import common as identity_common
LOG = logging.getLogger(__name__)
class ProjectPurge(command.Command):
_description = _("Clean resources associated with a project")
def get_parser(self, prog_name):
parser = super(ProjectPurge, self).get_parser(prog_name)
parser.add_argument(
'--dry-run',
action='store_true',
help=_("List a project's resources"),
)
parser.add_argument(
'--keep-project',
action='store_true',
help=_("Clean project resources, but don't delete the project"),
)
project_group = parser.add_mutually_exclusive_group(required=True)
project_group.add_argument(
'--auth-project',
action='store_true',
help=_('Delete resources of the project used to authenticate'),
)
project_group.add_argument(
'--project',
metavar='<project>',
help=_('Project to clean (name or ID)'),
)
identity_common.add_project_domain_option_to_parser(parser)
return parser
def take_action(self, parsed_args):
identity_client = self.app.client_manager.identity
if parsed_args.auth_project:
project_id = self.app.client_manager.auth_ref.project_id
elif parsed_args.project:
try:
project_id = identity_common.find_project(
identity_client,
parsed_args.project,
parsed_args.project_domain,
).id
except AttributeError: # using v2 auth and supplying a domain
project_id = utils.find_resource(
identity_client.tenants,
parsed_args.project,
).id
# delete all non-identity resources
self.delete_resources(parsed_args.dry_run, project_id)
# clean up the project
if not parsed_args.keep_project:
LOG.warning(_('Deleting project: %s'), project_id)
if not parsed_args.dry_run:
identity_client.projects.delete(project_id)
def delete_resources(self, dry_run, project_id):
# servers
try:
compute_client = self.app.client_manager.compute
search_opts = {'tenant_id': project_id, 'all_tenants': True}
data = compute_client.servers.list(search_opts=search_opts)
self.delete_objects(
compute_client.servers.delete, data, 'server', dry_run)
except Exception:
pass
# images
try:
image_client = self.app.client_manager.image
api_version = int(image_client.version)
if api_version == 1:
data = image_client.images.list(owner=project_id)
elif api_version == 2:
kwargs = {'filters': {'owner': project_id}}
data = image_client.images.list(**kwargs)
else:
raise NotImplementedError
self.delete_objects(
image_client.images.delete, data, 'image', dry_run)
except Exception:
pass
# volumes, snapshots, backups
volume_client = self.app.client_manager.volume
search_opts = {'project_id': project_id, 'all_tenants': True}
try:
data = volume_client.volume_snapshots.list(search_opts=search_opts)
self.delete_objects(
self.delete_one_volume_snapshot,
data,
'volume snapshot',
dry_run)
except Exception:
pass
try:
data = volume_client.backups.list(search_opts=search_opts)
self.delete_objects(
self.delete_one_volume_backup,
data,
'volume backup',
dry_run)
except Exception:
pass
try:
data = volume_client.volumes.list(search_opts=search_opts)
self.delete_objects(
volume_client.volumes.force_delete, data, 'volume', dry_run)
except Exception:
pass
def delete_objects(self, func_delete, data, resource, dry_run):
result = 0
for i in data:
LOG.warning(_('Deleting %(resource)s : %(id)s') %
{'resource': resource, 'id': i.id})
if not dry_run:
try:
func_delete(i.id)
except Exception as e:
result += 1
LOG.error(_("Failed to delete %(resource)s with "
"ID '%(id)s': %(e)s")
% {'resource': resource, 'id': i.id, 'e': e})
if result > 0:
total = len(data)
msg = (_("%(result)s of %(total)s %(resource)ss failed "
"to delete.") %
{'result': result,
'total': total,
'resource': resource})
LOG.error(msg)
def delete_one_volume_snapshot(self, snapshot_id):
volume_client = self.app.client_manager.volume
try:
volume_client.volume_snapshots.delete(snapshot_id)
except Exception:
# Only volume v2 support deleting by force
volume_client.volume_snapshots.delete(snapshot_id, force=True)
def delete_one_volume_backup(self, backup_id):
volume_client = self.app.client_manager.volume
try:
volume_client.backups.delete(backup_id)
except Exception:
# Only volume v2 support deleting by force
volume_client.backups.delete(backup_id, force=True)

File diff suppressed because it is too large Load diff

View file

@ -1,58 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
def get_osc_show_columns_for_sdk_resource(
sdk_resource,
osc_column_map,
invisible_columns=None
):
"""Get and filter the display and attribute columns for an SDK resource.
Common utility function for preparing the output of an OSC show command.
Some of the columns may need to get renamed, others made invisible.
:param sdk_resource: An SDK resource
:param osc_column_map: A hash of mappings for display column names
:param invisible_columns: A list of invisible column names
:returns: Two tuples containing the names of the display and attribute
columns
"""
if getattr(sdk_resource, 'allow_get', None) is not None:
resource_dict = sdk_resource.to_dict(
body=True, headers=False, ignore_none=False)
else:
resource_dict = sdk_resource
# Build the OSC column names to display for the SDK resource.
attr_map = {}
display_columns = list(resource_dict.keys())
invisible_columns = [] if invisible_columns is None else invisible_columns
for col_name in invisible_columns:
if col_name in display_columns:
display_columns.remove(col_name)
for sdk_attr, osc_attr in osc_column_map.items():
if sdk_attr in display_columns:
attr_map[osc_attr] = sdk_attr
display_columns.remove(sdk_attr)
if osc_attr not in display_columns:
display_columns.append(osc_attr)
sorted_display_columns = sorted(display_columns)
# Build the SDK attribute names for the OSC column names.
attr_columns = []
for column in sorted_display_columns:
new_column = attr_map[column] if column in attr_map else column
attr_columns.append(new_column)
return tuple(sorted_display_columns), tuple(attr_columns)

View file

@ -14,8 +14,7 @@
"""Versions Action Implementation""" """Versions Action Implementation"""
from osc_lib.command import command from openstackclient import command
from openstackclient.i18n import _ from openstackclient.i18n import _
@ -23,7 +22,7 @@ class ShowVersions(command.Lister):
_description = _("Show available versions of services") _description = _("Show available versions of services")
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(ShowVersions, self).get_parser(prog_name) parser = super().get_parser(prog_name)
interface_group = parser.add_mutually_exclusive_group() interface_group = parser.add_mutually_exclusive_group()
interface_group.add_argument( interface_group.add_argument(
"--all-interfaces", "--all-interfaces",
@ -46,26 +45,29 @@ class ShowVersions(command.Lister):
parser.add_argument( parser.add_argument(
'--service', '--service',
metavar='<service>', metavar='<service>',
help=_('Show versions for a specific service. The argument should ' help=_(
'be either an exact match to what is in the catalog or a ' 'Show versions for a specific service. The argument should '
'known official value or alias from ' 'be either an exact match to what is in the catalog or a '
'service-types-authority ' 'known official value or alias from '
'(https://service-types.openstack.org/)'), 'service-types-authority '
'(https://service-types.openstack.org/)'
),
) )
parser.add_argument( parser.add_argument(
'--status', '--status',
metavar='<status>', metavar='<status>',
help=_("""Show versions for a specific status. Valid values are: help=_(
"""Show versions for a specific status. Valid values are:
- SUPPORTED - SUPPORTED
- CURRENT - CURRENT
- DEPRECATED - DEPRECATED
- EXPERIMENTAL""") - EXPERIMENTAL"""
),
) )
return parser return parser
def take_action(self, parsed_args): def take_action(self, parsed_args):
interface = parsed_args.interface interface = parsed_args.interface
if parsed_args.is_all_interfaces: if parsed_args.is_all_interfaces:
interface = None interface = None
@ -74,7 +76,8 @@ class ShowVersions(command.Lister):
version_data = session.get_all_version_data( version_data = session.get_all_version_data(
interface=interface, interface=interface,
region_name=parsed_args.region_name, region_name=parsed_args.region_name,
service_type=parsed_args.service) service_type=parsed_args.service,
)
columns = [ columns = [
"Region Name", "Region Name",
@ -97,13 +100,15 @@ class ShowVersions(command.Lister):
for data in service_versions: for data in service_versions:
if status and status != data['status']: if status and status != data['status']:
continue continue
versions.append(( versions.append(
region_name, (
service_type, region_name,
data['version'], service_type,
data['status'], data['version'],
data['url'], data['status'],
data['min_microversion'], data['url'],
data['max_microversion'], data['min_microversion'],
)) data['max_microversion'],
)
)
return (columns, versions) return (columns, versions)

Some files were not shown because too many files have changed in this diff Show more