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)
property call

To be removed once we’re sure self.call has been removed

Type

Deprecated

deleteAlarmsByAlarmId(cls, alarmsIdList, **kwargs)

Delete alarms by alarmId

Automatically created for the service function export_deleteAlarmsByAlarmId()

Parameters

alarmsIdList – alarmsIdList

deleteAlarmsByAlarmKey(cls, alarmsKeyList, **kwargs)

Delete alarms by alarmId

Automatically created for the service function export_deleteAlarmsByAlarmKey()

Parameters

alarmsKeyList – alarmsKeyList

deleteAssigneeGroup(cls, 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(cls, alarmId, **kwargs)

Get the extended info of an alarm

Automatically created for the service function export_getAlarmInfo()

Parameters

alarmId – alarmId

getAlarms(cls, 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(cls, **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(cls, groupName, **kwargs)

Get users in assignee group

Automatically created for the service function export_getUsersInAssigneeGroup()

Parameters

groupName – groupName

httpsClient

alias of DIRAC.Core.Tornado.Client.TornadoClient.TornadoClient

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)

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(cls, 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

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