def main(): filename = _get_log_filename() LoggingService(INITIAL_LOG_LEVEL, INITIAL_LOG_LEVEL, filename) bootstrapper = Bootstrapper() ces = bootstrapper.get_command_executer_service() command_to_run = os.environ.get('COMMAND') # for debug if len(sys.argv) > 2 and sys.argv[1] == "debug": cloudshellConnectData = {"user": "******", "password": "******", "domain": "Global", "reservationId": "17b9c357-bfe8-46b9-9828-47b3e1cacc4f"} attachAndGetResourceContext(cloudshellConnectData) command_to_run = sys.argv[2] os.environ["resourceContext".upper()] = '{"name":"VCenter Template Request", "address":"Service",' \ ' "model":"VCenter Template Request", "family":"VM Request", ' \ '"description":"", "fullname":"", ' \ '"attributes":{"vCenter Template":"vCenter/QualiSB/Alex/test",' \ '"VM Power State":"True",' \ '"VM Storage":"eric ds cluster", ' \ '"VM Cluster":"QualiSB Cluster/LiverPool"}}' # execute the command getattr(ces, command_to_run)()
from aiohttp import web from bootstrap import Bootstrapper bootstrapper = Bootstrapper() web.run_app(bootstrapper.create_application())