Example #1
0
def sleep(secs, name, job_id, parent_id, result, status='SUCCESS'):
    time.sleep(secs)
    client = Client('/usr/local/pkg/hub/etc/hub.conf')
    taskdata = {
        'status': status,
        'name': name,
        'data': result,
        'id': job_id,
        'parent_id': parent_id
    }
    client.update(parent_id, taskdata=taskdata)
    return True
Example #2
0
File: putjob.py Project: sysbot/hub
#!/usr/bin/env python
import sys
import hub.lib.config as config
from hub.lib.client import Client

if __name__ == '__main__':
    with open(sys.argv[1]) as f:
        job = f.read()
        client = Client('localhost')
        response = client.create(job)
        print 'Successfully submitted job with job id: %s' % response
        print 'And body:'
        print job
Example #3
0
#!/usr/bin/env python
import sys
import hub.lib.config as config

config_file = '/usr/local/pkg/hub/etc/hub.conf'

from hub.lib.client import Client

if __name__ == '__main__':
    task_id = sys.argv[1]
    taskdata = {'status': 'SUCCESS', 'data': 4, 'id': task_id}
    client = Client(config_file)
    client.update(taskdata=taskdata)
    print 'Successfully submitted task results %s for task with id: %s' % (
        taskdata, task_id)
Example #4
0
#!/usr/bin/env python
import sys
import hub.lib.config as config

config_file = '/usr/local/pkg/hub/etc/hub.conf'

from hub.lib.client import Client

if __name__ == '__main__':
    task_id = sys.argv[1]
    taskdata = {'status': 'SUCCESS', 'data': 4, 'id': task_id }
    client = Client(config_file)
    client.update(taskdata=taskdata)
    print 'Successfully submitted task results %s for task with id: %s' % (taskdata, task_id)
Example #5
0
def get_job(job_id):
    client = Client('/usr/local/pkg/hub/etc/hub.conf')
    response = client.get(job_id)
    return response
Example #6
0
def update_job(job_id, result='DONE', status='SUCCESS'):
    client = Client('/usr/local/pkg/hub/etc/hub.conf')
    taskdata = {'status': status, 'data': result, 'id': job_id}
    client.update(taskdata=taskdata)
    return True
Example #7
0
def sleep(secs, name, job_id, parent_id, result, status='SUCCESS'):
    time.sleep(secs)
    client = Client('/usr/local/pkg/hub/etc/hub.conf')
    taskdata = {'status': status, 'name': name, 'data': result, 'id': job_id, 'parent_id': parent_id }
    client.update(parent_id, taskdata=taskdata)
    return True
Example #8
0
File: getjob.py Project: sysbot/hub
#!/usr/bin/env python
import sys
import hub.lib.config as config

config_file = '/usr/local/pkg/hub/etc/hub.conf'

from hub.lib.client import Client

if __name__ == '__main__':
    jobid = sys.argv[1]
    client = Client(config_file)
    response = client.get(jobid)
    print response
Example #9
0
def update_job(job_id, result='DONE', status='SUCCESS'):
    client = Client('/usr/local/pkg/hub/etc/hub.conf')
    taskdata = {'status': status, 'data': result, 'id': job_id}
    client.update(taskdata=taskdata)
    return True
Example #10
0
def get_job(job_id):
    client = Client('/usr/local/pkg/hub/etc/hub.conf')
    response = client.get(job_id)
    return response