Commit Graph

225 Commits

Author SHA1 Message Date
Slawek Kaplonski 7b99b57165 Add support for default security group rule CRUDs
Change-Id: I1c18c2ec5eb4923e1ab8b3fc6199ef6f329b4a4d
2023-10-19 16:04:22 +02: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
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
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
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
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
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
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
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
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
Zuul 011991bcf3 Merge "compute: Add 'server * --all-projects' option" 2021-03-03 17:01:33 +00:00
Stephen Finucane 1a6df700be compute: Add 'server * --all-projects' option
Add an '--all-projects' option to a number of commands:

- server delete
- server start
- server stop

This is in addition to 'server list', which already supports this
option.

This option allows users to request the corresponding action on one or
more servers using the server names when that server exists in another
project. This is admin-only by default.

As part of this work, we also introduce a 'boolenv' helper function that
allows us to parse the environment variable as a boolean using
'bool_from_string' helper provided by oslo.utils. This could probably be
clever and it has the unfortunate side effect of modifying the help
text in environments where this is configured, but it's good enough for
now.  It also appears to add a new dependency, in the form of
oslo.utils, but that dependency was already required by osc-lib and
probably more.

Change-Id: I4811f8f66dcb14ed99cc1cfb80b00e2d77afe45f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-01-21 10:54:27 +00:00
Rodolfo Alonso Hernandez 0cc878e5b0 Add device profile to ``port``
Added device profile parameter to ``port create`` command.

Related-Bug: #1906602

Change-Id: I4c222ac334d3a0a0ee568ed1e0bc8518baa375e1
2021-01-19 14:42:46 +00:00
Stephen Finucane ca7f23d0d1 compute: Add 'server volume update' command
We're not going to expose the ability to swap volumes since that's a
things humans should not generally use. From the API docs [1]:

  When updating volumeId, this API is typically meant to only be used
  as part of a larger orchestrated volume migration operation initiated
  in the block storage service via the os-retype or os-migrate_volume
  volume actions. Direct usage of this API to update volumeId is not
  recommended and may result in needing to hard reboot the server to
  update details within the guest such as block storage serial IDs.
  Furthermore, updating volumeId via this API is only implemented by
  certain compute drivers.

We *do* want users to have the ability to change the delete on
termination behavior though, so that's what we expose.

[1] https://docs.openstack.org/api-ref/compute/?expanded=update-a-volume-attachment-detail#update-a-volume-attachment

Change-Id: I50938e1237b4d298521b26a5f9cb90c018dfebaf
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-01-12 16:29:07 +00:00
Stephen Finucane f5b185c357 Make use of comparable 'FormattableColumn' subclasses
This requires fixes found in cliff 3.5.0 [1] and osc-lib 2.3.0 [2]. With
these fixes in place, we can remove the icky, still broken
'assertItemEqual' and 'assertListItemEqual' helpers.

[1] https://review.opendev.org/761421
[2] https://review.opendev.org/761394

Change-Id: Id6c26b37c3c7d5ec6761361abca57f9219b76838
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-12-09 15:17:25 +00:00
Artem Goncharov 0f4f42b652 Switch compute flavors from novaclient/direct to SDK
Let's switch flavors from novaclient or direct API requests onto using
SDK. Microversion agreement comes out of the box.

SDK normalizes property names, while OSC uses server side names. In
order not to break OSC users continue using server-side names.

Depends-On: https://review.opendev.org/#/c/762989/
Change-Id: I62b2ed8488ee4ac9c42051311bcfb455506ddd90
2020-12-02 11:24:42 +00:00
Rodolfo Alonso Hernandez 8387b114e3 Add "fields" parameter to ListPort query
This new query parameter will allow to send a query to the Neutron
server filtering only by those parameters needed by the list
command: ID, name, MAC address, fixed IPs and status.

When using input parameter "long", security groups IDs, device owner
and tags will be added to the fields filter.

With 4500 ports, those are the execution times for the command
"openstack port list" (average values in a development environment):

                 Neutron API (seconds)  CLI (seconds)
Without filter:  3.05                   10.15
With filter:     2.76                   8.19

Depends-On: https://review.opendev.org/#/c/754113/

