| Total Complexity | 10 | 
| Total Lines | 39 | 
| Duplicated Lines | 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, self.api_password, self.method) | ||
| 22 | return client | ||
| 23 | |||
| 24 | def get_error(self): | ||
| 25 | return self.error | ||
| 26 | |||
| 27 | def get_body(self): | ||
| 28 | return self.body | ||
| 29 | |||
| 30 | def set_body(self, body): | ||
| 31 | self.body = body | ||
| 32 | |||
| 33 | def set_method(self, method): | ||
| 34 | self.method = method | ||
| 35 | |||
| 36 | def get_method(self): | ||
| 37 | return self.method | ||
| 38 | |||
| 39 | def set_path(self, path): | ||
| 40 | self.path = path | ||
| 41 | |||
| 42 | def get_path(self): | ||
| 43 | return self.path | ||
| 44 |