28 Commits

Author SHA1 Message Date
Terry Howe
8f59524c3e Network CRUD
bp/neutron
https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2

Change-Id: I89ee083154afa544b03587e84becace36d9d522a
2014-06-24 15:00:25 -06:00
Terry Howe
0b2987fef3 Fix find_resource for keystone and cinder
The find_resource method had two hacks in in to support cinder
and keystone and I have removed those in favor of a monkey patch
for cinder.

The find_resource method used to attempt to UUID parse the id, but
it would do a manager.get anyway.  I changed it to skip the UUID
parsing.  This will make things run minorly faster and it supports
LDAP for keystone.

The find_resource used to attempt to use display_name=name_or_id
when finding.  This was a hack for cinder support, but it breaks
keystone because keystone totally messes up with the bogus filter
and keystone refuses to fix it.

Change-Id: I66e45a6341f704900f1d5321a0e70eac3d051665
Closes-Bug: #1306699
2014-06-17 10:24:26 -06:00
Steve Martinelli
01db6d977f move read_blob_file_contents to utils
Thinking ahead, a few other upcoming keystone features could
benefit from reading contents from a file. Thus, moving the
function from policy to utils.

Change-Id: I713ab0e5a00c949ad996daf83b775a7c19044888
2014-04-14 22:16:59 -05:00
Terry Howe
4900c64d09 Produce a useful error message for NoUniqueMatch
Most of the CLIs use a NoUniqueMatch, so produce a useful
error message if that happens.  Added some tests for
find_resource as well.

Change-Id: I85ba61d5f6d1be5bd336a1cc4b02501492905f33
Closes-Bug: #1293846
2014-03-17 17:32:41 -06:00
Terry Howe
033f27fe4d Add ability to prompt for passwords for user create and set
* Add get_password method to the utilities
* Add --password-prompt option
* Call the get_password method if a prompt is requested
* Various tests

Change-Id: I1786ad531e2a2fbcc21b8bc86aac0ccd7985995a
Closes-Bug: 1100116
2014-02-21 14:42:22 -07:00
Florent Flament
a5e087e7a9 Displaying curl commands for nova and cinder calls
When using the -v option, displays curl equivalent commands and http
messages exchanged with the nova and cinder API servers. Displays the
same messages as those displayed with the --debug option of
python-novaclient and python-cinderclient.

Implements: blueprint curl-commands-in-debugging-messages for nova and
cinder related calls

Change-Id: Ibc8ef79d874334585b81d652b9c7df9e874fffa9
2014-01-02 11:08:53 +01:00
Dean Troyer
17f13f7bf4 Create a new base REST API interface
* restapi module provides basic REST API support
  * uses dicts rather than Resource classes
  * JSON serialization/deserialization
  * log requests in 'curl' format
  * basic API boilerplate for create/delete/list/set/show verbs
* ignore H302 due to urllib import

Change-Id: I3cb91e44e631ee19e9f5dea19b6bac5d599d19ce
2013-08-23 12:08:32 -05:00
Jenkins
f293027815 Merge "Remove tenant round 3 - other commands" 2013-07-31 22:30:12 +00:00
Dean Troyer
7d138b94ec Remove tenant round 3 - other commands
Mostly options and help strings:
* image, server, project usage, volume

Change-Id: I788b0660f8c2daacde53c20a72dd1afc60cf5159
2013-07-31 10:12:20 -05:00
Dean Troyer
c94e262df8 Add security group commands
* Add security group: create, delete, list, set, show
* Add server: add secgroup, remove secgroup
* Add security group rule: create, delete, list
* Add Oslo's strutils and gettextutils

* Adds parseractions.RangeAction() to handle option arguments of either a single number
  or a range of numbers: '--port 25'  or '--port 1024:65535'

Blueprint: nova-client

Change-Id: Iad2de1b273ba29197709fc4c6a1036b4ae99725f
2013-07-29 19:07:22 -05:00
Dean Troyer
65d2a14e3e Add server resize command
* add server resize
* update --wait handling for server create, reboot, rebuild
* move _wait_for_status to utils

Blueprint: nova-client

Rebased after https://review.openstack.org/38162 was committed

Change-Id: I7a43b996feecadc7628fcfe20cd5b17333762739
2013-07-29 18:57:02 -05:00
Dean Troyer
818c948752 Clean up properties (metadata) formatting
* Reformat default dict output to key='value' using utils.format_dict()
* Changes utils.get_item_properties() to pass the specific field to
  the formatter function rather than the entire resource object, this
  allows the formatter to handle multiple attributes.
* Updates server, volume, volume type commands

