#NEWLINE# def create_job( self , job ) : #NEWLINE# #INDENT# if ( not job . from_config_values ) : #NEWLINE# #INDENT# job . from_config_values = self . get_connectors ( ) [ 0 ] . job_config [ 'FROM' ] #NEWLINE# #UNINDENT# if ( not job . to_config_values ) : #NEWLINE# #INDENT# job . to_config_values = self . get_connectors ( ) [ 0 ] . job_config [ 'TO' ] #NEWLINE# #UNINDENT# if ( not job . driver_config_values ) : #NEWLINE# #INDENT# job . driver_config_values = self . get_driver ( ) . job_config #NEWLINE# #UNINDENT# job . creation_date = int ( round ( ( time . time ( ) * 1000 ) ) ) #NEWLINE# job . update_date = job . creation_date #NEWLINE# job_dict = job . to_dict ( ) #NEWLINE# request_dict = { #NEWLINE# #INDENT# 'job' : job_dict , #NEWLINE# #UNINDENT# } #NEWLINE# resp = self . _root . post ( ( '%s/job/' % API_VERSION ) , data = json . dumps ( request_dict ) , headers = job_dict . headers ) #NEWLINE# if ( 'id' not in resp ) : #NEWLINE# #INDENT# raise SqoopException . from_dicts ( resp [ 'validation-result' ] ) #NEWLINE# #UNINDENT# job . id = resp [ 'id' ] #NEWLINE# return job