Skip to content

Commit b2e4c7f

Browse files
authored
Merge pull request #5925 from fstagni/80_fixes19
[8.0] added TornadoWMSAdministratorHandler
2 parents db9e9a6 + 4cb960b commit b2e4c7f

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

docs/source/AdministratorGuide/ServerInstallations/scalingAndLimitations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Services
142142
+ +---------------------------------------------------------------------------------------------------+-------------+---------------------------------------------------------------------------+-----------+
143143
| | :mod:`SandboxStore <DIRAC.WorkloadManagementSystem.Service.SandboxStoreHandler>` | | | +
144144
+ +---------------------------------------------------------------------------------------------------+-------------+---------------------------------------------------------------------------+-----------+
145-
| | :mod:`WMSAdministrator <DIRAC.WorkloadManagementSystem.Service.WMSAdministratorHandler>` | YES | | +
145+
| | :mod:`WMSAdministrator <DIRAC.WorkloadManagementSystem.Service.WMSAdministratorHandler>` | YES | | YES +
146146
+--------------------+---------------------------------------------------------------------------------------------------+-------------+---------------------------------------------------------------------------+-----------+
147147

148148

src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ Services
7878
banSite += Operator
7979
}
8080
}
81+
TornadoWMSAdministrator
82+
{
83+
Protocol = https
84+
Authorization
85+
{
86+
Default = Operator
87+
getJobPilotOutput = authenticated
88+
getSiteMask = authenticated
89+
getSiteMaskStatus = authenticated
90+
ping = authenticated
91+
allowSite = SiteManager
92+
allowSite += Operator
93+
banSite = SiteManager
94+
banSite += Operator
95+
}
96+
}
8197
#Parameters of the Pilots service
8298
PilotManager
8399
{

src/DIRAC/WorkloadManagementSystem/Service/JobMonitoringHandler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
The following methods are available in the Service interface
55
"""
6-
from datetime import timedelta
76

87
from DIRAC import S_OK, S_ERROR
98
from DIRAC.Core.DISET.RequestHandler import RequestHandler
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
""" Tornado-based HTTPs WMSAdministrator service.
2+
"""
3+
from DIRAC import gLogger
4+
from DIRAC.Core.Tornado.Server.TornadoService import TornadoService
5+
from DIRAC.WorkloadManagementSystem.Service.WMSAdministratorHandler import WMSAdministratorHandlerMixin
6+
7+
8+
sLog = gLogger.getSubLogger(__name__)
9+
10+
11+
class TornadoWMSAdministratorHandler(WMSAdministratorHandlerMixin, TornadoService):
12+
log = sLog

src/DIRAC/WorkloadManagementSystem/Service/WMSAdministratorHandler.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from DIRAC.WorkloadManagementSystem.Client.PilotManagerClient import PilotManagerClient
1111

1212

13-
class WMSAdministratorHandler(RequestHandler):
13+
class WMSAdministratorHandlerMixin:
1414
@classmethod
1515
def initializeHandler(cls, svcInfoDict):
1616
"""WMS AdministratorService initialization"""
@@ -20,7 +20,7 @@ def initializeHandler(cls, svcInfoDict):
2020
return result
2121
cls.jobDB = result["Value"]()
2222
except RuntimeError as excp:
23-
return S_ERROR("Can't connect to DB: %s" % excp)
23+
return S_ERROR(f"Can't connect to DB: {excp!r}")
2424

2525
cls.elasticJobParametersDB = None
2626
useESForJobParametersFlag = Operations().getValue("/Services/JobMonitoring/useESForJobParametersFlag", False)
@@ -33,7 +33,7 @@ def initializeHandler(cls, svcInfoDict):
3333
return result
3434
cls.elasticJobParametersDB = result["Value"]()
3535
except RuntimeError as excp:
36-
return S_ERROR("Can't connect to DB: %s" % excp)
36+
return S_ERROR(f"Can't connect to DB: {excp!r}")
3737

3838
cls.pilotManager = PilotManagerClient()
3939

@@ -260,3 +260,7 @@ def export_getSiteSummarySelectors(cls):
260260
resultDict["Site"] = siteList
261261

262262
return S_OK(resultDict)
263+
264+
265+
class WMSAdministratorHandler(WMSAdministratorHandlerMixin, RequestHandler):
266+
pass

0 commit comments

Comments
 (0)