noc.main.models.notificationgroup

Module Contents

noc.main.models.notificationgroup.id_lock
noc.main.models.notificationgroup.logger
noc.main.models.notificationgroup.NOTIFICATION_TOPICS
noc.main.models.notificationgroup.NOTIFICATION_METHOD_CHOICES
noc.main.models.notificationgroup.USER_NOTIFICATION_METHOD_CHOICES
class noc.main.models.notificationgroup.NotificationGroup

Bases: noc.core.model.base.NOCModel

Notification Groups

class Meta

Bases: object

verbose_name = Notification Group
verbose_name_plural = Notification Groups
app_label = main
db_table = main_notificationgroup
ordering = ['name']
name
description
_id_cache
_name_cache
members

List of (time pattern, method, params, language)

active_members

List of currently active members: (method, param, language)

languages

List of preferred languages for users

__str__(self)
classmethod get_by_id(cls, id)
classmethod get_by_name(cls, name)
classmethod get_effective_message(cls, messages, lang)
classmethod send_notification(cls, method, address, subject, body, attachments=None)
notify(self, subject, body, link=None, attachments=None)

Send message to active members :param subject: Message subject :param body: Message body :param link: Optional link :param attachments: List of attachments. Each one is a dict

with keys filename and data. data is the raw data
classmethod group_notify(cls, groups, subject, body, link=None, delay=None, tag=None)

Send notification to a list of groups Prevent duplicated messages

class noc.main.models.notificationgroup.NotificationGroupUser

Bases: noc.core.model.base.NOCModel

class Meta

Bases: object

verbose_name = Notification Group User
verbose_name_plural = Notification Group Users
app_label = main
db_table = main_notificationgroupuser
unique_together = [['notification_group', 'time_pattern', 'user']]
notification_group
time_pattern
user
__str__(self)
class noc.main.models.notificationgroup.NotificationGroupOther

Bases: noc.core.model.base.NOCModel

class Meta

Bases: object

verbose_name = Notification Group Other
verbose_name_plural = Notification Group Others
app_label = main
db_table = main_notificationgroupother
unique_together = [['notification_group', 'time_pattern', 'notification_method', 'params']]
notification_group
time_pattern
notification_method
params
__str__(self)