summaryrefslogtreecommitdiffstats
path: root/doctor_tests/inspector/vitrage.py
blob: 0452d9b1cb000db4f30f5d9fad148ad493af3682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
##############################################################################
# Copyright (c) 2017 ZTE Corporation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
from doctor_tests.identity_auth import get_identity_auth
from doctor_tests.identity_auth import get_session
from doctor_tests.os_clients import keystone_client
from doctor_tests.os_clients import vitrage_client

from doctor_tests.inspector.base import BaseInspector


class VitrageInspector(BaseInspector):

    def __init__(self, conf, log):
        super(VitrageInspector, self).__init__(conf, log)
        self.auth = get_identity_auth()
        self.keystone = keystone_client(self.conf.keystone_version,
                                        get_session(auth=self.auth))
        self.vitrage = vitrage_client(self.conf.vitrage_version,
                                      get_session(auth=self.auth))
        self.inspector_url = self.get_inspector_url()

    def get_inspector_url(self):
        vitrage_endpoint = \
            self.keystone.session.get_endpoint(
                service_type='rca',
                interface='publicURL')
        return '%s/v1/event' % vitrage_endpoint

    def start(self):
        self.log.info('vitrage inspector start......')

    def stop(self):
        self.log.info('vitrage inspector stop......')