Commit Graph

62 Commits

Author SHA1 Message Date
Takashi Natsume be9517cb02 Fix a fixture for keypairs tests
This patch is a follow-up for
I03570d0a49b73021de91dc50b65b1bbf5d4b878b.

The following file is for shell (CLI) tests,
so it does not need to be changed anymore.

* novaclient/tests/unit/v2/fakes.py

Change-Id: I3b1cf5d402b04854177265f2ba429956edb73203
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-08-05 23:58:30 +09:00
René Ribaud ee9b277c5f Microversion 2.91: Support specifying destination host to unshelve
This patch adds ``host`` to novaclient api.
This can help administrators to specify a ``host``
to unshelve a shelve offloaded server from 2.91 microversion.

Depends-On: https://review.opendev.org/c/openstack/nova/+/831507
Implements: blueprint unshelve-to-host
Change-Id: I7efc8f0b0ef159e16cefee761bff5d7e90d0c427
2022-07-28 14:49:46 +02:00
Stephen Finucane 54d4da112a Add support for microversion v2.88
The key change here is that the 'GET /os-hypervisors/{id}/uptime' API
will now returns a HTTP 404 starting in 2.88. The 'GET
/os-hypervisors/{id}' will instead now include an 'uptime' value. The
'novaclient.v2.hypervisors.HypervisorManager.uptime' method is updated
to handle this.

Change-Id: Ib99fbd820a586c14527ff64b319df0b7a44e1b8b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-03-02 12:14:12 +00:00
Takashi Natsume 2ed34e657c Remove unused code
The code has not been used
since If0161a89877f19f24e91d780cf227fdc48e7e860 .

Change-Id: I106404f9d12814fec2ec2bf16cdd100834085912
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2020-07-31 11:28:24 +00:00
Stephen Finucane c4c44bcb2d Remove six
Mostly a find-replace job. Let's do this now so we don't have to carry
it for the next decade.

Change-Id: I7bef9fb7c6895f746cee1aca6522786f38b9857c
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-02-21 09:48:38 +00:00
Dan Smith 71c29a184b Add aggregate-cache-images command and client routines
This adds the ability to request image precache support for an aggregate
in support of the matching server feature.

Related to blueprint image-precache-support

Depends-On: https://review.opendev.org/#/c/687140
Change-Id: Id354ccfa99e500a598685e6b794c12160ea2a990
2019-10-18 10:50:01 -07:00
Yongli He aae95dcc7a Microversion 2.78 - show server topology
Add support microversion 2.78 which adds server topology
information in the output of the following new command:

  nova server-topology

Depends-on: https://review.opendev.org/#/c/621476/
Change-Id: I6467d52d2528a37348458baf4842b571a97f3ed2
Implements: blueprint show-server-numa-topology
2019-09-06 17:24:17 -04:00
zhangbailin ecfa521b21 Microversion 2.77: Support Specifying AZ to unshelve
This patch adds a new parameter ``--availability-zone`` to ``nova
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/#/c/663851/
Implements: blueprint support-specifying-az-when-restore-shelved-server

Change-Id: I8bce8f430bc54f03bacc105e37fc8b3bbf2432c2
2019-08-28 17:43:22 -04:00
Surya Seetharaman a1ac69c69a Microversion 2.73: Support adding the reason behind a server lock
This patch adds a new parameter ``--reason`` to ``nova lock``
command and ``--locked`` filtering/sorting parameter to
``nova list`` command. This can help users to provide a reason
when locking the server and to filter/sort instances based on their
locked or value from 2.73 microversion.

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

Change-Id: I438e6db2dd5000ba388d0a0f1c8ab74b96b47a71
2019-05-13 14:37:43 +02:00
asmita singh 4450e7ba31 Handle unicode multi-byte characters
If you pass unicode multi-byte character to 'hypervisor-list'
and 'instance-usage-audit-log' commands using --matching
and --before options respectively, it returns keyerror.

This patch fixes these issues by encoding the host name and
date passed to the --matching and --before options
respectively.

Closes-Bug: #1804156

Change-Id: I9587af7e0fdd921fcaebe3e5c6c5bb40a9393e01
2019-02-22 05:32:49 +00:00
ZhijunWei 85e9b58e9b Update hacking version
1. update hacking version to latest
2. fix the pep8 failed

Change-Id: I484a40fe3cb868d223a807edcd3e20f5e0ebdf4e
2019-01-04 14:46:07 +08:00
Takashi NATSUME 80b4286981 Replace MB with MiB
Change-Id: Ie5bd325d8e0f7e9af76c1ddae1d679b0e797c84b
2018-10-22 07:11:25 +00:00
Matt Riedemann abaa86fd86 Revert "Fix listing of instances above API max_limit"
This reverts commit eff607ccef.

