Completed
Push — master ( 84e890...c23c43 )
by
unknown
22s
created

Icinga2Action.set_path()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 2
rs 10
1
from st2actions.runners.pythonrunner import Action
2
from lib.client import Client
0 ignored issues
show
Bug introduced by
The name client does not seem to exist in module lib.
Loading history...
3
4
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