Total Complexity | 10 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from st2actions.runners.pythonrunner import Action |
||
5 | class Icinga2Action(Action): |
||
6 | |||
7 | def __init__(self, config): |
||
8 | super(Icinga2Action, self).__init__(config) |
||
9 | self.body = '' |
||
10 | self.error = 0 |
||
11 | self.api_url = config['api_url'] |
||
12 | self.api_user = config['api_user'] |
||
13 | self.api_password = config['api_password'] |
||
14 | self.method = 'get' |
||
15 | self.path = '' |
||
16 | |||
17 | def run(self): |
||
18 | pass |
||
19 | |||
20 | def get_client(self): |
||
21 | client = Client(self, self.api_url + self.path, self.api_user, |
||
22 | self.api_password, self.method) |
||
23 | return client |
||
24 | |||
25 | def get_error(self): |
||
26 | return self.error |
||
27 | |||
28 | def get_body(self): |
||
29 | return self.body |
||
30 | |||
31 | def set_body(self, body): |
||
32 | self.body = body |
||
33 | |||
34 | def set_method(self, method): |
||
35 | self.method = method |
||
36 | |||
37 | def get_method(self): |
||
38 | return self.method |
||
39 | |||
40 | def set_path(self, path): |
||
41 | self.path = path |
||
42 | |||
43 | def get_path(self): |
||
44 | return self.path |
||
45 |