@classmethod
    def create(cls, data):
        topic = data.get("topic")
        node_id = data.get("node_id")
        task_uuid = data.pop("task_uuid", None)
        message = data.get("message")

        if topic == 'discover' and node_id is None:
            raise errors.CannotFindNodeIDForDiscovering(
                "No node id in discover notification"
            )

        if "datetime" not in data:
            data["datetime"] = datetime.now()

        exist = None
        if task_uuid:
            task = Task.get_by_uuid(task_uuid)
            if task and node_id:
                exist = NotificationCollection.count(
                    NotificationCollection.filter_by(
                        None,
                        node_id=node_id,
                        message=message,
                        task_id=task.id
                    )
                )

        if not exist:
            notification = super(Notification, cls).create(data)
            logger.info(
                u"Notification: topic: {0} message: {1}".format(
                    data.get("topic"),
                    data.get("message")
                )
            )
            return notification
        return None
Creates and returns a notification instance.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/objects/notification.py/Notification.create