Change-Id: I1cccf0bc3533f8085e8dd61bf2fbe78c49b74b31
Closes-Bug: #1897100
2020-11-18 17:42:14 +00:00
Artem Goncharov e05d39abb5 Switch console url show operations to SDK
Switch from using novaclient to SDK for openstack console url show operation.

Depends-On: https://review.opendev.org/756286
Change-Id: Ibe247825148788c549c2c1e991aae92338cdf557
2020-10-24 10:19:52 +02:00
Monty Taylor 9385113d40 Remove oslo.utils
Oslo things are really server-side oriented and are heavy-weight
for client things. Remove oslo.utils and just use iso8601 and
importlib directly. It's not actually a bad library, but pulling
it and its other deps in just for a couple of wrapper methods
is a bit much here.

oslo.i18n, fwiw, is lightweight and helpful.

Change-Id: I463993170c03a1d98c47ab6a3c19131b7fca1099
2020-10-12 17:29:57 +01:00
songwenping c2df9215e1 Remove usage of six
With python3.x, classes can use 'metaclass=' instead of
'six.add_metaclass', 'six.iteritems' and 'six.iterkeys' can
be replaced by 'items' and 'keys', 'six.moves.urllib.parse'
can be replaced by 'urllib.parse', 'six.StringIO' and
'six.moves.cStringIO' can be replaced by 'io.StringIO',
'six.text_type' and 'six.string_type' are just 'str'.

Change-Id: I84848c0bf8ab3c36dd821141191e2725e4e3b58b
2020-10-07 02:15:25 +00:00
Zuul 9fb68eca44 Merge "Expose flag for forcing use of import for images" 2020-07-08 17:01:22 +00:00
Doug Hellmann 870cf01148 switch to stevedore for entry points
Importing pkg_resources scans every installed distribution to find
all of the entry points. Stevedore is adding a new caching layer using
importlib.metadata, which will not.  Switching to the stevedore should
eventually speed up load times, especially for command line apps. This
change makes the switch now to ensure API compatibility.

We were already using stevedore for tests, so this moves the dependency
from test-requirements.txt to requirements.txt and raises the minimum
version to something more recent.

Change-Id: I3e3632783bc745979b6db73e610df8a77ffaceb0
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2020-07-06 08:44:31 -04:00
Monty Taylor c04ec16cf7 Expose flag for forcing use of import for images
openstacksdk added support for using image import as a fallback
which is transparently supported here, but also provides an
override flag to allow a user to force use of import. Expose that
here.

Depends-On: https://review.opendev.org/737608
Change-Id: Ied938a8f63f305305a20ace42e9f4c84b0a5c00e
2020-06-30 07:02:23 -05:00
Dmitry Tantsur da4e1ca95f Remove Babel from requirements
It's not a runtime dependency (and even oslo.i18n has dropped it).
The translation infrastructure installs Babel explicitly. See
this mailing list thread for a full reasoning:
http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014227.html

Keeping Babel in lower-constraints since other projects still pull it.

Change-Id: Ib24d2941ac0f780f9092e48b17c343f8eb1d7151
2020-04-17 18:15:11 +02:00
pedro 74a7c1d9d6 Add description field to portforwarding NAT rules
Add the `description` field to Floating IP Port Forwardings

Depends-On: https://review.opendev.org/#/c/705038/
Change-Id: I6477368e32570c96cacddba4f86455262e533277
Implements: blueprint portforwarding-description
Closes-Bug: #1850818
2020-04-02 13:15:19 -03:00
Bence Romsics dba57c85d5 Add command: router add/remove route --route
Add commands to osc to call the two new API methods introduced by
new Neutron extension: extraroute-atomic.

Bump our openstacksdk requirement to >=0.38.0 which contains
the corresponding sdk change.

The lower-constraints of dogpile.cache and keystoneauth1 are bumped
because of requirements bumps in openstacksdk.

The lower-constraint of decorator is bumped because of problem already
fixed by amotoki here: https://review.opendev.org/701706

