support vitrage inspector for local installer
[doctor.git] / doctor_tests / inspector / vitrage.py
1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corporation and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 from doctor_tests.identity_auth import get_identity_auth
10 from doctor_tests.identity_auth import get_session
11 from doctor_tests.os_clients import keystone_client
12 from doctor_tests.os_clients import vitrage_client
13
14 from doctor_tests.inspector.base import BaseInspector
15
16
17 class VitrageInspector(BaseInspector):
18
19     def __init__(self, conf, log):
20         super(VitrageInspector, self).__init__(conf, log)
21         self.auth = get_identity_auth()
22         self.keystone = keystone_client(get_session(auth=self.auth))
23         self.vitrage = vitrage_client(self.conf.vitrage_version,
24                                       get_session(auth=self.auth))
25         self.inspector_url = self.get_inspector_url()
26
27     def get_inspector_url(self):
28         vitrage_endpoint = \
29             self.keystone.session.get_endpoint(
30                 service_type='rca',
31                 interface='publicURL')
32         return '%s/v1/event' % vitrage_endpoint
33
34     def start(self):
35         self.log.info('vitrage inspector start......')
36
37     def stop(self):
38         self.log.info('vitrage inspector stop......')