forked from DIRACGrid/DIRAC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJobMonitoringClient.py
More file actions
executable file
·87 lines (68 loc) · 2.61 KB
/
JobMonitoringClient.py
File metadata and controls
executable file
·87 lines (68 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
""" Class that contains client access to the job monitoring handler. """
from DIRAC.Core.Base.Client import Client, createClient
from DIRAC.Core.Utilities.DEncode import ignoreEncodeWarning
from DIRAC.Core.Utilities.JEncode import strToIntDict
try:
from DIRAC.WorkloadManagementSystem.FutureClient.JobMonitoringClient import (
JobMonitoringClient as futureJobMonitoringClient,
)
except ImportError:
futureJobMonitoringClient = None
@createClient("WorkloadManagement/JobMonitoring")
class JobMonitoringClient(Client):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.setServer("WorkloadManagement/JobMonitoring")
diracxClient = futureJobMonitoringClient
@ignoreEncodeWarning
def getJobsStatus(self, jobIDs):
res = self._getRPC().getJobsStatus(jobIDs)
# Cast the str keys to int
if res["OK"]:
res["Value"] = strToIntDict(res["Value"])
return res
@ignoreEncodeWarning
def getJobParameters(self, jobIDs, parName=None):
res = self._getRPC().getJobParameters(jobIDs, parName)
# Cast the str keys to int
if res["OK"]:
res["Value"] = strToIntDict(res["Value"])
return res
@ignoreEncodeWarning
def getJobsParameters(self, jobIDs, parameters):
res = self._getRPC().getJobsParameters(jobIDs, parameters)
# Cast the str keys to int
if res["OK"]:
res["Value"] = strToIntDict(res["Value"])
return res
@ignoreEncodeWarning
def getJobsMinorStatus(self, jobIDs):
res = self._getRPC().getJobsMinorStatus(jobIDs)
# Cast the str keys to int
if res["OK"]:
res["Value"] = strToIntDict(res["Value"])
return res
@ignoreEncodeWarning
def getJobsApplicationStatus(self, jobIDs):
res = self._getRPC().getJobsApplicationStatus(jobIDs)
# Cast the str keys to int
if res["OK"]:
res["Value"] = strToIntDict(res["Value"])
return res
@ignoreEncodeWarning
def getJobsSites(self, jobIDs):
res = self._getRPC().getJobsSites(jobIDs)
# Cast the str keys to int
if res["OK"]:
res["Value"] = strToIntDict(res["Value"])
return res
def getJobsStates(self, jobIDs):
res = self._getRPC().getJobsStates(jobIDs)
if res["OK"]:
res["Value"] = strToIntDict(res["Value"])
return res
def getInputData(self, jobIDs):
res = self._getRPC().getInputData(jobIDs)
if res["OK"] and isinstance(res["Value"], dict):
res["Value"] = strToIntDict(res["Value"])
return res