NotificationClient

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

class DIRAC.FrameworkSystem.Client.NotificationClient.NotificationClient(**kwargs)

Bases: DIRAC.Core.Base.Client.Client

__init__(**kwargs)

Notification Client constructor

addNotificationForUser(user, message, lifetime=604800, deferToMail=True)
deleteAlarmsByAlarmId(self, alarmsIdList, **kwargs)

Delete alarms by alarmId

Automatically created for the service function export_deleteAlarmsByAlarmId()

Parameters:alarmsIdList – alarmsIdList
deleteAlarmsByAlarmKey(self, alarmsKeyList, **kwargs)

Delete alarms by alarmId

Automatically created for the service function export_deleteAlarmsByAlarmKey()

Parameters:alarmsKeyList – alarmsKeyList
deleteAssigneeGroup(self, groupName, **kwargs)

Delete an assignee group

Automatically created for the service function export_deleteAssigneeGroup()

Parameters:groupName – groupName
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 is self.timeout
  • url – We can specify which url to use
getAlarmInfo(self, alarmId, **kwargs)

Get the extended info of an alarm

Automatically created for the service function export_getAlarmInfo()

Parameters:alarmId – alarmId
getAlarms(self, selectDict, sortList, startItem, maxItems, **kwargs)

Select existing alarms suitable for the Web monitoring

Automatically created for the service function export_getAlarms()

Parameters:
  • selectDict – selectDict
  • sortList – sortList
  • startItem – startItem
  • maxItems – maxItems
getAssigneeGroups(self, **kwargs)

Get all assignee groups and the users that belong to them

Automatically created for the service function export_getAssigneeGroups()

getAssigneeGroupsForUser(self, user, **kwargs)

Get all assignee groups and the users that belong to them

Automatically created for the service function export_getAssigneeGroupsForUser()

Parameters:user – user
getNotifications(self, selectDict, sortList, startItem, maxItems, **kwargs)

Get all assignee groups and the users that belong to them

Automatically created for the service function export_getNotifications()

Parameters:
  • selectDict – selectDict
  • sortList – sortList
  • startItem – startItem
  • maxItems – maxItems
getServer()

Getter for the server url. Useful ?

getUsersInAssigneeGroup(self, groupName, **kwargs)

Get users in assignee group

Automatically created for the service function export_getUsersInAssigneeGroup()

Parameters:groupName – groupName
markNotificationsAsNotRead(self, user, notIds, **kwargs)

Delete an assignee group

Automatically created for the service function export_markNotificationsAsNotRead()

Parameters:
  • user – user
  • notIds – notIds
markNotificationsAsRead(self, user, notIds, **kwargs)

Delete an assignee group

Automatically created for the service function export_markNotificationsAsRead()

Parameters:
  • user – user
  • notIds – notIds
newAlarm(subject, status, notifications, assignee, body, priority, alarmKey='')
removeNotificationsForUser(self, user, notIds, **kwargs)

Get users in assignee group

Automatically created for the service function export_removeNotificationsForUser()

Parameters:
  • user – user
  • notIds – notIds
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.

setAssigneeGroup(self, groupName, userList, **kwargs)

Create a group of users to be used as an assignee for an alarm

Automatically created for the service function export_setAssigneeGroup()

Parameters:
  • groupName – groupName
  • userList – userList
setServer(url)

Set the server URL used by default

Parameters:url – url of the service
setTimeout(**kwargs)

Specify the timeout of the call. Forwarded to RPCClient

param int timeout:
 timeout for the RPC calls

Deprecated: Please use self._getRPC(timeout) or self.timeout=<value>

updateAlarm(id=-1, alarmKey='', comment=False, modDict={})