Change-Id: I90eebf6b84ae200532f09cd925f371598ea54a64
2013-07-21 13:59:11 -05:00
Steve Martinelli
f29a849ffc Finish up v3 role commands
* Add remove role
* Add --role to group list
* Add --role to user list
* Fix groups in AddRole()
* Remove the tweaks to utils.find_resource for domains; will address
  that across domains, projects, users and groups in another patch.
  I want to nail down the structure of these commands and get that into place

Change-Id: I8673dd8221ef88978dada5a2833c187026bdb31a
2013-07-03 11:51:23 -05:00
Monty Taylor
016a0b301e Fix flake8 errors in anticipation of flake8 patch.
Change-Id: Ifdc4322b699f2bd91a6900e55695acd3d736568e
2013-05-14 08:28:48 -07:00
Dean Troyer
e9021c213b Add fixed-ip and floating-ip commands
Adds:
* fixed-ip commands: add, remove
* floating-ip commands: add, create, delete, list, remove
* floating-ip-poo command: list

Also uses NAME_ATTR in the Resource class if present to determine
the attribute to be used for searching in utils.find_resource()

Change-Id: Ifd8fa60f880fc4050dea182ac24553cc2c4bff15
2013-04-14 20:26:42 -05:00
Steve Martinelli
0c4929373e Add snapshot support for v1 volume
rebase again, and change util to look for display_name too
minor changes and rebase
add create/delete/list/set/show support for snapshot

Change-Id: I80261653fa919555a44ddda07b0a827ccd16e5e0
2013-03-08 15:03:07 -06:00
Josh Kearney
b26cb5bf68 Upgraded to PEP8 1.3.3 to stay aligned with Nova, etc.
Made all the necessary changes to pass new PEP8 standards.

Also cleaned up docstrings to conform to the HACKING stanards.

Change-Id: Ib8df3030da7a7885655689ab5da0717748c9edbe
2013-01-31 13:31:41 -06:00
Josh Kearney
0a4912f9fb Standardize on a copyright header and ensure all files have them.
Change-Id: I64812bca01ca655c9cf9239a0daea84907082a29
2013-01-24 12:02:23 -06:00
Josh Kearney
c1ea298904 Clean up test environment and remove unused imports.
First round of adding more complete unit test coverage.

Change-Id: Ic1979c499ca6fcb784892a95954a3527539c4e53
2013-01-22 11:44:18 -06:00
Josh Kearney
eb1ae2e9f2 Adds Glance API v2 support.
Change-Id: Ib0325e62a7e50aa94e852a73f9a2cb95daa8d5f6
2013-01-16 11:29:34 -06:00
Dean Troyer
0c4e131c6e Add endpoint CRUD commands
* add {create|delete|list|show} endpoint commands

Change-Id: Ife9fa789d5818d63288b09687b43d802b1b97858
2012-05-18 10:35:20 -05:00
Dean Troyer
d6a4fb836f Update service commands
* add {create|delete} service
* allow 'service' arg to also search type attribute in show command

Change-Id: I992359dc95fab1fbdab0666d5cbb75e44ba6e0f3
2012-05-15 15:48:11 -05:00
Dean Troyer
fa4a4a37d6 Move get_client_class() to common.utils
* add constants for API_NAME

Change-Id: I8ccf72f032227e0a452d96303181549b1b11a5d1
2012-05-11 13:49:45 -05:00
Dean Troyer
5378322906 Add tenant CRUD commands
* add {create|delete|set} tenant commands

* move get_XXXX_properties() to common.utils.get_item_properties()
  add mixed_case_fields as an optional arg

Change-Id: I7b3bd9cefb08e39730886b31213cbe422b5a8453
2012-05-11 12:08:05 -05:00
Dean Troyer
712a8c7f9c Add API versioning support
* Specific versions supported are managed in XXXXXX.client.py with a
  mapping from version to client class.  This is based on the scheme
  that is included in novaclient; none of the other client libs have
  that capability.

Change-Id: I930b197f1189e7f52c3b0096e73e0773cf925542
2012-05-10 15:52:15 -05:00
Dean Troyer
a7da2b8008 Remove printt
Remove unused common.utils functions
prettyprint 0.6 removed printt at the last minute, our references
to it turned out to be in unused code; remove it.

Change-Id: I38a4d9a169beaecfd53eafc5b10f06201bac0c31
2012-05-07 14:05:22 -05:00
Dean Troyer
06f82305b5 Set up common utils 2012-04-25 16:10:05 -05:00
Dean Troyer
11d3ba4570 Add openstackclient bits 2012-04-19 22:41:44 -05:00