There was no apparent need for the change being reverted since
user can list all servers by specifying --limit=1 when running
the nova list command.

The change introduced a problem whereby the first pass to
list instances from the server would get up to
[api]/max_limit (default 1000) results and then call again
with a marker. If the last instance in the list (the marker)
is corrupted in the instance_mappings table in the API DB
by not having an associated cell mapping, listing instances
will always fail with a MarkerNotFound error even though
the CLI user is not passing a marker nor specifying
--limit=-1. The corrupted instance mapping record resulting
in the MarkerNotFound error is something else that should
be fixed on the server side (and likely result in a 500) but
the change in behavior of the CLI makes it always fail
if you hit this even if you're not passing a marker.

Change-Id: Ibb43f500a74733b85bd3242592d36985bfb45856
Closes-Bug: #1773945
2018-06-05 19:57:49 +00:00
Jacek Tomasiak eff607ccef Fix listing of instances above API max_limit
Output of `nova list` command contained only `max_limit` entries even
when there were more. The list needs to be obtained in multiple
requests and the paging loop was terminated prematurely.

Change-Id: I4194e6d5e34ecc0ac704851c08bb895e223aa850
Closes-Bug: 1743532
2018-02-07 18:00:20 +01:00
Matt Riedemann 038cfdd5b3 Add support for the 2.57 microversion
With the 2.57 microversion, we:

* Deprecate the --file option from the nova boot and
  nova rebuild CLIs and API bindings.
* Add --user-data and --user-data-unset to the nova rebuild
  CLI and API bindings.
* Deprecate the maxPersonality and maxPersonalitySize fields
  from the nova limits and nova absolute-limits CLIs and API
  bindings.
* Deprecate injected_files, injected_file_content_bytes, and
  injected_file_path_bytes from the nova quota-show,
  nova quota-update, nova quota-defaults, nova quota-class-show,
  and nova quota-class-update CLIs and API bindings.

Part of blueprint deprecate-file-injection

Change-Id: Id13e3eac3ef87d429454042ac7046e865774ff8e
2018-01-15 14:42:53 +08:00
Matt Riedemann 1d88717e75 Remove deprecated os-hosts CLIs and python API bindings
These were all deprecated in the 9.0.0 release in Pike
via change I79091edf5a2569e49e79deba312456fdcdee09e1 and
can now be removed. This will go into the 10.0.0 release.

Change-Id: I85a287ff2666c2dcdcbbc8fd6c2e285176f7a67a
2018-01-11 21:02:55 -05:00
Matt Riedemann 8c73ba4471 Remove deprecated cloudpipe CLIs and python API bindings
These were all deprecated in the 9.0.0 release in Pike
via change I329ee0e5fcf068ea7e54b99fbaf94a524647f660
and we can remove them now. This will go into 10.0.0.

Change-Id: Ia90a49112847e365fcdaf581dc9ee32f9a20fd85
2018-01-11 16:40:15 -05:00
Matt Riedemann 4bc4078fcb Remove deprecated certs CLIs and python bindings
The certs CLIs and python API bindings were deprecated
in release 9.0.0 in Pike via change:

  If3e1e40947a8ad3f665f6a96d46de8cef6a2a190

We can safely remove them now and we'll do a major version
release for this.

Change-Id: I91a49b03e4d3c661ef6072962fac416f2dc37d0b
2018-01-11 16:40:15 -05:00
Matt Riedemann f4009a71a0 Remove incorrect legacy QuotaSet.id property
The QuotaSet.id property was added in commit
d17505462d assertin
that the os-quota-set response had no id in it, but
it always has, ever since the API was added in commit
6220c4276e30c633ffc4165ce6db0d120c0e88a7 in nova.

This change removes the incorrect property and fixture
data that returns a tenant_id in the response which the
API doesn't actually do.

The test_quota fixture data is also updated to fix the
name on the key_pairs key and add missing keys in the
response for server groups.

Change-Id: Ifaf59813e75876334dcc2ac239ed6bdddb495aa7
2018-01-02 10:20:25 -05:00
Takashi NATSUME e5e8cebc81 Microversion 2.56 - Enable cold migration with target host
Change-Id: I4deea811ffae3e7944d5ec10ca0bbf2bfa056a7c
Implements: blueprint cold-migration-with-target-queens
2017-12-04 10:48:47 +09:00
Monty Taylor e24421b793 Stop posting to os-volumes_boot
os-volumes_boot is an old clone of /servers and is not documented in the
API docs. POST to /servers.

