Commit Graph

574 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
Rui Chen 4e76f9590b Fix issue of quota-show and quota-defaults
quota-show and quota-defaults not work because 'SessionClient'
object has no attribute 'tenant_id'. Try to get project_id
from auth_ref when cs.client is SessionClient instance.

Change-Id: Ic125a99ba34e911485868454c3c7531a34eabdc9
Closes-Bug: #1407388
2015-02-03 10:29:04 +08:00
James Penick a5ea58fec9 Refer to the admin password consistently
The docstrings refer to instance passwords as the admin password, root
password, or simply as "password". That makes documentation difficult to
understand. I've cleaned things up where appropriate.
 I did not change the 'root-password' command in this patch, im planning
to do that in a separate patch.

Cleaning that up to have everything
refer to the instance password as "admin password" for clarity.

Change-Id: I421edcaf18bf8536d5e43f71db6e868868154be3
2015-02-02 19:24:47 +00:00
Jenkins a9223d314e Merge "Adds separate class for Hypervisor Stats" 2015-01-27 02:20:41 +00:00
Jenkins 664608200d Merge "In strings/comments change Ip/ip to IP" 2015-01-22 19:10:41 +00:00
Christian Berendt c58bc211f7 In strings/comments change Ip/ip to IP
The correct short form of "Internet Protocol" is IP.

Change-Id: Ie5412fafbb093e0948970f030e443bed360c71ea
2015-01-17 08:53:26 +01:00
Pedro Navarro 9ee6d696e2 Improving the help of the lock command
The lock command allows you to block the actions
on the server for the non-admin users. Improving
the help so that api users understands better
what locking a server implies.

Change-Id: Ibccdd672587c4dc9570b86f0132a64204fe9b5c2
Closes-Bug: #1366279
2015-01-16 09:55:17 +01:00
Joe Gordon 0eb2e72d38 Move to hacking 0.10
Release notes: http://lists.openstack.org/pipermail/openstack-dev/2015-January/054165.html

Explicitly move everything to new style classes (H238).
http://python3porting.com/preparing.html#use-new-style-classes

Remove deleted hacking rules from tox.ini

Change-Id: If65b0060e6f64a456b4869ef4129ad15aef107fb
2015-01-12 09:40:49 +13: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
David Kranz 7bced6673c Document unexpected need for --all-tenants when using --tenant
This behavior was changed in v3 but that is now obsolete.

Change-Id: I5e1ce2ab3ac60dc637c4416cbe1be088230c07b6
Related-Bug: #1185290
2015-01-06 09:36:37 -05:00
Jenkins 0dcdfa4222 Merge "Display tenant id with nova list --all-tenants" 2015-01-06 06:04:22 +00:00
Haiwei Xu c8ac6883c3 Add 'Id' column to floating-ip-list
Currently nova floating-ip-list doesn't show the ip's id,
though the id is return from the server.
This patch adds the 'Id' column.

Change-Id: I8680fb6344bf8f6862a476cdb95c936a5fbab965
Closes-bug: #1404091
2014-12-19 11:49:33 +09:00
yamini sardana 5f154636c2 Display tenant id with nova list --all-tenants
For each server, nova list --all-tenants will now display
its corresponding tenant ID as well.

Change-Id: I586d6c5bbb15ebb5df25dc4fa849ac4d5af149e9
Closes-bug: #1403431
2014-12-18 16:13:49 +05:30
Steven Kaufer 4b530bf9d6 novaclient sort parameters support
Adds sorting support to the 'nova list' command.

--sort <key>[:<direction>]

The --sort parameter is comma-separated and is used to specify
one or more sort keys and directions. The direction defaults to
'desc' for each sort key and the user can supply 'asc' to
override.

Partially implements: blueprint nova-pagination

Change-Id: I635e017c7f9ab61812333983bfecccd6fce8d394
2014-12-16 18:38:24 +00:00
Andrey Kurilin 821643e126 Use `arg` and `env` from cliutils: v1_1/shell
To remove aliases for `arg` and `env` functions in novaclient.utils,
we should use `arg` and `env` directly from cliutils in novaclients modules.
This is the first stage: change usage in novaclient.v1_1.shell

