42 Commits

Author SHA1 Message Date
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
Andrey Kurilin
cd88097ff5 [microversions] Enable 2.21
2.21 - The os-instance-actions API now returns information from deleted
       instances.

Change-Id: Iff514e4fa9135207c6f8e32e444d45b1b61d8c7c
2016-02-24 20:57:34 +02:00
Andrey Kurilin
f279b086d7 [microversions] Enable 2.20
2.20 - From this version of the API user can call detach and attach volumes
       for instances which are in shelved and shelved_offloaded state.

This change changes only server-side checks.

Change-Id: I15a988c730d2fb0be4416dc79b63d357ae990ff7
2016-02-17 13:44:32 +00:00
Andrey Kurilin
1d1e43957d [microversions] Add support for 2.19
2.19 - Allow the user to set and get the server description. The user will
       be able to set the description when creating, rebuilding, or updating
       a server, and get the description as part of the server details.

Methods `rebuild` and `create` of novaclient.v2.servers.ServerManager were
not wrapped with `api_versions.wraps` decorator to reduce code and docsting
duplication. Version checks added inside these methods.

Change-Id: I75b804c6edd0cdf02c2cd002d0b5968fec8da545
2016-02-16 16:20:41 +02:00
Andrey Kurilin
ecaca2279e [microversions] Skip microversion 2.18
2.18 - Establishes a set of routes that makes project_id an optional
       construct in v2.1.

The change on Nova-API side adds only check for existence of
"project_id" at the url. It doesn't check microversion, so all latest
and previous microversions can work with or without project_id.
Proof: all functional tests are succeed on this change (several of them
       use latest microversion).

To cut down "project_id" from the url at the novaclient side, we need to
modify ``novaclient.client.HttpClient`` and
``novaclient.client.SessionClient``. This change requires splitting
Nova's related requests and the others(authentication, volume...), which
are still require "project_id" at the url.

It is a complex task, which can be skipped for now to unblock
implementation of further microversions.

Change-Id: Ia6e608aac41d2f2d59b9504d21647e4f88af3335
2016-02-10 19:04:08 +00:00
Andrey Kurilin
6cbb22583b [microversions] Add support for 2.17
Description of microversion:
  Add a new API for triggering crash dump in an instance. Different operation
  systems in instance may need different configurations to trigger crash dump.

Note:
 - it is hard to write a functional test for this microversion, since it
   requires instance in error state
 - all possible failed responses already covered by novaclient.exceptions

Nova's change: I6ed777ff637254b4b79417008f9055dd19fc7405

Change-Id: If03b1864bbe7074c720b946fc2700bd5d07debc3
2016-01-25 14:24:49 +02:00
Tomi Juvonen
48605fcb43 Added support for Nova microversion 2.16
Added support for new host_status attribute in endpoints
servers/detail and servers/{server_id}.

Partially implements blueprint get-valid-server-state

Change-Id: If72fbcaa02267077dc082a7557c593f35474c4bb
2016-01-19 15:31:22 +00:00
Balazs Gibizer
7cc26eee72 [microversions] Add support for 2.15
With I3f156d5e5df4d9642bb4b0ffac30a6288459ce61 nova introduced
microversion 2.15 which adds two new policies soft-affinty and
soft-anti-affinity for the server-group api.

This patch bumps the nova client microversion support to 2.15.
The novaclient is transparent regarding the policy value of the
server-group api so no further changes are needed. However the
help text of the policies parameter mentioned the possible policies.
This was removed as the current framework does not support providing
different help text for a parameter depending on the microversion.

Implements: blueprint soft-affinity-for-server-group
Change-Id: I739ed1dd3e4c15e28a269c4f980a12a74fb1def0
2016-01-12 17:30:16 +01: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
Kevin_Zheng
b6677ebc03 [microversions] Add support for API microversion 2.13
Nova now supports API microversion 2.13 to
allow return project_id and user_id for
os-server-groups API. Sync this to the
client side.

Change-Id: Ia09ab4bd5c693ed95b0f5dd9bc709b7597f7034e
Closes-Bug: #1526143
2015-12-23 06:39:13 +00:00
Andrey Kurilin
0ec6bedf42 [microversions] Increase max version to 2.12
2.12 - Exposes VIF net-id attribute in os-virtual-interfaces. User will be
able to get Virtual Interfaces net-id in Virtual Interfaces list and can
determine in which network a Virtual Interface is plugged into.

novaclient.base.Resource class is a parent class of VirtualInterface resource.
Since `Resource` is a universal interface for any resources and doesn't
require hard-code attributes which describe partial resource, there are no
required changes to support this microversion in "novaclient as a lib".

