#NEWLINE# def get_jobs( deployment_name , token_manager = None , app_url = defaults . APP_URL ) : #NEWLINE# #INDENT# '\n    return list of currently running jobs\n\n    ' #NEWLINE# headers = token_manager . get_access_token_headers ( ) #NEWLINE# data_urls = get_data_urls ( deployment_name , app_url = app_url , token_manager = token_manager ) #NEWLINE# jobs = [ ] #NEWLINE# for data_url in data_urls : #NEWLINE# #INDENT# url = ( '%s/api/v1/jobs' % data_url ) #NEWLINE# response = requests . get ( url , headers = headers ) #NEWLINE# if ( response . status_code == 200 ) : #NEWLINE# #INDENT# these_jobs = response . json ( ) [ 'jobs' ] #NEWLINE# for job in these_jobs : #NEWLINE# #INDENT# job [ 'data_url' ] = data_url #NEWLINE# #UNINDENT# jobs += these_jobs #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise JutException ( ( 'Error %s: %s' % ( jobs . status_code , response . text ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return jobs