Change-Id: If0161a89877f19f24e91d780cf227fdc48e7e860
2017-11-16 11:25:50 -05:00
Jeremy Liu da44174c54 Fix reservation_id not supported by Nova API
Nova API accepts "return_reservation_id" instead of "reservation_id" when
creating instances [1]. This patch fixed that.

[1] https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/schemas/multiple_create.py#L19

Change-Id: Ie58248aa1cd981b877c7e592db698faffcd01d9a
Closes-bug: #1693818
2017-08-06 14:06:02 +08:00
Matt Riedemann 5745beae5c Microversion 2.53 - services and hypervisors using UUIDs
Adds support for the 2.53 microversion which changes the
os-services and os-hypervisors APIs to use a UUID for the ID
value on the resource.

Also, the PUT and GET API methods have changed a bit for
both resources in this microversion, so the pythong API
bindings and command lines have been adjusted accordingly.

Part of blueprint service-hyper-uuid-in-api

Change-Id: Ic721143cc154d91e74a8a9dd2c1e991045c94305
2017-07-26 09:04:19 -04:00
Matt Riedemann 603f0eae9f 2.45: createImage/createBackup image_id is in response body
This adds support for microversion 2.45 which changes the response
on the createImage and createBackup server action APIs to return
the image_id for the created snapshot image in a json dict in the
response body rather than in a Location header (which is gone in
microversion >= 2.45).

Since the 'nova backup' command was not printing out the created
image ID before, that is also added in this microversion.

Part of blueprint remove-create-image-location-header-response

Change-Id: Id48aa7b14e2d25008287549b04db437ca9c3f548
2017-04-26 09:32:59 -04:00
Matt Riedemann 3a03a0e10d Remove deprecated network APIs
These were deprecated in Newton:

aaebeb05a0

The 'find network' convenience helper when
booting a server only works with neutron now,
and assumes the 'network' endpoint is in the
service catalog.

The functional tests are changed to use
python-neutronclient for listing and finding
the network to use. At this point, we don't
have any nova-network CI jobs that will work
with novaclient, so the non-voting mitaka
nova-network job is also being removed in change
I63b36fb8acc5c9a273e6adcb271df16d0f71031e.

As noted in the release note, the only remaining
pure nova-network CLI/API that will work is for
listing virtual interfaces, which is only implemented
for nova-network within Nova. The functional tests
for this API are removed since we don't have any
nova-network CI jobs that will test it besides
unit tests. Long-term we'll likely deprecate the
os-virtual-interfaces API as well and replace it with
the os-interface API.

Change-Id: I8c520100a0016eed3959619c71dae037ebd72939
2017-04-03 13:17:25 -04:00
Matt Riedemann 4dbb20e5ac Remove deprecated fixed_ips APIs
These were deprecated in Newton:

aaebeb05a0

Change-Id: Iee5bc26384d2079d6a5a8eded1ce5a003439fc95
2017-03-20 19:26:58 -04:00
Matt Riedemann a298b29cc7 Remove deprecated security_groups APIs
These were deprecated in Newton:

aaebeb05a0

The SecurityGroup resource object is left
since the list-secgroup command and
list_security_group servers API code
still uses that object. The
/servers/{server_id}/os-security-groups API
is a proxy to Neutron but was not deprecated
in microversion 2.36 so it's not yet deprecated
here in the client.

Change-Id: I6fa14f43d48f1e035ef54bd2d0078506f0c6d6e0
2017-03-20 19:26:43 -04:00
Matt Riedemann 0896bdc52a Remove deprecated security_group_rules APIs
These were deprecated in Newton:

aaebeb05a0

Change-Id: I2ff1e97c022bc57d468947e90d536a37c65b8a7a
2017-03-20 17:43:49 -04:00
Matt Riedemann 8030b2604d Remove the deprecated fping API
This was deprecated in Newton:

aaebeb05a0

Change-Id: I8deb3b479ec9fd06ab7f527725f489e63fe970c6
2017-03-20 17:34:03 -04:00
Matt Riedemann 31a12984b3 Remove deprecated floating_ip_pools API
These were deprecated in Newton in change:

aaebeb05a0

Change-Id: I9ec33231bbf060e7daae8f3567a38c71e52f5c42
2017-03-20 17:28:28 -04:00
Matt Riedemann ab3315b46f Remove deprecated floating_ips_bulk API
These were deprecated in Newton in change:

aaebeb05a0

Change-Id: Idee91ca8fc4715cd952f97dafcdd5519c9bec919
2017-03-20 17:16:54 -04:00
Matt Riedemann ef74c0a7c8 Remove deprecated floating IP DNS domain/entry APIs
These were deprecated in Newton in change:

