186 Commits

Author SHA1 Message Date
Steve Martinelli
a8d4b0eebb Remove 'links' section from several v3 Identity objects
The links field in the returned objects from the v3 Identity
API aren't really useful, so let's remove them.
Managed to remove most of them from the core API.
I'll likely remove the extension/contribution (oauth/federation)
related ones in another patch.

Also in this patch the code for setting services and projects
was changed. Though not incorrect, it was not needed to copy
the entire returned object, we should just need to pass in
the fields we want to update.

Change-Id: I164ca9ad8b28fa10b291e9115ef40753e387c547
2014-10-11 22:35:12 -04:00
Steve Martinelli
1b3c7ec122 Fix issue token for v3
Currently the code is broken as it references a part of
keystoneclient that does not exist.

Change-Id: I7fbc754537fbb4acffb166b5854840acfaef1fb8
Closes-Bug: #1379871
2014-10-11 20:34:09 -04:00
Matthieu Huin
0c77a9fe8b Support for keystone auth plugins
This patch allows the user to choose which authentication plugin
to use with the CLI. The arguments needed by the auth plugins are
automatically added to the argument parser. Some examples with
the currently available authentication plugins::

  OS_USERNAME=admin OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v2.0 \
  OS_PASSWORD=admin openstack user list

  OS_USERNAME=admin OS_PROJECT_DOMAIN_NAME=default OS_USER_DOMAIN_NAME=default \
  OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v3 OS_PASSWORD=admin \
  OS_IDENTITY_API_VERSION=3 OS_AUTH_PLUGIN=v3password openstack project list

  OS_TOKEN=1234 OS_URL=http://service_url:35357/v2.0 \
  OS_IDENTITY_API_VERSION=2.0 openstack user list

The --os-auth-plugin option can be omitted; if so the CLI will attempt to
guess which plugin to use from the other options.

Change-Id: I330c20ddb8d96b3a4287c68b57c36c4a0f869669
Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
2014-10-09 12:34:47 +02:00
Jenkins
866965f011 Merge "Update for cliff commandmanager >=1.6.1" 2014-10-09 04:43:01 +00:00
Jenkins
8554fd24fe Merge "CRUD operations for federated protocols" 2014-10-09 03:59:33 +00:00
Jenkins
d87868720e Merge "Pass in domain and project as positional args, not kwargs" 2014-10-09 03:23:03 +00:00
Dean Troyer
d32185cb34 Add 'command list' command
* Add method to CommandManager to retrieve command names by group
* Add ListCommands

To list command groups loaded by cliff

Change-Id: I37fe2471aa2fafa8aa223159452d52b1981021d6
2014-10-08 21:57:26 -05:00
Marek Denis
14c61a0ace CRUD operations for federated protocols
Openstackclient needs to have a capability to manage federated protocols
(like saml2, openid connect, abfab). This patch allows users to
administrate such operations from the commandline.

Change-Id: I59eef2acdda60c7ec795d1bfe31e8e960b4478a1
Implements: bp/add-openstackclient-federation-crud
2014-10-08 21:12:38 -04:00
Dean Troyer
5b6c24fdb0 Update for cliff commandmanager >=1.6.1
Cliff 1.6.1 added  CommandManager.load_commands() so we can adopt it
rather than rolling our own.

Also, that second group is Greek, not Latin.  Jeez...

Change-Id: I4a63c22f37bcfd0ef5d83c2dbd08b58fda0db35c
2014-10-08 18:05:43 -05:00
Jenkins
35b0bbd762 Merge "Implement CRUD operations for Mapping objects" 2014-10-08 22:17:56 +00:00
Marek Denis
30b0a41ce7 Implement CRUD operations for Mapping objects
Change-Id: I4b8f2e77e741cf74f50aba98ab975af7321b02c6
Implements: bp/add-openstackclient-federation-crud
2014-10-08 18:35:11 +02:00
Steve Martinelli
d972b8364c Pass in domain and project as positional args, not kwargs
The signature for users.set in keystoneclient dictates that
domain and project be sent in, not domainId and projectId,
which are being incorrectly sent in as 'extra' data.

Closes-Bug: #1376833

Change-Id: I44df3e492f61eab2241f3758dee622417bb6f399
2014-10-02 14:32:12 -04:00
Dean Troyer
31018bf7c2 Move object-store commands to low-level API
api.object_store.APIv1 now contains the formerly top-level functions
implementing the object-store REST client. This replaces the old-style
ObjectClientv1 that is no longer necessary.

