1 ##############################################################################
2 # Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 from yardstick.common.httpClient import HttpClient
12 from yardstick.common import constants
14 logger = logging.getLogger(__name__)
15 logger.setLevel(logging.DEBUG)
18 class EnvCommand(object):
21 Set of commands to prepare environment
23 def do_influxdb(self, args):
24 url = constants.YARDSTICK_ENV_ACTION_API
25 data = {'action': 'createInfluxDBContainer'}
26 HttpClient().post(url, data)
27 logger.debug('Now creating and configing influxdb')
29 def do_grafana(self, args):
30 url = constants.YARDSTICK_ENV_ACTION_API
31 data = {'action': 'createGrafanaContainer'}
32 HttpClient().post(url, data)
33 logger.debug('Now creating and configing grafana')
35 def do_prepare(self, args):
36 url = constants.YARDSTICK_ENV_ACTION_API
37 data = {'action': 'prepareYardstickEnv'}
38 HttpClient().post(url, data)
39 logger.debug('Now preparing environment')