def create_jobs(configFile, sessionid, jobsList): """ jobsList is a list of jobs, usually provided from a JSON file """ #assert (type(jobsList), list) return post_page(configFile, SECTION, json.dumps(jobsList), subresource=sessionid)
def post_session_results(configFile, sessionid): """ Request next page number with finished jobs """ return post_page( configFile, SECTION, b'', subresource='%s/result/00000000-0000-0000-0000-000000000000' % sessionid)
def create_jobs(configFile, sessionid, jobsList): """ jobsList is a list of jobs, usually provided from a JSON file """ #assert (type(jobsList), list) content = bytes(json.dumps(jobsList), encoding='UTF-8') return post_page(configFile, SECTION, content, headers={'Content-Type': HEADER_CONTENT_TYPE_JSON}, subresource=sessionid)
def create_session(configFile): """ returns a GUID, must remove quotes """ contents = post_page(configFile, SECTION, b'') _log.getLogger(__name__).debug("SESSION: %s", contents) return contents.strip('"')
def start_jobs(configFile, sessionid): return post_page(configFile, SECTION, b'', headers={'Content-Type': HEADER_CONTENT_TYPE_JSON}, subresource='%s/start' % sessionid)
def kill_jobs(configFile, sessionid): return post_page(configFile, SECTION, b'', subresource='%s/kill' % sessionid)
def stop_jobs(configFile, sessionid): return post_page(configFile, SECTION, b'', subresource='%s/stop' % sessionid)
def create_session(configFile): return post_page(configFile, SECTION, "").strip("\"") #Strip the quotes off the sessionid
def start_jobs(configFile, sessionid): return post_page(configFile, SECTION, "", subresource='%s/start' % sessionid)