"novaclient as CLI" doesn't provide an interface for VirtualInterface yet
(see bug 1522424 for more details). When it will be implemented, we will need
to check that new attribute is displayed correctly.

Based on the fact that 1522424 is not resolved and novaclient.base.Resource
class has enough tests, this patch doesn't require any tests.

Also this patch fixes representation of VirtualInterface resource.

Change-Id: I18cf23847d3b2b01f5a6ffae2ebc4bede54babce
2015-12-07 22:17:22 +02:00
Andrey Kurilin
529a492126 [microversions] Increase max version to 2.11
2.11 - Exposed attribute forced_down for os-services. Added ability to change
the forced_down attribute by calling an update.

This microversion was previously added in [1], but since the support for
2.6-2.10 microversion was missed, the max version was decreased to 2.5[2].

Now, support is added for all microversion 2.1-2.10, so we can enable 2.11
microversion.

[1] - I2b80ac32a95fe80363b4ad95d8d89fff097935a3
[2] - I52074f9a3e7faa6a7a51c3fa9766100acf25dee2 &
      Iba9bfa136245bd2899c427ac0c231a30c00bd7f3

Change-Id: Iab3224a5c3691437e64ab4e06c85ccc2a7deea13
2015-12-07 22:14:23 +02:00
Andrey Kurilin
65658ed6fc [microversions] Add support for 2.10
2.10 - Added user_id parameter to os-keypairs plugin, as well as a new
property in the request body, for the create operation. Administrators will
be able to list, get details and delete keypairs owned by users other than
themselves and to create new keypairs on behalf of their users.

Change-Id: I13ca3f8a4dd9cf11bec79966bb8a2ab48847be22
2015-12-07 22:14:21 +02:00
Andrey Kurilin
0a535e3287 [microversions] Increase max version to 2.9
2.9 - Add a new locked attribute to the detailed view of servers. locked
will be true if anyone is currently holding a lock on the server, false
otherwise.

This microversion doesn't require any change in novaclient's code.
Just added functional tests and changed version

Change-Id: I7f33757e6f03f172e5a13ade0aa5e8d3a10dbf01
2015-12-03 10:10:21 +00:00
Andrey Kurilin
9fe53065ef [microversions] Add support for 2.8
2.8 - Add new protocol for VM console (mks)

Also, this patch removes code duplication and fixes docstrings for consoles
methods.

Co-Authored-By: jichenjc <jichenjc@cn.ibm.com>

Change-Id: Ic24183a5118872581b30f82734fa9d6ce0e53544
2015-12-03 12:09:56 +02:00
Andrey Kurilin
7a9d4e58bf [microversions] Increase max version to 2.7
2.7 - Check the is_public attribute of a flavor before adding tenant
access to it. Reject the request with HTTPConflict error.

Since novaclient already have Conflict expection, there is no required
changes on client side.

Change-Id: I48dca20b3795185363367bac0e2ee65ce938593f
2015-11-30 15:30:04 +02: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
He Jie Xu
28bf8ddb06 Correct usage of API_MAX_VERSION and DEFAULT_OS_COMPUTE_API_VERSION
Commit d045019f0f2d28f26730b3617f7d7b993506b6e8 use the variables
API_MAX_VERSION and DEFAULT_OS_COMPUTE_API_VERSION with wrong way.

API_MAX_VERSION means the max version of client supported. This
variable only be changed when client support the new version. And
it's must bumped sequentially.

DEFAULT_OS_COMPUTE_API_VERSION is default value of option
'--os-compute-api-version', this value decided the default behaviour
of nova client. The nova client CLI behaviour should be that client
negotiate with server side to find out most recent version betweeyn
client and server. So the value should be '2.latest'. And it won't
be changed except we decided to change the default behaviour of nova
client CLI.

Change-Id: Iba9bfa136245bd2899c427ac0c231a30c00bd7f3
Closes-Bug: #1508244
2015-10-21 11:07:32 +08:00
Matt Riedemann
d045019f0f Set DEFAULT_OS_COMPUTE_API_VERSION to 2.5
The client currently implements support for microversions 2.2, 2.4 and
2.11.

According the nova API microversion history:

http://docs.openstack.org/developer/nova/api_microversion_history.html

2.3 just returns extra attributes in the response so it's not a problem
for the client. We should expose those at some point but it's not a
breaking change.

2.5 is a server-side only change since the client allows filtering
servers by IPv6 address but the server wasn't honoring that until 2.5.
There are no client side changes for that microversion.

2.6 is the first backwards incompatible microversion since it replaces
the old specific console APIs (RDP/serial/SPICE/VNC) with a new generic
remote-consoles API. The client must be updated to handle this since
requesting any microversion >=2.6 for consoles will fail right now. This
is exposed on the CLI right now because the CLI defaults to the 2.latest
microversion.

