Openstack Basic Client library

Registered by Alexej Ababilov

This blueprint has been superseded. See the newer blueprint "OpenStack Common Client Library" for updated plans.

Unfortunately, nova, keystone, and glance clients are very inconsistent. A lot of code is copied between all these clients instead of moving it to a common library. The code was edited without synchronization between clients, so, they have different behaviour:

* all client constructors use different parameters (api_key in nova or password in keystone and so on);
* keystoneclient authenticates immediately in __init__, while novaclient does in lazily during first method call;
* {keystone,nova}client can manage service catalogs and accept keystone's auth URI while glanceclient allows endpoints only;
* keystoneclient can support authorization with an unscoped token but novaclient doesn't;
* novaclient uses class composition while keystoneclient uses inheritance.

That is worth to note that glanceclient still cannot send file chunks and doesn't use sendfile syscall that is more efficient.

There is python-openstackclient, and it will be an awesome tool. But it is a console client, not an API client library.
There is openstack-common, but it seems to be a stub for a server and there is no client code.

The basic library can be used by python-{nova,keystone,glance}client that are used, in their order, by python-openstackclient, horizon, etc.

An implementation of the basic library is accessible at https://github.com/aababilov/python-openstackclient-base.

Here is an example of its usage.

from openstackclient_base.client import HttpClient
http_client = HttpClient(username="...", password="...", tenant_name="...", auth_uri="...")

from openstackclient_base.nova.client import ComputeClient
print ComputeClient(http_client).servers.list()

from openstackclient_base.keystone.client import IdentityPublicClient
print IdentityPublicClient(http_client).tenants.list()

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Russell Bryant

Related branches

Sprints

Whiteboard

I don't think nova is the right place to drive this. It's effectively a new client side library project. I would discuss it openstack-dev to see if you gain support and contributors to the effort and go from there, like other projects start. -- russellb

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.