Change-Id: I7d8fea326b214481e7d6b24119bd41777c6aa968
2014-10-01 13:50:13 -04:00
Dean Troyer
e3b9b96588 Add low-level API base class
Adds the foundation of a low-level REST API client.  This is the final prep
stage in the conversion of the object-store commands from the old restapi
interface to the keystoneclient.session-based API.

* api.api.BaseAPI holds the common operations

Change-Id: I8fba980e3eb2d787344f766507a9d0dae49dcadf
2014-09-29 12:32:45 -05:00
Dean Troyer
207c8cf3ef Test top-to-bottom: object-store containers
Replicate the object-store container command tests but use requests_mock
to test the entire stack down to the requests module.

These will be useful regressions tests when the existing object-store lib
modules are moved to the low-level API object.

Change-Id: Ibf25be46156eb1009f1b66f02f2073d3913b846d
2014-09-29 00:02:32 -05:00
Jenkins
0ee7073170 Merge "Add service catalog commands" 2014-09-19 02:42:55 +00:00
Dean Troyer
da45b34828 Add service catalog commands
'catalog list' and 'catalog show' for Identity v2

Identity v2 only so far.

Change-Id: I9df0dac3d5bb7c18f38a81bd7d29f8119462d3a5
2014-09-18 15:42:10 -05:00
Jenkins
df69d3264f Merge "Add network extension list" 2014-09-18 09:41:51 +00:00
Jenkins
d9a6f7fd3a Merge "Use Keystone client session.Session" 2014-09-17 07:25:28 +00:00
Jenkins
6977ef8aec Merge "Network use enable/disable vs admin state up/down" 2014-09-08 17:29:37 +00:00
Dean Troyer
ae957b176e Use Keystone client session.Session
This replaces the restapi requests wrapper with the one from Keystone client so
we can take advantage of the auth plugins.

As a first step only the v2 and v3 token and password plugins are supported.
This maintainis no changes to the command options or environment variables.

The next steps will include reworking the other API client interfaces to
fully utilize the single auth session.

Blueprint: ksc-session-auth
Change-Id: I47ec63291e4c3cf36c8061299a4764f60b36ab89
2014-09-08 00:06:52 -05:00
Jenkins
3317e0abf6 Merge "Add action 'user password set' for identiy v3" 2014-09-07 15:12:18 +00:00
Jenkins
dcf658cc4e Merge "Unordered dicts and lists causes variable results" 2014-09-07 12:59:35 +00:00
Mouad Benchchaoui
0069adef5c Add action 'user password set' for identiy v3
This new action will allow a user to change their own password by
either providing the new password as an argument (--password) or by
being prompted to enter the new password.
In both cases user will be prompted to enter their current password
as required by the v3 API.

Closes-Bug: #1337245
Change-Id: I5e1e0fd2b46a4502318da57f7cce2b236fb2d93d
2014-09-07 02:37:54 -04:00
Jenkins
d3502b62d6 Merge "assertEquals order wrong" 2014-09-07 05:14:07 +00:00
Terry Howe
514ecc6e96 Unordered dicts and lists causes variable results
The unordered dict and lists causes variable results.  The user
may see different results and tests can fail.  Might as well make
this more consistent.

Change-Id: I7045b40b44cbf3ee0f2ca79c6ea0d279b6d8cfe3
2014-09-06 23:55:31 -04:00
Jenkins
dc9ce6d608 Merge "Change app.restapi to app.client_manager.session" 2014-09-06 21:46:40 +00:00
Jenkins
b7816f3997 Merge "add service/interface/region filter for endpoint v3" 2014-09-06 17:02:45 +00:00
Terry Howe
dc68d3f5cf assertEquals order wrong
Change-Id: I822b6ac5b8e8c3009d1ee2d647376eff84559c11
Partial-Bug: #1277104
2014-09-04 14:47:28 +00:00
Dean Troyer
4bbd03210f Change app.restapi to app.client_manager.session
This is step 1 toward using Keystone client's session.Session as the
primary session/requests interface in OSC.

* Move the session create into ClientManager and rename 'restapi' attribute to 'session'
* Set up ClientManager and session loggers
* Fix container and object command references to restapi/api

Change-Id: I013d81520b336c7a6422cd22c05d1d65655e64f8
2014-08-25 13:38:03 -05:00
Jenkins
7a8c9a7a8a Merge "add tests for identity v3 endpoint" 2014-08-23 16:42:08 +00:00
Jenkins
fc44578f0a Merge "add tests for identity v3 domain" 2014-08-22 10:57:36 +00:00
Terry Howe
cecf1a7737 Network use enable/disable vs admin state up/down
Use --enable and --disable vs --admin-state-up/--admin-state-down