aaebeb05a0

Change-Id: I8888f241b04f075d92d2298c623144809546581f
2017-03-20 16:58:22 -04:00
Matt Riedemann 41f66d15aa Remove deprecated image commands/API bindings
We deprecated the image proxy commands and APIs in Newton
due to the 2.36 microversion. We said after Ocata 15.0.0 we
would remove these, which we can do now in Pike.

Note that the list() method on the ImageManager has to be
moved to the GlanceManager since we still need to list images
for the --image-with option on the boot command. The _match_image
method in the shell has to be updated for a glance v2 response
where custom metadata properties are flat in the image body.

This needs to be released with a major version bump.

Change-Id: I2d9fd0243d42538bd1417a42357c17b09368d2a5
2017-02-22 15:56:28 -05:00
Boris Pavlovic 0fed79fd8f Add profiling support to novaclient
To be able to create profiling traces for Nova, client should be
able to send special HTTP header that contains trace info.
This patch is also important to be able to make cross project
traces. (Typical case heat calls nova via python client, if
profiler is initialized in heat, nova client will add extra
header, that will be parsed by special osprofiler middleware in nova
api.)

Security considerations: trace information is signed by one of the
HMAC keys that are set in nova.conf. So only person who knows HMAC key
is able to send proper header.

oslo-spec: https://review.openstack.org/#/c/103825/
Based on: https://review.openstack.org/#/c/105089/

Co-Authored-By: Dina Belova <dbelova@mirantis.com>
Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Co-Authored-By: Tovin Seven <vinhnt@vn.fujitsu.com>

Partially implements: blueprint osprofiler-support-in-nova

Depends-On: I82d2badc8c1fcec27c3fce7c3c20e0f3b76414f1
Change-Id: I56ce4b547230e475854994c9d2249ef90e5b656c
2017-01-19 03:50:06 +00:00
Andrey Kurilin 2e5576dafc Remove all code related to HTTPClient
In previous patch we switched to use SessionClient in all cases. It means that all
HTTPClient code is redundant now.

Change-Id: I5a0da970fd82c79db3d88f1b49279133bbdba639
2016-12-16 12:56:18 +00:00
Andrey Kurilin 8409e006c5 Create keystone session instance if not present
Since all authentication plugins should be stored in Keystone, there is no
need to share responsibility for authentication stuff with Keystone team.
Let's use convinient and the right way to use keystone - keystone sessions.
We have own adapter for it - novaclient.client.Session which can be used in
100% cases of novaclient usage. Let's create session object if it is not
transmitted via arguments and get rid of novaclient.client.HTTPClient
implementation.

NOTE: novaclient.client.HTTPClient and all related code will be removed
      separately.

Co-Authored-By: Clenimar Filemon <clenimar@lsd.ufcg.edu.br>
Change-Id: Ibb99fdafbf02b3e92f1a5d04d168151b3400b901
2016-12-16 12:56:10 +00:00
Jenkins 1dc32abd35 Merge "Rename api_key to password" 2016-12-15 20:59:56 +00:00
Andrey Kurilin f98b8470de Rename api_key to password
"password" term is more clear. Resolves FIXME from the code:

    FIXME(comstud): Rename the api_key argument above when we
                    know it's not being used as keyword argument

Change-Id: I39f810a181b119591cf017eded71356a437a8c0a
2016-12-15 19:49:03 +02:00
int32bit 50d83a4de2 Add limit and offset to server-groups list
Via `limit` and `offset` arguments, Nova API now support pagination
to display server groups. But our novaclient hasn't implemented yet
in current version. This patch introduce `--limit` and `--offset`
options to `nova server-group-list` subcommand, which can make up for
the above issue.

Change-Id: I371d4c2e74a8e6bfc8a7529de35668490cb0e44d
Closes-Bug: #1648835
2016-12-14 23:46:24 +08:00
Jamie Lennox e88afc046b Clean up requests-mock usage
In line with other clients testing we've found that having the
requests-mock fixture at self.requests can be misleading for new people
as it looks like you're calling requests itself.

Also make use of some of the new features of requests-mock like query
parsing, json handling, method names.

Change-Id: Id61b88c53478d49f91c3f880ed5b90d638051ba0
2016-10-05 06:53:05 +11:00
Roman Podoliaka 0b2de53005 Make it possible to list quotas with details
Allow requests to /os-quota-sets/{tenant_id}/detail for listing of
detailed informantion on quotas, which also includes reserved and
in-use values in addition to limit ones provided by /os-quota-sets/{tenant_id}

