Commit Graph

13 Commits

Author SHA1 Message Date
zhangbailin 8744bea0e3 Microversion 2.80: Add user_id/project_id to migration-list API
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
2019-10-16 14:07:28 +00:00
Matt Riedemann 96dcf13f46 Clarify --migration-type migration value as cold migration
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
2019-08-26 11:26:18 -04:00
Matt Riedemann 0e7c99c8ea Add --migration-type and --source-compute to migration-list
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
2019-08-08 18:13:33 -04:00
chenke 2ecb39710f Optimize limit option docs string description for novaclient
Change-Id: I85ee36b0447869771782d1059957a46447940b59
2019-05-17 11:01:30 +08:00
zhangbailin 4464a88737 Add support changes-before for microversion 2.66
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
2018-09-24 15:14:18 -04:00
Yikun Jiang ad0c036fb6 Microversion 2.59 - Migrations list pagination
Add optional parameters 'limit', 'marker' and 'changes-since' to the
os-migrations endpoints for pagination.

  /os-migrations?limit={limit}&marker={migrations_uuid}
  /os-migrations?changes-since={changes-since}

Change-Id: I7437a61ee07c339b43d008204d1416044a407b68
Implement: blueprint add-pagination-and-change-since-for-migration-list
Depends-on: I7e01f95d7173d9217f76e838b3ea71555151ef56
2018-01-22 11:30:42 -05:00
Matt Riedemann 40bf060233 Remove deprecated MigrationManager.list cell_name kwarg
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
2018-01-11 16:40:10 -05:00
Yikun Jiang 50460bddfc Use utils.prepare_query_string instead of duplicated code
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
2017-11-22 13:35:27 +00:00
nidhimittalhada 9a27201416 client.logger.warning wrongly used in migrations
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
2017-06-02 16:18:20 +05:30
He Jie Xu 59f885896a Add `instance-uuid` flag to the migration-list
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
2017-04-25 13:19:54 +08:00
libing 736ed310ac Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I4c8c83315897c7e64b05402c233b0fa67eb03a6e
2017-03-25 14:03:26 +08:00
Timofey Durakov e08823198d Deperecate cell_name cli arg for migration-list
This patch adds deprecation warning for usage of
cell_name argument in migration_list command.

Change-Id: I54468682d5391668a513e708e26bc3c165c95ca1
Related-bug: #1668743
2017-03-01 15:07:13 +00:00
Andrey Kurilin f834711d2f Move all extensions from contrib dir
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
2016-11-30 18:00:05 +00:00