summaryrefslogtreecommitdiffstats
path: root/dashboard/dashboard/common/elastic_access.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-10-08 16:45:49 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-10-10 10:40:00 +0800
commit60cd25286de20e218533c6da6e3dbe29f8644798 (patch)
tree40aa95987fbd68bf810f75e47f7ba352763efe99 /dashboard/dashboard/common/elastic_access.py
parentbfdcb5a3562ef74eb64e574eff8ae4dbeb5787a0 (diff)
separate visualization building from dashboard building
JIRA: RELENG-155 Change-Id: I19355898d5dc5ef73fcfe4ebaf4604c4bf1e8f10 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'dashboard/dashboard/common/elastic_access.py')
-rw-r--r--dashboard/dashboard/common/elastic_access.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/dashboard/dashboard/common/elastic_access.py b/dashboard/dashboard/common/elastic_access.py
index 8c6494d..aaf776f 100644
--- a/dashboard/dashboard/common/elastic_access.py
+++ b/dashboard/dashboard/common/elastic_access.py
@@ -1,4 +1,5 @@
import json
+import urlparse
import urllib3
@@ -43,3 +44,8 @@ def get_docs(url, creds=None, body=None, field='_source'):
for hit in res_data['hits']['hits']:
docs.append(hit[field])
return docs
+
+
+def publish_kibana(url, creds, type, id, body):
+ url = urlparse.urljoin(url, '/.kibana/{}/{}'.format(type, id))
+ publish_docs(url, creds, body)