anna client
setup
$ pip install anna-client
usage
initialization
from anna_client.client import Client
client = Client(endpoint='http://localhost:5000/graphql')
get jobs
jobs = client.get_jobs()
jobs = client.get_jobs(where={'id_in', [...]}, fields=('driver','site','status'))
create jobs
jobs = client.create_jobs(data=[{'driver': 'firefox', 'site': 'test'}])
delete jobs
client.delete_jobs(where={})
client.delete_jobs(where={'id_in': my_jobs})
update jobs
client.update_jobs(data={'status': 'STOPPED'})
client.delete_jobs(where={'id_in': my_jobs}, data={'status': 'STOPPED'})
reserve jobs
client.reserve_jobs(worker='worker', job_ids=my_jobs)
get tasks
url, tasks = client.get_tasks(namespace='test')