So even though the client actually supports the 2.11 microversion, we
shouldn't default to higher than 2.5 because we have gaps in handling
2.6->2.10.

This change fixes the default for the CLI by setting
DEFAULT_OS_COMPUTE_API_VERSION=2.5.

Partial-Bug: #1500688

Change-Id: I52074f9a3e7faa6a7a51c3fa9766100acf25dee2
2015-10-01 14:18:05 -07:00
Carlos Goncalves
39739158b0 Support forcing service down
Extending Nova CLI to support forcing service to be set/unset as down,
as specified in blueprint mark-host-down.

Depends-On: I612582ba7b70bb6d167aa68bdfc47faa3b7b85ed
Depends-On: I39f1a84c100726f87a4dc464dd9922d66efdb53f
Implements: blueprint support-force-down-service
Change-Id: I2b80ac32a95fe80363b4ad95d8d89fff097935a3
2015-08-07 17:47:59 +01:00
Claudiu Belu
4a812d953b Adds support for x509 certificates as keypairs
Adds new parameter --key-type for novaclient for creating x509
certificates as keypairs. If no --key-type is specified, a ssh
keypair is created, for backwards compatibility.
Adds 'Type' column for keypair-list, displaying the keypair type.

This commit will have to merge after:
https://review.openstack.org/#/c/140313

Depends-On: I215662f2f92a01921a866c3218031787a9eaf915

Implements: blueprint keypair-x509-certificates

Co-Authored-By: Andrey Kurilin <andr.kurilin@gmail.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I12bb13e24b660ffb6da0e5be275acbba7453d011
2015-08-05 19:55:48 +00:00
Andrey Kurilin
9ed9ab68f7 Add version discover and check in CLI
This patch adds version discovery when user request with latest version.
The latest version means the most recently version between server and
client.

Related to bp api-microversion-support
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I0b7a95e77371aef6e349bf54b5dd6ce6c6d2732c
2015-08-04 16:15:01 +08:00
Roman Podolyaka
f08ac04a27 Migrate to pbr.
openstack.common.setup and openstack.common.version are now in the
standalone library pbr, so all projects using those two should
migrate.

Fixes bug 1179007.

Change-Id: I7ac1c37f0bf148619dffff8f454db05fc192e471
2013-05-19 10:00:38 +03:00
Davanum Srinivas
8ce2330247 Fix problem with nova --version
Update to latest openstack.common.version.py and fix __init__.py
to get "nova --version" to work properly again

Fixes LP# 1165325

Change-Id: I29e54cd4cf79759407f3967518e9be575abd994a
2013-04-08 12:15:03 -04:00
Davanum Srinivas
c5b579926f Fix Copyright Headers from LLC to Foundation
follow the lead from nova and oslo projects

Change-Id: I270c5f1e4eefa4b72e292bfb4a4c60de0c3f6e4a
2013-03-13 20:12:23 -04:00
Rick Harris
b54330bfd2 Adding --version option
Change-Id: I7d37af1ddee186af22457baea9af71a955720053
2012-08-24 19:17:46 +00:00
Josh Kearney
d4c9b12f39 Indicate unused variables and other misc. house cleaning.
Change-Id: I4529d8b6b27dddb1b79ee2167a054b471eaf0dbc
2012-06-27 11:55:36 -05:00
Brian Lamar
454daa2cba Tests working again...merged in some work we did earlier. 2011-08-03 17:41:33 -04:00
Brian Lamar
f8496672cc Split everything down the middle into v1_0 and v1_1, including tests. 2011-08-03 16:36:03 -04:00
Sandy Walsh
be03eb5fa4 Merge branch 'master' of github.com:rackspace/python-novaclient 2011-07-12 14:50:31 -07:00
Sandy Walsh
d76d6c9f1f fixed public private ip list 2011-07-12 14:41:56 -07:00
Ed Leafe
eb0d5c75b7 Added support for request timeouts. 2011-07-07 21:07:49 +00:00
Matt Dietz
129d56611c Added a method to create instances on behalf of an account via the admin API methods for openstack 2011-06-13 15:13:33 -05:00
Lvov Maxim
882a266387 fix errors 2011-06-09 11:57:46 +04:00
Lvov Maxim
0853ebebed support for project id header 2011-06-09 10:39:13 +04:00
Sandy Walsh
bcf65fe16e version 2.4 2011-02-25 02:11:32 -08:00
Sandy Walsh
8e615f4446 Added Jacob Kaplan-Moss copyright notices on older/untouched files. 2011-02-25 02:00:13 -08:00
Sandy Walsh
bd18c7e429 renamed to novaclient and fixed flavor tests 2011-02-26 05:04:40 -04:00