Change-Id: I237f0473844de49db8a4b141a9a71603c9ac76a7
2014-12-04 17:21:32 +02:00
Eugeniya Kudryashova d06a8dbb93 Fix E128 failures in novaclient/v1_1/shell
E128 continuation line under-indented for visual indent

Change-Id: Ibc2e42e4d2070ae666ceef9598269fef576af46b
2014-11-18 17:21:30 +02:00
Jenkins 99a4439947 Merge "Support using the Keystone V3 API from the Nova CLI" 2014-11-18 01:52:42 +00:00
Jenkins 252cd0819a Merge "Allow to start/stop multiple servers" 2014-11-13 16:34:15 +00:00
Jenkins 6f873cf9d7 Merge "Add limits to V3 and improve limits formatting in shell" 2014-11-13 16:34:00 +00:00
Jenkins 525a510b5a Merge "Define helper to run an action on many resources" 2014-11-13 01:10:51 +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
Ken'ichi Ohmichi 57ae6ce955 Fix the help comment about metadata
If passing metadata with "--meta" option, the metadata is stored into
meta_data.json file on the metadata server like:

 $ curl http://169.254.169.254/openstack/latest/meta_data.json
 {
     "hostname": "vm01.novalocal",
     "meta": {"key01": "value01", "key02": "value02"},
     "name": "vm01",
     [..]
 }

This patch fixes the help comment.

Change-Id: I7359d4c2b0aec6d5d07be7938d0000ca23c93ff0
2014-11-06 14:34:47 +09:00
Andrey Kurilin 3065afd6c0 Enable check for E129
E129 visually indented line with same indent as next logical line

Change-Id: I438bf0d9de7f61ab65e753169c9a8007e84b215a
2014-10-23 14:28:57 +00:00
Andrey Kurilin ae6c39397e Enable check for E127
E127 continuation line over-indented for visual indent

Change-Id: I9dfd489565ee2d1469b2048a930c3a8384dd245d
2014-10-23 14:28:50 +00:00
Andrey Kurilin 8de2237cc4 Enable check for E126
E126 continuation line over-indented for hanging indent

Change-Id: Id64edce8278d96c1b2d4a6ca536e9fc8fbef478c
2014-10-23 17:28:25 +03:00
Jenkins cb102e0d18 Merge "Add missing parameters for server rescue" 2014-10-23 11:07:17 +00:00
Cedric Brandily 70172026f1 Allow to start/stop multiple servers
This change allows to pass multiple server names/ids to nova
start/stop.

Change-Id: Ide577a1016de3d09f31c1f6e7b61079380d99060
2014-10-22 18:41:17 +02:00
Cedric Brandily 333d2e7bd9 Define helper to run an action on many resources
This change defines do_action_on_many function as a helper to run an
action on many resources (like nova delete).

Change-Id: I1c45d11a520703c57e3ac1923d94ec5f864f266b
2014-10-22 16:20:30 +02:00
M. David Bennett b6db84c9f8 Add missing parameters for server rescue
The server rescue call supports passing a password and an image,
however novaclient does not have options to support this. This commit
adds these options and updates the related unit tests to support the
change.

Change-Id: I14c878c0027f8206671ee001ba5195f94f842314
2014-10-20 14:31:25 -05:00
Amandeep 2d6047ffb4 no way to delete valid/invalid security rule
Previously deleting valid/invalid security
group rules was throwing the error of
"AttributeError". With this fix, now both
types of security group rules can be deleted.

Change-Id: I253c2742efe69ee41976c88ca2775189bc5bde0d
Closes-Bug: #1163469
2014-10-20 09:51:12 +05:30
Andrey Kurilin dc09cf27e3 Port to use oslo.i18n
Module gettextutils from oslo-incubator was graduated to separate
library (oslo.i18n) and removed from repository, so we should use
new library.

Change-Id: I15d36ac5a2bb88b332ffa38d29488b75c55a20a9
2014-10-16 01:19:48 +03:00
Russell Bryant e82b46bb93 Clarify "nova scrub" help text
I came across the "nova scrub" command today.  Someone was reporting
that it did not delete everything they expected it to.  It only
deletes networks and security groups associated with the project, so
update the help text to make that more clear.

Change-Id: Id769018787cc73d52ab5fc93196e69bc0ec785ea
2014-10-08 15:21:28 -04:00
Haiwei Xu 9d5164acee Show 'state' and 'status' in hypervisor-list
Currently hypervisor-list only shows 'ID' and 'Hypervisor hostname',
but in fact nova server response also contains 'state' and 'status'
attributes, it's better to show all the attributes.

