Completed
Pull Request — master (#543)
by
unknown
03:20 queued 51s
created

MmonitGetEvent   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2
1
from lib.mmonit import MmonitBaseAction
2
3
4
class MmonitGetEvent(MmonitBaseAction):
5
    def run(self, event_id):
6
        self.login()
7
        data = {"id": event_id}
8
        req = self.session.get("{}/reports/events/get".format(self.url), params=data)
9
10
        try:
11
            return req.json()
12
        except Exception:
13
            raise
14
        finally:
15
            self.logout()
16