Commit Graph

39 Commits

Author SHA1 Message Date
Andrey Kurilin cc62efef41 Remove code related to V3
Since V3 API is not supported, code related to it should be removed.

Discussion in mailing:
http://lists.openstack.org/pipermail/openstack-dev/2014-December/052095.html

Change-Id: Iac5c5e6d81479cbeb8bf10cfcda1cc5617680de8
2014-12-03 14:11:39 +02:00
Jenkins 99a4439947 Merge "Support using the Keystone V3 API from the Nova CLI" 2014-11-18 01:52:42 +00:00
David Hu 8597a0c234 Support using the Keystone V3 API from the Nova CLI
This changeset enables support for Keystone V3 authentication
on the Nova CLI. This provides consistency between using
novaclient as the Nova CLI and using it as a library
as the Keystone V3 support already exists for the libary usecase.

The bulk of the change surrounds the use of the keystoneclient
session object for authentication, retriving the service catalog,
and HTTP connection/session management.

Co-Authored-By: Morgan Fainberg <morgan.fainberg@gmail.com>
Change-Id: Iece9f41320a8770176c7eeb5acd86be4d80cc58f
2014-11-11 21:04:20 -08:00
Phil Day ae8eadc451 Add limits to V3 and improve limits formatting in shell
Adds support for the limits API to the v3 client.

Also improve the formatting of absolute-limits from

+-------------------------+-------+
| Name                    | Value |
+-------------------------+-------+
| maxServerMeta           | 128   |
| maxPersonality          | 5     |
| maxImageMeta            | 128   |
| maxPersonalitySize      | 10240 |
| maxTotalRAMSize         | 51200 |
| maxSecurityGroupRules   | 20    |
| maxTotalKeypairs        | 100   |
| totalRAMUsed            | 512   |
| maxSecurityGroups       | 10    |
| totalFloatingIpsUsed    | 0     |
| totalInstancesUsed      | 1     |
| totalSecurityGroupsUsed | 1     |
| maxTotalFloatingIps     | 10    |
| maxTotalInstances       | 2     |
| totalCoresUsed          | 1     |
| maxTotalCores           | 20    |
+-------------------------+-------+

to

+--------------------+------+-------+
| Name               | Used | Max   |
+--------------------+------+-------+
| Cores              | 1    | 20    |
| FloatingIps        | 0    | 10    |
| ImageMeta          | -    | 128   |
| Instances          | 1    | 2     |
| Keypairs           | -    | 100   |
| Personality        | -    | 5     |
| PersonalitySize    | -    | 10240 |
| RAM                | 512  | 51200 |
| SecurityGroupRules | -    | 20    |
| SecurityGroups     | 1    | 10    |
| ServerMeta         | -    | 128   |
+--------------------+------+-------+

Change-Id: I93a456b402aeba8e39480567edb090cbb1898d16
2014-11-07 10:51:06 +00:00
Christian Berendt 33058cbe8e Enable several checks and do not check docs/source/conf.py
* E265 block comment should start with '# '
* H302 import only modules

Do not check docs/source/conf.py. The file is imported from the
cookiecutter template.

Documented why checks are ignored and if they should be enabled
in the future.

Change-Id: I367064ecaa6d1fd9d918f7ce003303e2db660647
2014-08-05 22:18:14 +02:00
Mark McLoughlin 9f1ee1249a Mention keystoneclient.Session use in docs
Jamie added some excellent "Using Sessions" docs to keystoneclient in
I5e44c1029ce160cb2798cfb8a535aa9f3311799a. These will be published to

  http://docs.openstack.org/developer/python-keystoneclient/using-sessions.html

once the version after 0.9.0 is released.

Let's add a brief example on how to use this API and reference the
keystoneclient docs.

Change-Id: Icbcef45f13c1f962c90aa3db9dde4360520166ff
2014-07-01 16:53:47 +01:00
Jamie Lennox cc7364067f Allow us to use keystoneclient's session
The session object is a cross-client means of standardizing the
transport layer.

