Client library for surveil API.
Go to file
OpenDev Sysadmins c479625dc2 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:50:25 +00:00
doc Added basic lib 2014-12-16 17:29:26 -05:00
surveilclient Change httplib to requests 2015-08-09 13:09:26 -04:00
tools Added bash completion script 2014-12-22 10:34:45 -05:00
.gitignore Add get and show for config.hosts 2015-05-08 11:29:01 -04:00
.gitreview OpenDev Migration Patch 2019-04-19 19:50:25 +00:00
.testr.conf Added CLI interface 2014-12-21 15:39:04 -05:00
README.rst New default port: 5311 2015-07-03 14:12:43 -04:00
requirements.txt Added TestDowntime 2015-05-05 09:46:39 -04:00
setup.cfg Added bash completion 2014-12-22 10:24:03 -05:00
setup.py Added basic lib 2014-12-16 17:29:26 -05:00
test-requirements.txt Change httplib to requests 2015-08-09 13:09:26 -04:00
tox.ini httpretty can fail in Python 3.4 with wrong LC_ALL 2015-05-14 22:12:47 -04:00

Python bindings to the Surveil API

This is a client library for Surveil built on the Surveil API.

Command-line API

Installing this package gets you a shell command, surveil, that you can use to interact with the Surveil API.

You'll need to provide the Surveil API URL. You can do this with the --surveil-api-url parameter, but it's easier to just set it as environment variable:

export SURVEIL_API_URL=http://localhost:5311/v2
export SURVEIL_AUTH_URL=http://localhost:5311/v2/auth

You'll find complete documentation on the shell by running surveil help.

Bash completion

Basic command tab completion can be enabled by sourcing the bash completion script:

source /usr/local/share/surveil.bash_completion

Python API

To use the python API, simply create a client with the endpoint:

from surveilclient import client
c = client.Client('http://localhost:5311/v2',
                  auth_url='http://localhost:5311/v2/auth',
                  version='2_0')
hosts = c.config.hosts.list()

How to use it

Config-host-update:

surveil config-host-update --host_name [host_name] --address [ADDRESS] --custom_fields '{"_field1": "value1", "_field2": "value2"}'