Beispiel #1
0
def stack_api():
    workspace_api_mock = mock.patch('databricks_cli.stack.api.WorkspaceApi')
    jobs_api_mock = mock.patch('databricks_cli.stack.api.JobsApi')
    dbfs_api_mock = mock.patch('databricks_cli.stack.api.DbfsApi')
    workspace_api_mock.return_value = mock.MagicMock()
    jobs_api_mock.return_value = mock.MagicMock()
    dbfs_api_mock.return_value = mock.MagicMock()
    stack_api = api.StackApi(mock.MagicMock())
    yield stack_api
Beispiel #2
0
def run(params):
	db_api_client = db_client_utils.create_client(params['db_host'], params['db_pat'])
	stack_client = stack_api.StackApi(db_api_client)

	with open(params['stack_config_path']) as stack_config_file:
		log.info('Reading stack config')
		stack_config = stack_config_file.read()
		
		log.info('Successfully Read stack config file')
		log.debug(stack_config)
		log.info('Beginning stack deploy')

		res = stack_client.deploy(json.loads(stack_config))
		log.info('Stack deployment to workspace completed successfully. Stack deployment results: \n', res)