@@ -32,6 +32,16 @@ def getJobsSites(self, jobIDs):
32
32
def getJobsStatus (self , jobIDs ):
33
33
return self .fetch (["Status" ], jobIDs )
34
34
35
+ @convertToReturnValue
36
+ def getJobParameter (self , jobID , parName ):
37
+ # with DiracXClient() as api:
38
+ # parameters = api.jobs.get_job_parameters(
39
+ # job_id=jobID
40
+ # )
41
+
42
+ # return parameters
43
+ pass
44
+
35
45
@convertToReturnValue
36
46
def getJobParameters (self , jobIDs ):
37
47
# if isinstance(jobIDs, int):
@@ -83,3 +93,73 @@ def cleanLFN(data):
83
93
return_dict [job_id ].append (cleanLFN (data ))
84
94
85
95
return return_dict
96
+
97
+ @convertToReturnValue
98
+ def getJobs (self , attrDict , cutDate = None ):
99
+ # TODO: Check, selectJobs is awful...
100
+ # See if we do it
101
+ pass
102
+
103
+ @convertToReturnValue
104
+ def getJobJDL (self , jobID , original ):
105
+ with DiracXClient () as api :
106
+ jdl = api .jobs .get_job_jdl (job_id = jobID )
107
+
108
+ if not jdl :
109
+ return ""
110
+
111
+ if original :
112
+ return jdl ["OriginalJDL" ]
113
+
114
+ return jdl ["JDL" ]
115
+
116
+ @convertToReturnValue
117
+ def getJobLoggingInfo (self , jobID ):
118
+ fields = ["DateTime" , "Source" , "Status" , "MinorStatus" , "ApplicationStatus" ] # CF Dirac.py
119
+
120
+ jobs = self .fetch (parameters = ["LoggingInfo" ] + fields , jobIDs = [jobID ])
121
+
122
+ # Normally, only one job
123
+ if len (jobs ) == 0 :
124
+ return []
125
+ job = jobs [0 ]
126
+
127
+ # Rearrange into a list, CF Dirac.py
128
+ res = []
129
+ for field in fields :
130
+ res .append (job .get (field , "" ))
131
+
132
+ return res
133
+
134
+ @convertToReturnValue
135
+ def getJobSummary (self , jobID ):
136
+ return self .fetch (parameters = [], jobIDs = [jobID ])
137
+
138
+ @convertToReturnValue
139
+ def getJobsSummary (self , jobIDs ):
140
+ return self .fetch (parameters = [], jobIDs = jobIDs )
141
+
142
+ @convertToReturnValue
143
+ def getJobAttributes (self , jobID , attrList = None ):
144
+ if not attrList :
145
+ attrList = []
146
+
147
+ return self .fetch (parameters = attrList , jobIDs = [jobID ])
148
+
149
+ @convertToReturnValue
150
+ def getJobAttribute (self , jobID , attribute ):
151
+ return self .fetch (parameters = [attribute ], jobIDs = [jobID ])
152
+
153
+ @convertToReturnValue
154
+ def getJobHeartBeatData (self , jobID ):
155
+ with DiracXClient () as api :
156
+ res = api .jobs .get_job_heartbeat_info (job_id = jobID )
157
+
158
+ result = []
159
+ for row in res :
160
+ name = row ["Name" ]
161
+ value = str (row ["Value" ])
162
+ heartbeattime = row ["HeartBeatTime" ]
163
+ # ('name', '"0.1"', 'time')
164
+ # :)
165
+ result .append ((str (name ), "%.01f" % (float (value .replace ('"' , "" ))), str (heartbeattime )))
0 commit comments