Change-Id: I31e939c8eedee1b3b375e1d02cc21ca15dd9932a
Closes-Bug: #1596891
2016-06-29 17:18:07 +03:00
Sergey Nikitin ff9b97b2c6 Added Support of microverison 2.26
This microversion allows to create/delete/update
server tags and to search servers by tags.

Implements: blueprint tag-instances

Change-Id: I66b6d4a763c507335f27a425bc3d4c2aae377c00
2016-05-18 17:36:17 +03:00
Eli Qiao ae598280ac [microversion] Bump to 2.25
microversion v2.25 will change parameter of os-migrateLive, this patch
adds supports to that changes.

os-migrateLive will abandon disk_over_commit and the default value of
block_migration will be set to `auto`

Depends-on: Ibb0d50f0f7444028ef9d0c294aea41edf0024b31
Implements: blueprint making-live-migration-api-friendly
Change-Id: I01b22593724616bc0a7793c509ecabf095d6927d
2016-03-02 17:24:17 +08:00
Andrea Rosa 77e50cc91b Support for abort an ongoing live migration
In Nova API microversion 2.24 there is a new operation which allows to
abort a running live migration.

This change is to enable this feature at the client side implementing a
new method to call the new nova API:
nova live-migration-abort <server_id> <migration_id>

Implements blueprint: abort-live-migration

Depends-On: I1ff861e54997a069894b542bd764ac3ef1b3dbb2

Change-Id: Ic2ead126e0cf48aa54a083e97cb9d1303a5a9bbd
2016-03-01 13:43:33 +00:00
ShaoHe Feng e0c7d2c673 Add two server-migration commands and bump migration-list command
1. Add two new commands
Add nova client server-migration-list and server-migration-show

2. Bump and old command
Add migration_type field for migration-list command

Partially implements blueprint live-migration-progress-report

Depends-On: Ia92ecbe3c99082e3a34adf4fd29041b1a95ef21e

Change-Id: I071198fa9ba0699383bdebf4fab54714a435e6c3
2016-03-01 12:27:54 +00:00
Pawel Koniszewski 62c76301a2 Support for forcing live migration to complete
In API microversion 2.22 in Nova there is new ServerMigrations resource
that allows opertators to force on-going live migration to complete:
https://review.openstack.org/#/c/245921/

This patch implements new method in python-novaclient to take advantage
of the new API:
nova live-migration-force-complete <instance_id/name> <migration_id>

Change-Id: I823c20b4e0c7b63e905f564a7dff13d3fb314a26
Implements blueprint pause-vm-during-live-migration
2016-02-25 13:59:11 +00:00
Takashi NATSUME 0414bab3d3 Add return-request-id-to-caller function(3/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/keypairs.py
* novaclient/v2/limits.py
* novaclient/v2/networks.py
* novaclient/v2/quota_classes.py
* novaclient/v2/quotas.py
* novaclient/v2/security_group_default_rules.py
* novaclient/v2/security_group_rules.py
* novaclient/v2/security_groups.py
* novaclient/v2/server_groups.py
* novaclient/v2/services.py
* novaclient/v2/usage.py
* novaclient/v2/versions.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I9203f70a0eef5686b590fbff35563f2cf8b6f586
Implements: blueprint return-request-id-to-caller
2016-01-28 11:22:00 +00:00
Takashi NATSUME f194a5abad Add return-request-id-to-caller function(2/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/agents.py
* novaclient/v2/aggregates.py
* novaclient/v2/availability_zones.py
* novaclient/v2/certs.py
* novaclient/v2/cloudpipe.py
* novaclient/v2/fixed_ips.py
* novaclient/v2/flavor_access.py
* novaclient/v2/flavors.py
* novaclient/v2/floating_ip_dns.py
* novaclient/v2/floating_ip_pools.py
* novaclient/v2/floating_ips_bulk.py
* novaclient/v2/floating_ips.py
* novaclient/v2/fping.py
* novaclient/v2/hosts.py
* novaclient/v2/hypervisors.py
* novaclient/v2/images.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: Ic624d532f1a468dd45105bbb5aa6d8a730984338
Implements: blueprint return-request-id-to-caller
2016-01-27 02:45:22 +00:00
Takashi NATSUME f9aa277c62 Add return-request-id-to-caller function(1/5)
Add return-request-id-to-caller function to
'Server' resource and 'ServerManager'.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/servers.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I8c2d3abcebba7823f42e2f27356e73bc6d7ade42
Implements: blueprint return-request-id-to-caller
2016-01-27 11:44:19 +09:00
Jenkins 1cf3fa9d77 Merge "[microversions] Add support for 2.14" 2016-01-21 17:22:53 +00:00