aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/cmd/commands/env.py
blob: 098379ae16eecaa3e388d230ff57d5251b1fdd72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
##############################################################################
# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
import logging

from yardstick.common.httpClient import HttpClient
from yardstick.common import constants

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)


class EnvCommand(object):
    '''

        Set of commands to prepare environment
    '''
    def do_influxdb(self, args):
        url = constants.YARDSTICK_ENV_ACTION_API
        data = {'action': 'createInfluxDBContainer'}
        HttpClient().post(url, data)
        logger.debug('Now creating and configing influxdb')

    def do_grafana(self, args):
        url = constants.YARDSTICK_ENV_ACTION_API
        data = {'action': 'createGrafanaContainer'}
        HttpClient().post(url, data)
        logger.debug('Now creating and configing grafana')

    def do_prepare(self, args):
        url = constants.YARDSTICK_ENV_ACTION_API
        data = {'action': 'prepareYardstickEnv'}
        HttpClient().post(url, data)
        logger.debug('Now preparing environment')