Change-Id: I97cd18a8451dc515c5fb19841f11d0e85bd0b484
Closes-Bug: #1376664
2014-10-03 09:42:57 +09:00
Jenkins de94ddfce3 Merge "Add list by user to shell" 2014-09-22 01:53:32 +00:00
Andrey Kurilin d03014cdb0 Use common code instead of novaclient.utils
Module `novaclient.utils` contains a lot of functions which are
presented in modules from common code.

* service_type -> novaclient.openstack.common.cliutils.service_type
* get_service_type -> novaclient.openstack.common.cliutils.get_service_type
* pretty_choice_list ->
      novaclient.openstack.common.cliutils.pretty_choice_list
* import_class -> oslo.utils.importutils.importclass
* HookableMixin -> novaclient.openstack.common.apiclient.base.HookableMixin

Change-Id: Ia6cac058da12c852d92f26875a66ae31cc4c63d4
2014-09-19 16:56:13 +03:00
Phil Day 2e64986532 Add list by user to shell
Adds "--user" as a search option to the list command.

Also since seach by tenant or user also needs all_tenants=1 add
this to the seach options automatically instead of making users
remember to add it

Change-Id: Icc828080b400aecdb320b721c569992677848cc6
2014-09-18 17:40:45 +00:00
Jenkins 3e5dae84a8 Merge "secgroup-create description is not optional" 2014-09-17 22:34:24 +00:00
Jenkins a6dc7fc43e Merge "Add support for the server group quotas" 2014-09-17 17:05:08 +00:00
Jenkins b8ad231654 Merge "add new command get-serial-console" 2014-09-17 15:09:22 +00:00
Jenkins ce115063bb Merge "Don't display duplicated security groups" 2014-09-16 03:44:24 +00:00
Chris Yeoh bd65fde64c secgroup-create description is not optional
The description field to the Nova API for secgroup
create is not optional. This enforces the supplying
of the description field in novaclient as the Nova
call will fail if it is not supplied.

v3 version does not need to be updated as it was never
changed.

Change-Id: I6fc823990190b935a8e1214efc8c3ac3a0941abf
Closes-Bug: 1367121
2014-09-16 11:25:18 +09:30
Cyril Roelandt 730fa4d0b2 Add support for the server group quotas
Implements: blueprint server-group-quotas
Change-Id: I440d460d227f4447c2b960b6343b8fe1f6cbd3fb
2014-09-12 18:25:24 +00:00
Chris Yeoh 4bd0c389c0 quota delete tenant_id parameter should be required
Makes the quota-delete tenant_id parameter required rather than
optional. Currently if not supplied it will pass 'None' as the tenant id
to the Nova API. It will be silently ignored (at least until
https://review.openstack.org/120971 has merged after which it will fail)
and no quota will be deleted.

Change-Id: I3ad8f36e92ed9ac54bf892f329ce3feb56f01be5
Closes-Bug: 1367127
2014-09-12 21:07:39 +09:30
Sean Dague 3d68063809 Don't display duplicated security groups
As reported by users, we end up displaying duplicate security groups
on multi nic vms using neutron. Let's not do that.

Also add security group listing to the v3 client to make it
consistent.

Change-Id: I0a983aac08aaeacf3c2aef5aae49f64265fe78c5
Closes-Bug: #1331307
2014-09-12 06:47:03 -04:00
Jenkins 4dbf1323cc Merge "Enhance network-list to allow --fields" 2014-09-10 12:09:06 +00:00
Sahid Orentino Ferdjaoui e7f880532d add new command get-serial-console
Adds v1.1 command get-serial-console

Change-Id: Id6b1e470088a72409f5609538be72c3cf2288a86
Parial-Implements: blueprint serial-ports
2014-09-10 08:37:04 +00:00
Jenkins 7377b42482 Merge "Use oslo.utils" 2014-09-08 17:39:25 +00:00
Jenkins 3fa05957da Merge "Add support for security-group-default-rules" 2014-08-29 11:20:19 +00:00
Jenkins 146fe804a8 Merge "Adding cornercases for set_metadata" 2014-08-28 11:11:49 +00:00