Python client for Picasso API
Go to file
OpenDev Sysadmins d9af311a19 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:51:45 +00:00
doc doc updates 2016-12-14 22:59:33 -07:00
picassoclient Provide new capability to V1 client - expose_url 2016-12-09 23:36:44 +02:00
.gitignore Initial commit - Python LaOS client 2016-12-06 03:46:23 +02:00
.gitreview OpenDev Migration Patch 2019-04-19 19:51:45 +00:00
.testr.conf New project name: Picasso 2016-12-07 22:22:52 +02:00
CONTRIBUTING.rst New project name: Picasso 2016-12-07 22:22:52 +02:00
LICENSE update copyright on apache license 2016-12-14 11:37:10 -07:00
README.md Fixing links in README 2017-01-21 12:21:05 +02:00
babel.cfg Initial commit - Python LaOS client 2016-12-06 03:46:23 +02:00
requirements.txt Initial commit - Python LaOS client 2016-12-06 03:46:23 +02:00
setup.cfg convert rst to md 2016-12-14 23:03:34 -07:00
setup.py Initial commit - Python LaOS client 2016-12-06 03:46:23 +02:00
test-requirements.txt Adding docs, testing 2016-12-06 18:37:33 +02:00
tox.ini New project name: Picasso 2016-12-07 22:22:52 +02:00

README.md

python-picassoclient

OpenStack Functions Client Library

This is a client library for Picasso built on the Picasso API. It provides a Python API (the picassoclient module).

The project is hosted on Launchpad, where bugs can be filed. The code is hosted on GitHub. Patches must be submitted using Gerrit, not Github pull requests.

python-picassoclient is licensed under the Apache License, like the rest of OpenStack.

Install the client from PyPI

The python-picassoclient package is published on PyPI and can be installed via pip.

$ pip install python-picassoclient

Note: The packages on PyPI may lag behind the git repo in functionality.

Setup the client from source

  1. Clone the source repo

     $ git clone https://github.com/openstack/python-picassoclient.git
     $ cd python-picassoclient
    
  2. Setup a Python virtualenv

    Note: This is an optional step, but will allow picassoclient dependencies to be installed in a contained environment that can be easily deleted if you choose to start over or uninstall the client.

     $ tox -evenv --notest
    

    Activate the virtual environment whenever you want to work in it. All further commands in this section should be run with the venv active:

     $ source .tox/venv/bin/activate
    

    When all steps are complete, deactivate the virtualenv by running deactivate from your shell.

  3. Install picassoclient and its dependencies::

     (venv) $ python setup.py develop
    

Picasso CLI

To work with the CLI, set the necessary Keystone environment variables

$ export OS_USERNAME=<user>
$ export OS_PASSWORD=<password>
$ export OS_PROJECT_NAME=<project>
$ export OS_AUTH_URL=http://localhost:5000/v3

If working with DevStack, just run source openrc <user> <project>. You can then work with a local installation by passing --os-token <TOKEN> and --os-url http://localhost:9393. You can also set up a Openstackclient config file to work with the CLI.

$ openstack
(openstack) fn apps list
(openstack) fn apps create testapp

Picasso Python API

Refer to the following code to use Keystone as the authentication backend:

>>> from keystoneclient.auth.identity import generic
>>> from keystoneclient import session
>>> from picassoclient import client
>>> auth = generic.Password(auth_url=OS_AUTH_URL, username=OS_USERNAME, password=OS_PASSWORD, tenant_name=OS_TENANT_NAME)
>>> keystone_session = session.Session(auth=auth)
>>> picasso = client.Client('v1', session=keystone_session)
>>> picasso.apps.list()
[...]

Testing

There are multiple test targets that can be run to validate the code.

tox -e pep8 - style guidelines enforcement
tox -e py34 - traditional unit testing
tox -e py35 - traditional unit testing