Change-Id: I90040b925cb537a8ba13d1dd609c51bb669cf149
2014-08-18 05:41:58 -06:00
wanghong
181f16da8a add service/interface/region filter for endpoint v3
Change-Id: I7eac5b2ff5f5a6f3f08b22dd3a48a5ae7e2c056b
Closes-Bug: #1281888
2014-08-18 16:41:15 +08:00
wanghong
99ad9ef92e add tests for identity v3 endpoint
Change-Id: I1479460473656ea4e2a48a976808371e840b49c1
Closes-Bug: #1348867
2014-08-14 20:17:54 +08:00
wanghong
2dc060cff3 add tests for identity v3 domain
Change-Id: I478215f62b51e6e73283f0304ea1b0736177d1b1
2014-08-14 20:11:00 +08:00
wanghong
19b8605224 a mistake in tests/identity/v3/test_role.py
Change test_service_show to test_role_show.

Change-Id: Ieef7fdeb9401b4dc28720c9ba14bf460ac171288
2014-08-12 19:36:57 +08:00
wanghong
ddb7e18974 test_find_resource fails if run alone
Currently, we set 'NAME_ATTR' attribute for Volume and Snapshot
class in volume.client.py. When we test test_find_resource alone,
the Volume and Snapshot class do not have 'NAME_ATTR' attribute since
we do not import volume.client, which causes the tests to fail.

Change-Id: I06f727ffa8d37afe1a1191c36574887fecc7a733
Closes-Bug: #1353788
2014-08-07 13:22:25 -04:00
Jenkins
7b70143695 Merge "Add more columns to image list output" 2014-07-26 22:20:19 +00:00
Terry Howe
25e0d2ab27 Add network extension list
Network extension list support

Change-Id: I013f68ef2c3329c8db59e2441dd8d4ffafd4470e
Closes-Bug: #1337685
2014-07-26 15:57:48 -06:00
Steve Martinelli
6e1fa8b27d Change V2 image tests to actually run V2 image code
The current tests for image do not run v2 image code, changing
that portion also made it's only test fail.
I opted to change the image delete code and not the test, since
passing the object ID is more in line with the rest of the
project code.

Change-Id: I62e13c063a5d68279dbbf31e59266db6285d73bf
2014-07-25 01:16:01 -04:00
Steve Martinelli
e1c32b8224 Add more columns to image list output
Add disk_format, container_format, size and status to image list
command. Added tests as well.

Change-Id: I8e3822c6d46d0020fc706955c026549f6c635587
Closes-Bug: #1348475
2014-07-25 01:09:59 -04:00
Jamie Lennox
5e7e94d59e Fix IDP commands
identity_client.identity_providers doesn't exist as a manager. These are
located at identity_client.federation.identity_providers. Fix the
routes.

Also fix passing id to .create() as a positional argument. This is not
allowed from keystoneclient it should be passed as a keyword argument.

Change-Id: I912c27fcee58b0723e27e9147def2cbd1c62c288
2014-07-21 10:04:47 +10:00
Jenkins
5830007bbc Merge "Fix server resize" 2014-07-12 20:58:37 +00:00
Jenkins
bc6495c6a1 Merge "Add basic timing support" 2014-07-11 18:22:06 +00:00
Jenkins
70283744a0 Merge "Domain administrator cannot do project operations" 2014-07-09 08:18:23 +00:00
Jenkins
e7bfabc886 Merge "Allow network find to use alternate name" 2014-07-08 17:42:11 +00:00
Jenkins
ba15646cf8 Merge "Catch SystemExit for parse args" 2014-07-08 17:37:21 +00:00
Dean Troyer
ea2ac77a46 Fix server resize
So apparently we've never resized a server???

Fixed command args and add some tests.

Change-Id: I6c3f6fec22390e9d269b7117a42a190d2b4b80ba
2014-07-08 11:20:13 -05:00
Dean Troyer
4844a25779 Add basic timing support
Add support for --timing options.  Use cliff via a pseudo-command
'Timing' to support multiple outputformats.

If an output format other than the default 'table' is selected
use CSV since the timing data is in list form.

Will pick up timing data for any client object that has a method
similar to novaclient's get_timings().

TODO:
* Stop instantiating all of the clientmanager client objects just
  to check for timing data.  Descriptor magic required?

Change-Id: I7f1076b7a250fba6a8b24b2ae9353a7f51b792b2
2014-07-08 02:04:00 -05:00