Commit Graph

24 Commits

Author SHA1 Message Date
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
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
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
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
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 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
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
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
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
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
Balazs Gibizer 5a3956c399 [microversions] Add support for 2.14
In I54bfa1275e188573c1b95d770d89160a86cdf52c the onSharedStorage
flag is removed from the evacuate API. This patch removes it from
the novaclient as well.

Implements: bp remove-shared-storage-flag-in-evacuate-api
Change-Id: I5ae75fdac226f0246f22a4d5245c1e4952571fc1
2015-12-31 12:51:45 +01:00
Mark Doffman cce7cd3277 Support the server side remote-console API changes
In microversion 2.6 the remote-console API was changed.
See http://docs.openstack.org/developer/nova/api_microversion_history.html
for details of those changes.

This adds support for the new remote-console API.

Change-Id: I67098d6ce8c71f3ac0073628fd3b0aa23cd81918
Closes-Bug: #1500688
2015-10-22 10:14:13 -05:00
Andrey Kurilin b80ac974e3 Add mechanism to vm list to return all resources
This patch adds a loop to servers list, which makes calls to API side until
all resources will be listed.

Also, there are several functional tests are added with checks of markers
and limit.

Change-Id: Ic030a68867781cca25e723ab51986d87ecd3ab2e
2015-08-27 12:48:05 +03:00
Andrey Kurilin ccff3d3c94 Remove all imports from oslo namespace
oslo namespace is deprecated

Change-Id: I345eb210222d8e973b99f27821099f52883ab27d
2015-04-20 13:52:38 +03:00
Sergey Nikitin aeb8c0c5e9 Moved set of asserts from post_servers_1234_action methods.
Methods tests.v1_1.fakes.FakeHTTPClient.post_servers_1234_action
and tests.fixture_data.servers.V1.post_servers_1234_action
contain a set of same asserts. These asserts moved to method
check_server_actions. This method is shared between
post_servers_1234_action methods.

Some almost equal asserts are grouped.

Change-Id: I2643e77fe30400d462731bbc57351460fb28dc92
2015-02-05 14:11:11 +03:00
Joe Gordon 3561772f8b Move unit tests into unit test directory
In order to pave the way for functional testing, move existing unit
tests into a directory labeled unit. A subsequent patch will add a
directory for functional tests.

Change-Id: I0adb8b9f14451acb382c725d31f5387b4b6d82bb
2015-01-27 13:06:06 -08:00