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.
|3 years ago|
|doc||5 years ago|
|searchlightclient||5 years ago|
|tools||5 years ago|
|.gitignore||7 years ago|
|.gitreview||3 years ago|
|.testr.conf||7 years ago|
|.zuul.yaml||4 years ago|
|CONTRIBUTING.rst||7 years ago|
|LICENSE||7 years ago|
|README.rst||5 years ago|
|babel.cfg||7 years ago|
|requirements.txt||4 years ago|
|setup.cfg||5 years ago|
|setup.py||5 years ago|
|test-requirements.txt||4 years ago|
|tox.ini||4 years ago|
Team and repository tags
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 (
python-searchlightclient is licensed under the Apache License like the rest of OpenStack.
Install the client from PyPI
$ pip install python-searchlightclient
The packages on PyPI may lag behind the git repo in functionality.
Setup the client from source
Clone repository for python-searchlightclient:
$ git clone https://git.openstack.org/openstack/python-searchlightclient.git $ cd python-searchlightclient
Setup a virtualenv
This is an optional step, but will allow Searchlightclient's dependencies to be installed in a contained environment that can be easily deleted if you choose to start over or uninstall Searchlightclient.
$ 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: $ deactivate
Install Searchlightclient and its dependencies:
(venv) $ python setup.py develop
Set Keystone environment variables to execute CLI commands against searchlight.
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/'
With devstack you just need to $ source openrc <user> <project>. And you can 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) 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 | +--------------------------+--------------------------+
Here are the full list of subcommands, Use -h to see options:
Subcommand Description search facet list List Searchlight Facet search resource type list List Searchlight Resource Type (Plugin) search query Search Searchlight resource
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: https://docs.openstack.org/developer/python-searchlightclient
- Source: https://git.openstack.org/cgit/openstack/python-searchlightclient
- Bugs: https://bugs.launchpad.net/python-searchlightclient
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