Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more |
||
18 | class CloseAlertAction(OpsGenieBaseAction): |
||
19 | def run(self, alert_id, alias=None, user=None, note=None, source="StackStorm"): |
||
20 | """ |
||
21 | """ |
||
22 | |||
23 | body = {"apiKey": self.api_key, |
||
24 | "source": source} |
||
25 | |||
26 | if alias: |
||
27 | body["alias"] = alias |
||
28 | else: |
||
29 | body["id"] = alert_id |
||
30 | |||
31 | if user: |
||
32 | body['user'] = user |
||
33 | |||
34 | if note: |
||
35 | body['note'] = note |
||
36 | |||
37 | data = self._req("POST", |
||
38 | "v1/json/alert/close", |
||
39 | body=body) |
||
40 | |||
41 | return data |
||
42 |