Commit Graph

9 Commits

Author SHA1 Message Date
Andrey Kurilin 0a60aae852 Rename v1_1 to v2
Module novaclient.v1_1 is used as implementation of V1.1, V2 and V3.
Since future development(microversioning) will be done across V2,
implementation should be done in appropriate module(to prevent misleading).

Despite the fact that implementation for all versions are equal, discover
method for contrib path worked only for v1.1. This patch fixes this bug and
modifies shell tests to check all versions.

Change-Id: Ib6798f4dfe177586302141f522dc593560ce6a5b
2015-02-04 17:40:46 +02:00
Matthew Gilliard b5e36ced8f Adds separate class for Hypervisor Stats
Hypervisor stats was being called from the Hypervisors class, which means that
the statistics were being modeled as if they were a single Hypervisor. This
mostly worked, except that the stats didn't have an id field so a call to
__repr__() (implicitly called by print, or in the REPL) would throw an
AttributeError.

This patch creates a new class HypervisorStats which models a collection of
statistics about hypervisors. So you can now call:

  nc.hypervisor_stats.statistics()

The old call of

  nc.hypervisors.statistics()

is left for backward compatibility but just calls into the new method.

Change-Id: Ia31aacb95b1d517dab3ad38763d6448715bab68e
Closes-bug: 1370415
2015-01-09 08:45:17 +00:00
Eric Guo d44e598692 Remove usage of module py3kcompat
Module py3kcompat was removed from oslo-incubator. We need remove its
usage in client side firstly. This make us move smoothly when sync
oslo-incubator code.

Change-Id: I8b07c32c9852e747579a23685f3c8a07ac13ec01
Partial-Bug: #1280033
2014-02-25 09:17:54 +08:00
Chuck Short c450b39828 python3: Fix imports for py2/py3
Python3 reorganized the standard library and moved several functions
to different modules. Six provides a consistent interface
to them through the fake six.moves module.

However, the urlparse, urllib2, etc modules have been combined
into one module which Six does not support so we do it via
py3kcompat.

Modules such as StringIO and CStringIO have been removed
completely so we use the io module.

Change-Id: I53adac11b634de2c710fc39def36bcec96366710
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-08-27 14:50:34 -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
Vishvananda Ishaya 576a64fbb5 Allow resources to use any field as 'name'
The 'name' field for some resources is called something different,
for example 'display_name' for volumes. There was a hack in our
find method to search for display_name as well.

This change adds a new class variable to a Resource to tell it
which attribute to use for searching by name. Volumes and snapshots
were switched to use 'display_name' and hypervisors were switched
to use 'hypervisor_hostname'.

Tests fixed and added.

Fixes bug 1034536

Change-Id: I1b4fb969d42c59d1ab8e3e275a563bbe158e9264
2012-08-08 12:01:40 -07:00
Kevin L. Mitchell 85d591b1d8 Add call to get hypervisor statistics
Adds an admin API call to retrieve the compute node statistics for an
entire nova instance.  Counts up all hypervisors and sums all their
values (vcpus, vcpus_used, etc.).

Change-Id: I0a3df235282089f1313d08ae5b89dadbd1db9840
2012-07-23 17:10:27 -05:00
Kevin L. Mitchell dff56d84cc Add support for hypervisor-uptime.
Adds support for the new uptime call to the hypervisors extension to
nova.  This allows the results of "uptime" on the hypervisor to be
returned to the caller.  Note that currently, only XenAPI implements
the underlying method; if the version of nova uses another virt
driver, the result will be a 501 error.

Change-Id: I34cc92557e6d22705a5591e54404b32245dbe16a
2012-07-09 14:00:33 -05:00
Kevin L. Mitchell a11788515e Add hypervisor information extension.
Adds support for a new nova extension for getting information about
hypervisors (as opposed to compute hosts), including a list of
hypervisors matching a regular expression (database regular
expression, i.e., %'s) and a list of hypervisors with the list of
instances living on those hypervisors.

Change-Id: I7353991ffbf484da175a0912ee46e80f623e230f
2012-06-29 12:21:19 -05:00