summaryrefslogtreecommitdiffstats
path: root/data/pushtoDB.py
diff options
context:
space:
mode:
authorMofassir <Mofassir_arif@Dellteam.com>2016-01-06 04:03:57 -0800
committerMofassir <Mofassir_arif@Dellteam.com>2016-01-06 04:05:24 -0800
commit61159e1e4f028dbb34573f2186d448be578894ee (patch)
tree5d9dc9ff46974f9e86c9a69bd2a37e4561fe7d63 /data/pushtoDB.py
parentcb47406502e3ab9029530e82cacc2f9f012d5bd3 (diff)
started work on the dashboard API
Change-Id: Ifbb16f20ff8a0821b790c0c44a1eae82875f9051 Signed-off-by: Mofassir <Mofassir_arif@Dellteam.com>
Diffstat (limited to 'data/pushtoDB.py')
-rw-r--r--data/pushtoDB.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/data/pushtoDB.py b/data/pushtoDB.py
new file mode 100644
index 00000000..fab78520
--- /dev/null
+++ b/data/pushtoDB.py
@@ -0,0 +1,23 @@
+import requests
+import json
+import os
+TEST_DB = 'http://213.77.62.197'
+
+
+
+def push_results_to_db(db_url=TEST_DB, case_name, logger=None, pod_name='dell-us-testing-bm-1', payload):
+ url = db_url + "/results"
+ installer = get_installer_type(logger)
+ params = {"project_name": "functest", "case_name": case_name,
+ "pod_name": os.environ[''], "installer": installer,
+ "version": git_version, "details": payload}
+
+ headers = {'Content-Type': 'application/json'}
+ try:
+ r = requests.post(url, data=json.dumps(params), headers=headers)
+ logger.debug(r)
+ return True
+ except:
+ print "Error:", sys.exc_info()[0]
+ return False
+