#! /usr/bin/env python
+import urlparse
from ConfigParser import SafeConfigParser, NoOptionError
self.es_creds = None
self.kibana_url = None
self.js_path = None
+ self.index_url = None
def _get_str_parameter(self, section, param):
try:
obj.es_creds = obj._get_str_parameter("elastic", "creds")
obj.kibana_url = obj._get_str_parameter("kibana", "url")
obj.js_path = obj._get_str_parameter("kibana", "js_path")
+ index = obj._get_str_parameter("elastic", "index")
+ obj.index_url = urlparse.urljoin(obj.es_url, index)
return obj
return "elastic_url = %s \n" \
"elastic_creds = %s \n" \
"kibana_url = %s \n" \
+ "index_url = %s \n" \
"js_path = %s \n" % (self.es_url,
self.es_creds,
self.kibana_url,
+ self.index_url,
self.js_path)
#! /usr/bin/env python
import json
-import urlparse
import argparse
}
})
- elastic_data = elastic_access.get_docs(
- urlparse.urljoin(CONF.es_url, '/testapi/results'),
- CONF.es_creds,
- query)
+ elastic_data = elastic_access.get_docs(CONF.index_url,
+ CONF.es_creds,
+ query)
pods_and_scenarios = {}
import os
import subprocess
import traceback
-import urlparse
import uuid
import argparse
self._remove()
exit(-1)
- def get_existed_docs(self):
+ def get_exists(self):
if self.days == 0:
body = '''{{
"query": {{
def main():
- base_elastic_url = urlparse.urljoin(CONF.es_url, '/testapi/results')
- days = args.latest_days
- es_creds = CONF.es_creds
-
for project, case_dicts in testcases.testcases_yaml.items():
for case_dict in case_dicts:
case = case_dict.get('name')
DocumentsPublisher(project,
case,
fmt,
- days,
- base_elastic_url,
- es_creds).export().get_existed_docs().publish()
+ args.latest_days,
+ CONF.index_url,
+ CONF.es_creds).export().get_exists().publish()
# the CONF object in config.ini must be updated
[elastic]
url = http://localhost:9200
+index = testapi/results
creds =
[kibana]