Change-Id: Ia9b9c216f1d1161ebedac31594a2c464d77f4ae2
Depends-On: https://review.opendev.org/674324
Partial-Bug: #1826396 (rfe)
Related-Change: https://review.opendev.org/655680 (spec)
2020-03-30 16:19:05 +02:00
Artem Goncharov 768a64aac5 Complete switch from glanceclient to SDK for image service
In https://review.opendev.org/#/c/650374/ a work has been started to
switch image service support from glanceclient with all it's
dependencies to the SDK version. With this change version 1 (anyway
deprecated since ages) is also being switched to SDK.

Change-Id: Ic391500af02a73d81d64a9e9113cca85c9e24390
2020-03-24 13:13:06 +00:00
Artem Goncharov 60e7c51df4 Switch image to use SDK
This is a work to switch OSC from using glanceclient to OpenStackSDK.

With this change only v2 is using OpenStackSDK. V1 is still using
glanceclient and will be switched in a separate change.

Remove the direct depend on keystoneauth- let that flow through
openstacksdk.

Depends-on: https://review.opendev.org/#/c/698972
Change-Id: I36f292fb70c98f6e558f58be55d533d979c47ca7
2020-03-23 14:38:32 -05:00
Daniel Bengtsson bf2beb9e86 Stop configuring install_command in tox and stop use pip.
Currently, we are overriding 'install_command' to use 'pip'. This is
considered poor behavior and 'python -m pip' should be used instead:

https://snarky.ca/why-you-should-use-python-m-pip/

It turns out that this is the the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

So we can remove the line and simply use the default value. Use the
right way when it's necessary.

Change-Id: I410173d5fdcd8c592d98eed2f48b98e06299e8b3
2020-03-16 08:00:44 +01:00
Colleen Murphy 70ab3f9dd5 Add support for app cred access rules
This commit introduces the --access-rules option for 'application
credential create' as well as new 'access rule' commands for listing,
showing, and deleting access rules.

bp whitelist-extension-for-app-creds

Change-Id: I04834b2874ec2a70da456a380b5bef03a392effa
2020-01-17 11:14:51 -08:00
Michael Johnson db29e28b7c Switch to using osc_lib.utils.tags
This patch updates the network modules to use the new
osc_lib.utils.tags module and removes the in tree _tag.py version.

A previous patch[1] moves the _tag.py code to osc-lib to allow other
projects to leverage the code.

[1] https://review.opendev.org/662859

Change-Id: Id0c34029e327de50c5fd2732bae5fbf45bbd16ee
2020-01-14 17:10:41 -08:00
zhangbailin 874a726f52 Microversion 2.79: Add delete_on_termination to volume-attach API
Added ``--disable-delete-on-termination`` and
``--enable-delete-on-termination`` options to the
``openstack server add volume`` command that enables users to mark
whether to delete the attached volume when the server is destroyed.

Depends-On: https://review.opendev.org/#/c/681267/

Part of blueprint support-delete-on-termination-in-server-attach-volume

Change-Id: I6b5cd54b82a1135335a71b9768a1a2c2012f755b
2019-11-19 21:07:20 +00:00
zhangbailin fcd46acb69 Microversion 2.77: Support Specifying AZ to unshelve
This patch adds a new parameter ``--availability-zone`` to
``openstack server unshelve`` command. This can help users to specify
an ``availability_zone`` to unshelve a shelve offloaded server from
2.77 microversion.

Depends-On: https://review.opendev.org/679295

Implements: blueprint support-specifying-az-when-restore-shelved-server

Change-Id: Ia431e27c2a17fe16466707cc362532860ecf22df
2019-09-03 21:38:44 +00:00
Dean Troyer a88e95873e Bump min osc-lib to 1.14.0
This is required for osc4 and the movement of functions out of OSC.

Change-Id: I690954b6dccb11dd1a4f512b6777d645de5191f9
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2019-08-30 15:26:54 -05:00
zhu.boxiang 340f25fa14 Add host and hypervisor_hostname to create servers
Adds the --host and --hypervisor-hostname options to
``openstack server create`` CLI.

Depends-On: https://review.opendev.org/670558

Change-Id: If188c3d96fa506dbe62ef256418f2f9bca1520c2
Blueprint: add-host-and-hypervisor-hostname-flag-to-create-server
2019-07-19 15:45:18 +00:00
Surya Seetharaman 187be0ac22 Microversion 2.73: Support adding the reason behind a server lock
This patch adds a new parameter ``--reason`` to ``openstack server lock``
command and ``--locked``, ``unlocked`` filtering parameters to
``openstack server list`` command. This can help users to provide a
reason when locking the server and to filter instances based on their
locked value from 2.73 microversion.