Novaclient's HTTPClient object has diverged significantly from other
clients. It is easier to simply replace it if a session is provided. If
a session is provided then users of the library need to be aware that
functions such as authenticate() will no longer have any effect/are in
error because this is no longer managed by nova.

Change-Id: I8f146b878908239d9b6c1c7d6cdc01c7e124f4e5
2014-07-01 16:53:47 +01:00
Chris Yeoh 6aa419b82e Adds clarification note for project_id vs tenant_id
The client __init__ method takes both a project_id and tenant_id which is
rather confusing as in the Nova API these terms are used interchangeably. The
comment clarifies the difference between a project_id and tenant_id
when using novaclient.

For backwards compatibility reasons we can't really change the names (though for V3
perhaps we should in the future).

Change-Id: I569fe9318335c8d686153b0936205cb190e01ef1
2014-06-30 09:26:13 +09:30
Rick Harris 4c8cefb98a Overhaul bash-completion to support non-UUID based IDs
There are a few things currently wrong with bash-completion as it stands now:

    1) IDs are currently required to be UUIDs. This is an arbitrary limitation
       and doesn't make sense for certain kinds of objects, like `Flavors`
       where a valid ID could be `performance-16gb`.

    2) The code is spread out between Oslo's `Resource` and Novaclient's
       `Manager` class. This makes it difficult to improve the code because it
       requires changes to two separate projects. We should centralize the
       code in Novaclient until the API is stable, then import the code into
       Oslo in its entirety, not partially like it is now.

    3) The completion code is handled by the `Manager` of which there is one
       per Resource-type. In the interest of centralizing this functionality,
       we should create a `CompletionCache` class and hang it off of `Client`
       of which there is one-per-session.

    4) The completion-code currently runs by default even in headless mode
       (e.g. novaclient without the shell). It'd be much more efficient to
       only write to the completion cache if we're accessing the `Client` from
       the novaclient shell. We can make this an option to support third-party
       CLI clients that want to use the completion-cache as well.

NOTE:
    * The corresponding Oslo patch is here:

        https://review.openstack.org/#/c/101376/

    * This patch was tested in multithreaded mode to prevent any regression
      from:

        https://bugs.launchpad.net/python-novaclient/+bug/1213958.

Change-Id: Idada83de103358974b739f81d4f392574f9e1237
Closes-Bug: 1332270
2014-06-20 16:37:28 -05:00
Matt Riedemann bdbc3afc51 Remove quota-class-* commands from v3 shell
Commit 1b15b23b0a629e00913a40c5def42e5ca887071c removed the
os-quota-class-sets v3 API from Nova in Icehouse.  This change removes
the corresponding client code.

Closes-Bug: #1331095

Change-Id: Iaa2f4063e0f671da5a54ff89d0f1c1780a2687c4
2014-06-17 12:42:20 -07:00
Sergio Cazzolato d05da4e985 Revert "Remove quota-class subcommand"
This reverts commit 7c11b06bd4.

The quota_class subcommand was used to set default quota values
so it shouldn't have been removed.

Related mailing list thread on the topic:
http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Change-Id: I8f392f8e54bef52c1c950f75377e6bb93a41996d
Partial-Bug: #1299517
2014-05-29 16:50:31 -03:00
Ken'ichi Ohmichi 661231817d Add extension-list command for v3 API
Nova returns available extension list through its REST API.
The command of v2 API has been implemented, and this patch adds the
one of v3 API.

Note:
The command name of v2 is "nova list-extensions" but the one of v3,
which this patch adds, is "nova extension-list" because the name fits
to the other command names.

Change-Id: Ibee712b0aa5898a94e362f20be71e8863500b195
2014-05-08 09:26:14 +09:00
Boris Pavlovic 98934d7bf1 Fix session handling in novaclient
Prior to this patch, novaclient was handling sessions in an inconsistent
manner.

Every time we created a client instance, it would use a global
connection pool, which made it difficult to use in a process that is
meant to be forked.

Obviously sessions like the ones provided by the requests library that
will automatically cause connections to be kept alive should not be
implicit. This patch moves the novaclient back to the age of a single
session-less request call by default, but also adds two more
resource-reuse friendly options that a user needs to be explicit about.

