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>
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
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>
The code has not been used
since If0161a89877f19f24e91d780cf227fdc48e7e860 .
Change-Id: I106404f9d12814fec2ec2bf16cdd100834085912
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
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>
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
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
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
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
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
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
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
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
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
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
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
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
os-volumes_boot is an old clone of /servers and is not documented in the
API docs. POST to /servers.
Change-Id: If0161a89877f19f24e91d780cf227fdc48e7e860
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
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
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
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
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
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
In previous patch we switched to use SessionClient in all cases. It means that all
HTTPClient code is redundant now.
Change-Id: I5a0da970fd82c79db3d88f1b49279133bbdba639
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
"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
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
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
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
This microversion allows to create/delete/update
server tags and to search servers by tags.
Implements: blueprint tag-instances
Change-Id: I66b6d4a763c507335f27a425bc3d4c2aae377c00
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
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
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
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
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
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
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