support vitrage inspector for local installer
[doctor.git] / doctor_tests / inspector / vitrage.py
diff --git a/doctor_tests/inspector/vitrage.py b/doctor_tests/inspector/vitrage.py
new file mode 100644 (file)
index 0000000..7d1dbc1
--- /dev/null
@@ -0,0 +1,38 @@
+##############################################################################
+# 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(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......')