Implements blueprint add-locked-reason
Depends-On: https://review.opendev.org/#/c/661785/

Change-Id: Ib2714f98b24d47e570da8a6c231e765acd2ff595
2019-06-21 11:35:51 -05:00
Zuul 1894a3cb17 Merge "Add --key-name and --key-unset option for server rebuild API." 2018-11-02 19:41:24 +00:00
Monty Taylor dfd37a2e6e
Make use of keystoneauth service-type filtering for versions
The first version of the versions show command does client-side
service-type filtering, which while functional, causes many more API
calls than needed. Now that keystoneauth supports the filtering at the
source, use it.

Change-Id: I57c49e67f9cb285a5f5bc19ec53a42d10de9f0da
2018-10-19 07:55:41 -05:00
Fan Zhang f82c5b85ce Add --key-name and --key-unset option for server rebuild API.
Change-Id: I6d4793a8e961080ea1d6d414cef8d6bbed0c53e7
Story: 2002609
Task: 22228
Signed-off-by: Fan Zhang <zh.f@outlook.com>
2018-10-09 14:34:44 +08:00
Josephine Seifert 1981eb2250 osc-included image signing (using openstacksdk)
This extension adds image signing functionality to the "image create" command.
Therefore, new CLI options --sign-key-path and --sign-cert-id have been added.
This patch uses openstacksdk as the signing backend library instead of cursive.
Therefore, requirements and lower_constraints have been updated to use the
openstacksdk version 0.17 or higher.

Depends-On: Idc15b9a12d408bd4b2e096da8402c374be56f9fa
Change-Id: Ia20bc02a49c3fbeb9222e485e3396395f4ab817a
Story: 2002128
Co-Authored-By: Markus Hentsch <markus.hentsch@secustack.com>
2018-09-08 01:55:38 +00:00
Zuul d177727a6e Merge "Implement support for registered limits" 2018-07-25 00:52:41 +00:00
Jake Yip b90b93e143 Fix error with image show when image name is None
Need to bump osc-lib to 1.10.0

Closes-Bug: #1736696
Depends-On: I2aab5cc1f550848bda2b90ef7ef9a60f07b88996
Change-Id: I7420204f28d36529354e5671bd88587d9b15bb06
2018-07-23 17:42:34 -05:00
Lance Bragstad 641a4faac1 Implement support for registered limits
This commit adds support for users to manage registered limits via
the command line.

bp unified-limits

Depends-On: https://review.openstack.org/#/c/574391/
Change-Id: Id8377363f7a3248b45aeeba21d2acc02684a0305
2018-07-23 21:18:50 +00:00
Lance Bragstad 8bfa180430 Add system role functionality
This commit adds the necessary bits to expose system role
assignments to openstackclient via python-keystoneclient.

bp system-scope

Depends-On: Iecbcbf020a15f2bec777334c648d4477f89f3b2c
Change-Id: I261e84700b51e8715eaebdc3f8f8bc46b68542c2
2018-06-04 20:09:14 +00:00
OpenStack Proposal Bot 395f640bc7 Updated from global requirements
Change-Id: Idf311a7fa08e8738bb4c70b0d84f8a4121606f56
2018-03-13 07:28:18 +00:00
OpenStack Proposal Bot 9c23fc8025 Updated from global requirements
Change-Id: Ieb1a29ba275784f67f0d943fab5f3b59cd9fc28e
2017-12-23 10:11:57 +00:00
OpenStack Proposal Bot c0f910d613 Updated from global requirements
Change-Id: I714dbe5326ed99c4edab6c63ecea4dc6a72b57e7
2017-11-16 11:25:40 +00:00
OpenStack Proposal Bot 4742d4df70 Updated from global requirements
Change-Id: Icf2e8d6cca0194de127ef0dfaee5db04381b5cd1
2017-11-12 21:18:50 +00:00
OpenStack Proposal Bot 7744046d6a Updated from global requirements
Change-Id: I9935e5f3eeab0e0d8a56f5983822ad96c79a7526
2017-11-03 01:07:54 +00:00