1 ##############################################################################
2 # Copyright (c) 2015 Ericsson AB 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 ##############################################################################
10 """ Handler for yardstick command 'scenario' """
12 from __future__ import print_function
13 from __future__ import absolute_import
14 from yardstick.benchmark.core.scenario import Scenarios
15 from yardstick.common.utils import cliargs
16 from yardstick.cmd.commands import change_osloobj_to_paras
19 class ScenarioCommands(object):
22 Set of commands to discover and display scenario types.
25 def do_list(self, args):
26 """List existing scenario types"""
27 param = change_osloobj_to_paras(args)
28 Scenarios().list_all(param)
30 @cliargs("type", type=str, help="runner type", nargs=1)
31 def do_show(self, args):
32 """Show details of a specific scenario type"""
33 param = change_osloobj_to_paras(args)
34 Scenarios().show(param)