The first one is that both v1_1 and v3 clients can now be used as
context managers,. where the session will be kept open (and thus the
connection kept-alive) for the duration of the with block. This is far
more ideal for a web worker use-case as the session can be made
request-long.

The second one is the per-instance session. This is very similar to what
we had up until now, except it is not a global object so forking is
possible as long as each child instantiates it's own client. The session
once created will be kept open for the duration of the client object
lifetime.

Please note: client instances are not thread safe. As can be seen from
above forking example - if you wish to use threading/multiprocessing,
you *must not* share client instances.

DocImpact

Related-bug: #1247056
Closes-Bug: #1297796
Co-authored-by: Nikola Dipanov <ndipanov@redhat.com>
Change-Id: Id59e48f61bb3f3c6223302355c849e1e99673410
2014-04-07 19:38:51 +02:00
Jenkins a002abc060 Merge "Remove quota-class subcommand" 2014-04-01 23:09:17 +00:00
Phil Day dd8bde71ff Allow user ID for authentication
In Keystone V3 user names are no longer necessarily unique
accross domains.

A user can still authenticate a user in the non default
domain via the V2 API providng they use IDs instead of names.

Tenant_ID is already supported, this change adds support
for user ID

Change-Id: I36ba75f3e67c8cdb959e31923d5e557414ab6f9b
2014-03-07 19:24:22 +00:00
Masayuki Igawa 7c11b06bd4 Remove quota-class subcommand
quota-classes API was already removed.
  Change-Id: I1110022d6f628d03aaf363da707f2d2ef1600437
This patch removed quota-class subcommand from nova client.

Change-Id: I18bf7c255fabdb52c8ce8159f68c3e5c70e54993
2014-03-03 14:30:56 +09:00
Jenkins 20c4226725 Merge "Adds volume support for the V3 API" 2014-01-25 18:35:18 +00:00
Alexis Lee bd9ebc5d27 Don't call CS if a token + URL are provided
Adds --os-auth-token (matching Glance client at least) to accept a
pre-obtained authentication token.

CS will be called iff:
      One or both of token and URL are not provided;
  AND the cache is empty/disabled or we don't have a tenant-id.

Removed some code altering the auth request to a GET if a token is
supplied - did not work for me and I think the path was dead previously.
Fixed test to account for this change.

Completes blueprint token-endpoint-instantiation

Change-Id: I67410b80e506bb80c152223cd113b7139a62a536
2014-01-15 17:11:35 +00:00
Chris Yeoh 61d88463da Adds volume support for the V3 API
Adds the ability to attach, detach and swap volumes on
servers. There is no code shared with the v1_1 version
because for V3 the volumes interface is completely different
and the attach/detach/swap functionality is simply a server
action rather than something accessed through a special resource.

Partially implements blueprint v3-api

