def prog_by_jobid(schema, jobid): if type(jobid) != list: job_list = [jobid] else: job_list = jobid return prog_by_data_id_subquery(schema, data_ids_by_jobid_subquery(schema, commaList(job_list)))
def debug(self): if self.discontiguous: flag = "*D*" else: flag = " " sys.stderr.write( " %s %s -> %s @ %s (users: %s) (by: %s)\n" % ( flag, self.start, self.end, helpers.commaList(self.partitions, ":"), helpers.commaList(self.user_list, ":"), self.exec_user, ) )
def prog_by_jobid(schema, jobid): if type(jobid) != list: job_list = [jobid] else: job_list = jobid return prog_by_data_id_subquery( schema, data_ids_by_jobid_subquery(schema, commaList(job_list)))
def res_ids_by_event_list(schema, event_list): # single numeric event id or list of ids return (""" select t1.RESID from (%s) as t1 where t1.EVENT_TYPE in (%s) """) % (last_state_all_reservations(schema), commaList(event_list))
def prog_by_data_field(schema, field, values): # single numeric resid or list of resids return(""" select p.*, d.RESID from %s.RESERVATION_PROG as p, ( select ID, RESID from %s.RESERVATION_DATA where %s in (%s) ) as d where p.RES_DATA_ID = d.ID order by p.ENTRY_TIME """) % (schema, schema, field, commaList(values))