Skip to content

Commit 6661728

Browse files
committed
feat: added TornadoNotificationHandler
1 parent 922e7af commit 6661728

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

src/DIRAC/FrameworkSystem/ConfigTemplate.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,23 @@ Services
159159
ping = authenticated
160160
}
161161
}
162+
##BEGIN TornadoNotification:
163+
# Section to describe Notification system
164+
TornadoNotification
165+
{
166+
SMSSwitch = sms.switch.ch
167+
Authorization
168+
{
169+
Default = AlarmsManagement
170+
sendMail = authenticated
171+
sendSMS = authenticated
172+
removeNotificationsForUser = authenticated
173+
markNotificationsAsRead = authenticated
174+
getNotifications = authenticated
175+
ping = authenticated
176+
}
177+
}
178+
##END
162179
ComponentMonitoring
163180
{
164181
Port = 9190
@@ -173,6 +190,7 @@ Services
173190
getInstallations = authenticated
174191
updateLog = Operator
175192
}
193+
}
176194
##BEGIN TornadoComponentMonitoring:
177195
# Section to describe ComponentMonitoring system
178196
TornadoComponentMonitoring

src/DIRAC/FrameworkSystem/Service/NotificationHandler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from DIRAC.Core.Utilities.DictCache import DictCache
2424

2525

26-
class NotificationHandler(RequestHandler):
26+
class NotificationHandlerMixin:
2727
@classmethod
2828
def initializeHandler(cls, serviceInfo):
2929
"""Handler initialization"""
@@ -270,3 +270,7 @@ def export_getNotifications(self, selectDict, sortList, startItem, maxItems):
270270
if Properties.ALARMS_MANAGEMENT not in credDict["properties"]:
271271
selectDict["user"] = [credDict["username"]]
272272
return self.notDB.getNotifications(selectDict, sortList, startItem, maxItems)
273+
274+
275+
class NotificationHandler(NotificationHandlerMixin, RequestHandler):
276+
pass
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
""" TornadoNotification is the implementation of the Notification service in HTTPS
2+
3+
.. literalinclude:: ../ConfigTemplate.cfg
4+
:start-after: ##BEGIN TornadoNotification:
5+
:end-before: ##END
6+
:dedent: 2
7+
:caption: TornadoNotification options
8+
"""
9+
from DIRAC.Core.Tornado.Server.TornadoService import TornadoService
10+
from DIRAC.FrameworkSystem.Service.NotificationHandler import NotificationHandlerMixin
11+
12+
13+
class TornadoNotificationHandler(NotificationHandlerMixin, TornadoService):
14+
pass

0 commit comments

Comments
 (0)