NotificationClient

DIRAC Notification Client class encapsulates the methods exposed by the Notification service.

class DIRAC.FrameworkSystem.Client.NotificationClient.NotificationClient

Bases: DIRAC.Core.Base.Client.Client

__init__()

Notification Client constructor

addNotificationForUser(user, message, lifetime=604800, deferToMail=True)
executeRPC(*parms, **kws)

This method extracts some parameters from kwargs that are used as parameter of the constructor or RPCClient. Unfortunately, only a few of all the available parameters of BaseClient are exposed.

Parameters:
  • rpc – if an RPC client is passed, use that one
  • timeout – we can change the timeout on a per call bases. Default 120 s
  • url – We can specify which url to use
getServer()

Getter for the server url. Useful ?

newAlarm(subject, status, notifications, assignee, body, priority, alarmKey='')
sendMail(addresses, subject, body, fromAddress=None, localAttempt=True, html=False, avoidSpam=False)

Send an e-mail with subject and body to the specified address. Try to send from local area before central service by default.

sendSMS(userName, body, fromAddress=None)

Send an SMS with body to the specified DIRAC user name.

setServer(url)

Set the server URL used by default

Parameters:url – url of the service
setTimeout(timeout)

Specify the timeout of the call. Forwarded to RPCClient

Parameters:timeout – guess…
updateAlarm(id=-1, alarmKey='', comment=False, modDict={})