6aa3a451a123fe08af21f3471133d7a60e6fef02
[yardstick.git] / yardstick / cmd / commands / scenario.py
1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB and others.
3 #
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 ##############################################################################
9
10 """ Handler for yardstick command 'scenario' """
11
12 from yardstick.benchmark.core.scenario import Scenarios
13 from yardstick.common.utils import cliargs
14 from yardstick.cmd.commands import change_osloobj_to_paras
15
16
17 class ScenarioCommands(object):
18     '''Scenario commands.
19
20        Set of commands to discover and display scenario types.
21     '''
22
23     def do_list(self, args):
24         '''List existing scenario types'''
25         param = change_osloobj_to_paras(args)
26         Scenarios().list_all(param)
27
28     @cliargs("type", type=str, help="runner type", nargs=1)
29     def do_show(self, args):
30         '''Show details of a specific scenario type'''
31         param = change_osloobj_to_paras(args)
32         Scenarios().show(param)