Change-Id: Ib405f821fe557745d11cff9db08381fc15233fe5
2014-01-11 13:53:10 +08:00
Sahid Orentino Ferdjaoui 0ddcf11732 Removes vim configuration headers
- Removes vim headers: It's not needed to set tabstop tons of times,
   this can be done by setting vimrc.
 - I did not update files in common/* and install_venv_common.py because
   these files are sync with oslo.

Note:
  http://lists.openstack.org/pipermail/openstack-dev/2013-October/017353.html

Closes-Bug: #1265474
Change-Id: Ia09dc2c908187a756bf55eaba74655484304517d
2014-01-08 08:13:46 +00:00
Chris Yeoh 3b5b7b9da3 Adds simple tenant usage support for the Nova V3 API
Adds support and tests for the os-simple-tenant-usage
extension for the Nova V3 API. There are no
differences between the V2 and V3 API and this change
adds the client code to enable the usage command. Note
that with nomenclature change from tenant to project
occuring in Nova there will be a difference between
the V2 and V3 API in the future.

Differences between the V2 and V3 API are described here:
https://wiki.openstack.org/wiki/NovaAPIv2tov3

Partially implements blueprint v3-api

Change-Id: Iddf6211c9c87cbb191d9a5d5a65710b343c30e67
2013-12-19 23:40:40 +10:30
Chris Yeoh a29b7c7cc7 Adds keypairs support for the Nova V3 API
Adds support and tests for the keypairs extension for
the Nova V3 API. The V3 version of the keypair extension
has been made part of the core V3 API and as a result no longer
has the "os-" prefix in the url.

Differences between the V2 and V3 API are described here:
https://wiki.openstack.org/wiki/NovaAPIv2tov3

Partially implements blueprint v3-api

Change-Id: Id4a77e1e4565f63ecdf7753d3c224975519fc07c
2013-12-19 23:40:00 +10:30
Chris Yeoh e0d7c49043 Adds certificates support for Nova V3 API
Adds support and tests for the os-certificates extension
for the Nova V3 API

Partially implements blueprint v3-api

Change-Id: I9a75bf04a7047af6c501af2df72de4b8ce3462b0
2013-12-19 23:39:28 +10:30
Chris Yeoh 4c9cc001ba Adds aggregates support for Nova V3 API
Adds support and tests for the os-aggregates extension
for the Nova V3 API.

Partially implements blueprint v3-api

Change-Id: Ibe251f083ea444fb46aac9cc5cf08784b5826ad7
2013-12-19 23:38:56 +10:30
Chris Yeoh 3c46b26666 Adds hypervisor support for Nova V3 API
Adds support and tests for the os-hypervisors extension
for the Nova V3 API.

Note that compared to the V2 API it separates the search
function into search by hypervisor name and a new list
servers by hypervisor as this better first the changes
in the V3 API. The listing of servers by hypervisor command
is preserved, though reworked to use the new interfaces.

Partially implements blueprint v3-api

Change-Id: I472f9acad895dcf842e93d2de27530652f73867e
2013-12-19 23:38:20 +10:30
Chris Yeoh 94b40dd2f8 Adds services support for Nova V3 API
Adds support and tests for the os-services extension
for the Nova V3 API

Partially implements blueprint v3-api

Change-Id: Ic64e465e24a6e840c567677d4f2ea9d63b742ccd
2013-12-19 23:37:23 +10:30
Chris Yeoh 6a9c81843f Adds second part of quotas support for Nova V3 API
Adds support and tests for the os-quota-class-sets
extension for the Nova V3 API. Note that compared to
the V2 version this removes the ability to set quotas
which are not relevant to the V3 API (eg injected file
quotas are not relevant because the os-personalities
extension has been removed).

Partially implements blueprint v3-api

Change-Id: I3e7f36407f2f59737ecbce2c8ce014cef623ecdc
2013-12-19 23:36:35 +10:30
Chris Yeoh cfd38a7ef6 Adds first part of quotas support for Nova V3 API
Adds support and tests for the os-quotas extension
for the Nova V3 API. Note that compared to the V2
version this removes the ability to set quotas
which are not relevant to the V3 API (eg injected
file quotas are not relevant because the
os-personalities extension has been removed)

Partially implements blueprint v3-api

Change-Id: Ifa1c77428424bedf7fb88ef6d7b3843376799d24
2013-12-19 23:36:00 +10:30
Chris Yeoh 40a1c12828 Adds availability zone support for Nova V3 API
Adds support and tests for the os-availability-zones
extension for the Nova V3 API. Also implements
sorting for zone host display which was applied
to the v1_1 version, but not the v3 version in
I9ab25ef52d6d19b45a39f04cbcde864ee225b4cc

Partially implements blueprint v3-api

Change-Id: I8daa2503a2dc8767e9157bdfa6c9adaedfc8f3c0
2013-12-19 23:35:30 +10:30
Chris Yeoh 1746bbac26 Adds basic servers support for the Nova V3 API
Ports servers support from the v1_1 directory omitting functionality
which is no longer supported directly in the V3 API such as:

- floating ip
- add/remove/list of security groups
- disk config related functionality

Makes the appropriate modifications required for parameter name
changes between the V2 and V3 API

Booting an instance is not yet supported as this will require more
extensive changes as image listing services are no longer proxied
through the Nova V3 API

Partially implements blueprint v3-api

Change-Id: I1116e8d8ebc73176223f4135168cc4ab5d904356
2013-12-19 23:35:01 +10:30
Chris Yeoh 76f926fc10 Adds images support for Nova V3 API
Adds support for basic image querying from the image server
rather than the Nova API. The Nova V3 API no longer supports
image querying directly, but in order to support convenience
functions such as specifying images by name rather than ID,
it is necessary to have some basic image query support.

image delete and image meta manipulation is no longer supported
by the client as these features can be accessed directly through
the glance client

Partially implements blueprint v3-api

Change-Id: I9050845d631e9dfc2e110327221d154b8924cd65
2013-12-15 22:52:22 +10:30
Chris Yeoh 59cf27aa3f Adds agent support for Nova V3 API
Adds support and tests for the os-agents extension
for the Nova V3 API

Partially implements blueprint v3-api

Change-Id: I53f8a1cbab6f4dee10fb823bc51ae90baa97fa7a
2013-12-15 22:45:18 +10:30
Chris Yeoh 72b1862c97 Adds flavor access support for Nova V3 API
Adds the remaining flavors support for the Nova V3 API.

Partially implements blueprint v3-api

Change-Id: I46cdec8999f74af37a9ca4280d123907124bad39
2013-12-15 22:44:09 +10:30
Chris Yeoh 9329f435bf Adds flavor support for Nova V3 API
The first part of adding flavor support for the Nova V3 API (support
for flavor-access API calls is still to come).

Restructures v1_1 testcases so as much as possible so they can be
reused for the V3 version of the tests. If it looks too ugly an
alternative would be to just cut and paste the fakes and test
from v1_1 to v3, which is simpler to understand but comes at the
cost of duplicated code. The upside though is it would be much
easier to remove v1_1/v2 support in the future.

Partially implements blueprint v3-api

Change-Id: Ic7cb3c43db02c07d37aea2675b310aaa50639c40
2013-12-15 22:42:48 +10:30
Chris Yeoh fe7ac8800d Sets default service type for Nova V3 API
Set the default service type when talking to the Nova V3 API to
computev3 rather than compute. Although it is rather ugly to have
a different service type for a different version of a service,
this is necessary for the medium term because traditionally the
compute service endpoint has pointed to the V2 API rather than
the root and then version discovery done.

This change allows progression of the V3 API support in
novaclient and although devstack too currently points computev3
directly to the V3 API, the intent is to change this to point to
the root and implement version discovery during the Icehouse
development cycle.

Longer term when the V2 API support is eventually removed we can
reclaim the 'compute' service type and point it to the root.

Partially implements blueprint v3-api

Change-Id: If5d6a0d8af037cde7bf253d71aac2823b89f8066
2013-12-03 16:32:12 +10:30
Ben Nemec 57a22ec99c Add v3 HostManager
Some of the host code required changes to work with the v3 API.
This change adds a v3-compatible HostManager that inherits from
the 1_1 HostManager to make use of the functions that didn't
need to change.

bp v3-api

Change-Id: I3ef7ab4619d49c20ab1bdeb1185ad28b411d37a1
2013-09-17 14:35:43 -05:00
Vitaliy Kolosov 7edda206b1 Small bugfix for client v3
Client.__init__ method used self.os_cache variable in an internal method call
though this variable had not been initialized earlier.
In addition, unittests added for full coverage of client v3.

Change-Id: I421f82932b65f137932d933e04d42064bec0d08d
2013-09-16 11:38:00 +03:00
Ben Nemec 99d978409f Remove old references
The v3 code references v1_1 code because it's a straight-across
copy.  Remove those in preparation for adding the actual v3
versions.

bp v3-api

Change-Id: I359c6c5fc70dd91fa418802cc8048e186f5d09a4
2013-08-09 10:47:52 -05:00
Ben Nemec c0e6d24819 Begin adding v3 api support
Create the v3 directory and populate it with some of the basic
files from v2 that will be needed.  These files are straight
copies so that v3-specific changes will be easier to see in
subsequent changes.

Extensions will be added individually in future changes.

bp v3-api

Change-Id: I9538c70ccc6fb001ce2fd43ccfd41870f247c67e
2013-08-09 10:47:50 -05:00