Objective:
- Reduce the lines of code to maintain.
- Auto discover all services and service endpoints available to tenant.
- Instantiate clients with their respective credential signatures as they vary from client to client.
- Easily add new clients for new services as they become available. (ex. Oslo, Heat, etc.)
I've provided two public methods (ConnectorExample.flavors() and
ConnectorExample.images()) that provide a decent chunk of cloud data with
minimal coding.
From OSConn directory:
virtualenv venv
source venv/bin/activate
pip install -r requirementsOpen osconn and change AUTH_URL, AUTH_USER, AUTH_PASS, AUTH_TENANT to point to your cloud and tenant.
python osconn.py
See code:
OpenStackConnector.\_auth\_kwargs
OpenStackConnector.\_token\_kwargs
OpenStackConnector.\_type\_kwargsThe OpenStack clients vary in what type of arguments are needed to instantiate them. This is an area that the community could improve upon. Two types of authentication for service clients: "auth": Authentice service through Keystone. "token": Authenticate using token provided by Keystone. **Password keyword argument also varies in auth type clients.
- FIXME(Toby): Setup testing with tox. Write tests.
- FIXME(Toby): Object-store uses a different method for instantiating a client.
- FIXME(Toby): Discover Keystone API version like others. Regex AUTH_URL for /v2.0/?
- FIXME(Toby): Support regions by allowing tenant to specify priority which can translate to how we sort the list of clients. Glance and Heat may be the only two that support this. Clients for other services go through Keystone. Does Keystone select regions internally?
- FIXME(Toby): Try..except.. When a region in the list fails try next region.