Пример #1
0
    def setting_set(self, level, setting_type, capacity=0, threshold=0.0,
                    alarm_title=None, alarm_content=None, deleted=False,
                    enable=True):
        setting = dict({"uuid": utils.generate_uuid(),
                        "enable": enable,
                        "deleted": deleted,
                        "level": level,
                        "type": setting_type,
                        "capacity": capacity,
                        "threshold": threshold,
                        "alarm_title": alarm_title,
                        "alarm_content": alarm_content})
        self.setting.update({(level, setting_type): setting})

        return self.dict_to_setting_ref(setting)
Пример #2
0
 def alarming_create(self, values, session=None):
     id = utils.generate_uuid()
     values.update(id=id)
     self.alarms.update({id: values})
     return values