aboutsummaryrefslogtreecommitdiffstats
path: root/api/resources/v2/containers.py
diff options
context:
space:
mode:
Diffstat (limited to 'api/resources/v2/containers.py')
-rw-r--r--api/resources/v2/containers.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/api/resources/v2/containers.py b/api/resources/v2/containers.py
index 66dc94120..f71e607e7 100644
--- a/api/resources/v2/containers.py
+++ b/api/resources/v2/containers.py
@@ -259,34 +259,28 @@ class V2Containers(ApiResource):
def _create_dashboard(self, ip):
url = 'http://admin:admin@{}:{}/api/dashboards/db'.format(ip, 3000)
- path = os.path.join(consts.REPOS_DIR, 'dashboard', '*dashboard.json')
+ path = os.path.join(consts.REPOS_DIR, 'dashboard', 'opnfv_yardstick_tc*.json')
for i in sorted(glob.iglob(path)):
with open(i) as f:
data = jsonutils.load(f)
try:
- HttpClient().post(url, data)
+ HttpClient().post(url, {'dashboard': data})
except Exception:
LOG.exception('Create dashboard %s failed', i)
raise
def _create_data_source(self, ip):
url = 'http://admin:admin@{}:{}/api/datasources'.format(ip, 3000)
-
- influx_conf = utils.parse_ini_file(consts.CONF_FILE)
- try:
- influx_url = influx_conf['dispatcher_influxdb']['target']
- except KeyError:
- LOG.exception('influxdb url not set in yardstick.conf')
- raise
+ influx_conf = utils.parse_ini_file(consts.CONF_FILE).get('dispatcher_influxdb', {})
data = {
"name": "yardstick",
"type": "influxdb",
"access": "proxy",
- "url": influx_url,
- "password": "root",
- "user": "root",
+ "url": influx_conf.get('target', ''),
+ "password": influx_conf.get('password', ''),
+ "user": influx_conf.get('username', ''),
"database": "yardstick",
"basicAuth": True,
"basicAuthUser": "admin",