def new_job(<EOL>self,<EOL>task,<EOL>person,<EOL>tank,<EOL>target_host,<EOL>target_port,<EOL>loadscheme=None,<EOL>detailed_time=None,<EOL>notify_list=None,<EOL>trace=False):
if not notify_list:<EOL><INDENT>notify_list = []<EOL><DEDENT>data = {<EOL>'<STR_LIT>': task,<EOL>'<STR_LIT>': person,<EOL>'<STR_LIT>': tank,<EOL>'<STR_LIT:host>': target_host,<EOL>'<STR_LIT:port>': target_port,<EOL>'<STR_LIT>': loadscheme,<EOL>'<STR_LIT>': detailed_time,<EOL>'<STR_LIT>': notify_list<EOL>}<EOL>logger.debug("<STR_LIT>", data)<EOL>api_timeouts = self.api_timeouts()<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>response = self.__post(<EOL>"<STR_LIT>", data, trace=trace)[<NUM_LIT:0>]<EOL>return response['<STR_LIT>'], response['<STR_LIT>']<EOL><DEDENT>except (self.NotAvailable, self.StoppedFromOnline) as e:<EOL><INDENT>try:<EOL><INDENT>timeout = next(api_timeouts)<EOL>logger.warn("<STR_LIT>" % timeout)<EOL>time.sleep(timeout)<EOL>continue<EOL><DEDENT>except StopIteration:<EOL><INDENT>logger.warn('<STR_LIT>')<EOL>raise self.JobNotCreated(e.message)<EOL><DEDENT><DEDENT>except requests.HTTPError as e:<EOL><INDENT>raise self.JobNotCreated('<STR_LIT>'.format(e.response.content))<EOL><DEDENT>except Exception as e:<EOL><INDENT>logger.warn('<STR_LIT>')<EOL>logger.warn(repr(e), )<EOL>raise self.JobNotCreated()<EOL><DEDENT><DEDENT>
:return: job_nr, upload_token
:rtype: tuple