Пример #1
0
 def alert_create(self, action, expression, trigger="graph"):
     data = json.dumps({
         "Action": action,
         "Expression": expression,
         "Trigger": trigger
     })
     a = self.request("/api/alert", method="POST", data=data)
     return Alert.from_object(a)
Пример #2
0
 def alert_list(self):
     objs = self.request("/api/alert")
     return [Alert.from_object(o) for o in objs.values()]