def cmd_list_sources(environments): print('Listing sources from Hava.') sources = hava_proxy.get_sources() if environments == 'y': for source in tqdm(sources): print('Getting environments for source with id "{id}" from Hava.'. format(id=source.id)) source.environments = hava_proxy.get_envs_by_source(source.id) results_for_output = utils.serialise_to_json(sources) print(results_for_output)
def hv_get_stats(source): stats = dict(sources=0, envs=0) envs = [] if (source): print('getting stats for source "{source}" from hava...'.format( source=source)) stats["sources"] = 1 envs = hava_proxy.get_env_count_by_source(source) else: print("getting stats of all hava resources...") for source in hava_proxy.get_sources(): stats["sources"] += 1 envs = hava_proxy.get_envs() for env in envs: stats["envs"] += 1 print(utils.serialise_to_json(stats))
def cmd_get_content_body(page_id): print('Getting body for page with id "{page_id}"'.format(page_id=page_id)) results = confluence_proxy.get_content_body(page_id) results_for_output = utils.serialise_to_json(results) print(results_for_output)
def cmd_list_content(space_key): print( 'Getting content for space "{space_key}"'.format(space_key=space_key)) results = confluence_proxy.get_content_by_space(space_key) results_for_output = utils.serialise_to_json(results) print(results_for_output)
def cmd_get_env(id): print('Getting environment with id "{id}" from Hava.'.format(id=id)) env = hava_proxy.get_env(id) results_for_output = utils.serialise_to_json(env) print(results_for_output)
def cmd_get_source(id): print('Getting source from Hava.') source = hava_proxy.get_source(id) results_for_output = utils.serialise_to_json(source) print(results_for_output)