Add ``user_id`` and ``project_id`` to the ``GET /os-migrations``
API, and it can called ``--user-id <user_id>`` and/or
``--project-id <project_id>`` by ``nova migration-list`` CLI.
Showing the ``user_id`` and ``project_id`` when using api_version>=2.80
with the server-migration-list or server-migration-show APIs.
Depends-On: https://review.opendev.org/#/c/674243/
Part of blueprint add-user-id-field-to-the-migrations-table
Change-Id: I11343ca265ab2b6b6f46877897d8223ef340c258
This is a follow up to a review discussion [1] where the
"migration" value for the --migration-type option is for
a cold migration. This change just updates docs and help
strings.
An alternative is changing "migration" as a valid value to
"cold-migration" (or accept both) and under the covers treat
"cold-migration" as "migration" for the actual API call.
[1] https://review.opendev.org/#/c/675117/3/novaclient/v2/shell.py@5430
Related to blueprint more-migration-list-filters
Change-Id: I6baa6af8731252e3c4976db06f0ca9cdfcb5e2f1
The GET /os-migrations API take a migration_type and source_compute
filter parameter on the request since the v2.0 API. This adds support
for specifying those parameters in the "nova migration-list" CLI
and related MigrationManager.list() python API binding methods.
A functional test is added which will cover the new options on all
three of the decorated do_migration_list shell methods with lower
bounds on 2.1, 2.59 and 2.66. Since the only type of migration we
can safely generate in a single-node CI job is a resize the test
does a resize. As such, _pick_alternate_flavor is moved into the
base test class for re-use.
Implements blueprint more-migration-list-filters
Change-Id: I4be9a06df3e0d40d3990d067ce112247a81b45b4
This adds the changes-before filter to the servers,
os-instance-actions and os-migrations list for
filtering resources which were last updated before
or equal to the given time. The changes-before filter,
like the changes-since filter, will return deleted
server resources.
Depends-On: https://review.openstack.org/599276/
Part of bp support-to-query-nova-resources-filter-by-changes-before
Change-Id: I7c6ea00303374d605bda8ef1b62c5de1b4567696
The cell_name kwarg was deprecated in Pike:
I54468682d5391668a513e708e26bc3c165c95ca1
And the CLI option was removed earlier in Queens (not yet
released):
I5d11eda2a6b35de98f0484492f597a87df882013
But that change forgot about the python API binding code
so this change removes that as well and updates the release
note.
Change-Id: I0cf808eaf7df80e221b412d2374b81fd402bd037
Closes-Bug: #1668743
There are some duplicated code in nova client for generating
query string.
The 'prepare_query_string' method can convert dict params to
query string(it transforms the dict to a sequence of two-element
tuples in fixed order, then the encoded string will be consistent
in Python 2&3.)
This patch use utils.prepare_query_string instead of these and
plus some notes in the 'prepare_query_string' method.
Change-Id: Idb3c5e97f8bbcd5ec5446f776c10fa8c84b54d5d
Closes-Bug: 1727968
client.logger.warning if reached, will give
this error "No handlers could be found for
logger "novaclient.v2.client"".
Fixed by using warnings.warn() and corrected
root cause by adding appropriate handlers.
Change-Id: I60c8a023cff92f8b6f37a4a14b6193c3efaa19a8
Closes-Bug: #1688507
The user needs to query the specific server's migration history. The
'os-migrations' support 'instance_uuid' as query filter, but that isn't
enabled in the migration-list command. This patch enable that filter.
Change-Id: I137b94f4d73836bcc163b66ab20ee2987042a40f
This patch adds deprecation warning for usage of
cell_name argument in migration_list command.
Change-Id: I54468682d5391668a513e708e26bc3c165c95ca1
Related-bug: #1668743
All extensions from novaclient.v2.contrib should be not be extensions in
case of api version >=2.0;<=3.0 (historically, they are turned on by default
for cli layer), so let's move it from contrib dir and turn on by default.
Change-Id: I4ef4e44cf970947dad33110ce658a133e4f2893e