OpenStack Indexing and Search API Client Library
Project description
OpenStack Indexing and Search API Client Library
This is a client library for Searchlight built on the Searchlight API. It provides a Python API (the searchlightclient module) and a command-line tool (searchlight).
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-searchlightclient is licensed under the Apache License like the rest of OpenStack.
Command-line API
To execute CLI commands to standalone searchlight set with keystone.
Clone repository for python-searchlightclient:
$ git clone https://github.com/openstack/python-searchlightclient.git $ cd python-searchlightclient
Setup a virtualenv
$ 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
Install Searchlightclient and its dependencies:
(venv) $ python setup.py develop
To execute CLI commands:
$ export OS_USERNAME=<user> $ export OS_PASSWORD=<password> $ export OS_TENANT_NAME=<project> $ export OS_AUTH_URL='http://localhost:5000/v2.0/'
$ openstack (openstack) search resource-type list +--------------------------+--------------------------+ | Name | Type | +--------------------------+--------------------------+ | OS::Designate::RecordSet | OS::Designate::RecordSet | | OS::Designate::Zone | OS::Designate::Zone | | OS::Glance::Image | OS::Glance::Image | | OS::Glance::Metadef | OS::Glance::Metadef | | OS::Nova::Server | OS::Nova::Server | +--------------------------+--------------------------+
Python API
To use with keystone as the authentication system:
>>> from keystoneclient.auth.identity import generic
>>> from keystoneclient import session
>>> from searchlightclient 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)
>>> sc = client.Client('1', session=keystone_session)
>>> sc.resource_types.list()
[...]
License: Apache License, Version 2.0
Documentation: http://docs.openstack.org/developer/python-searchlightclient
Source: http://git.openstack.org/cgit/openstack/python-searchlightclient
Testing
There are multiple test targets that can be run to validate the code.
tox -e pep8 - style guidelines enforcement
tox -e py27 - traditional unit testing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-searchlightclient-0.2.0.tar.gz.
File metadata
- Download URL: python-searchlightclient-0.2.0.tar.gz
- Upload date:
- Size: 46.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a867572090fa069b2e15b28395f127aaf1e878f63a56b6fa2c53810becf832af
|
|
| MD5 |
b5f38582e5405f727f3fac4eb5e28c1e
|
|
| BLAKE2b-256 |
4394bf96d64224e22bd00bb7bfce497468aa4b68f5269f2769b562f743ee53e7
|
File details
Details for the file python_searchlightclient-0.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: python_searchlightclient-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 57.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c8544a3a14c74870c4b54c2979dc63445af85604c7908ea81182e42ed281d81
|
|
| MD5 |
b7aebc5bf15ef18762c283ce32649571
|
|
| BLAKE2b-256 |
f2abd4fcec61133b90f0f7ba9b8c6f32dfbf33ed7ac2f39f2f2d7178b17bf4ed
|