anna API client
Project description
anna client
setup
$ pip install anna-client
usage
initialization
from anna_client.client import Client
client = Client(endpoint='http://localhost:5000/graphql')
get jobs
# get all job ids
jobs = client.get_jobs()
# you can specify a where clause & the fields you wish to receive
jobs = client.get_jobs(where={'id_in', [...]}, fields=('driver','site','status'))
create jobs
# create_jobs takes a list of dicts describing your jobs
jobs = client.create_jobs(data=[{'driver': 'firefox', 'site': 'test'}])
delete jobs
# provide no parameters in order to delete all jobs
client.delete_jobs(where={})
# or delete specific jobs
client.delete_jobs(where={'id_in': my_jobs})
update jobs
# provide no where parameter in order to update all jobs
client.update_jobs(data={'status': 'STOPPED'})
# or update specific jobs
client.delete_jobs(where={'id_in': my_jobs}, data={'status': 'STOPPED'})
reserve jobs
# reserve_jobs takes a worker and a tuple of job ids
client.reserve_jobs(worker='worker', job_ids=my_jobs)
get tasks
# get_tasks takes a namespace & returns a url and a list of tuples containing the task names & definitions
url, tasks = client.get_tasks(namespace='test')
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
anna-client-1.1.9.tar.gz
(3.2 kB
view details)
Built Distribution
File details
Details for the file anna-client-1.1.9.tar.gz
.
File metadata
- Download URL: anna-client-1.1.9.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0be24fb4e797ce778d573d482c3180cfa03402048099c843b369dbd314f9aea |
|
MD5 | d83dbf9c1e1568429fe557d1163fe336 |
|
BLAKE2b-256 | 1d2bbecb8ca6b3311d8c319ff51be324cbd6bf22f89a787aed5bd0633d0f4f6d |
File details
Details for the file anna_client-1.1.9-py3-none-any.whl
.
File metadata
- Download URL: anna_client-1.1.9-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6e349d137ed06e5ad42fb7f506208c67f627e6e578f6c7b83d90cc398363a7b |
|
MD5 | 476113171e5377e90ea875c3a9f2df45 |
|
BLAKE2b-256 | 9f93b6a4dc4d06fe25cd0af50cad8aa1e689eb91c077e053fd46a0872be8f1d4 |