in 5-app-infra/3-artifact-publish/docker/cdmc/tag_engine_api/main.py [0:0]
def view_config_options():
if 'credentials' not in session:
return redirect('/')
template_id = request.form['template_id']
template_project = request.form['template_project']
template_region = request.form['template_region']
service_account = request.form['service_account']
action = request.form['action']
print("template_id: " + str(template_id))
print("template_project: " + str(template_project))
print("template_region: " + str(template_region))
print("action: " + str(action))
credentials, success = get_target_credentials(service_account)
if success == False:
print('Error acquiring credentials from', service_account)
dcc = controller.DataCatalogController(credentials, None, None, template_id, template_project, template_region)
template_fields = dcc.get_template()
history_enabled, _ = store.read_tag_history_settings()
if action == "View Existing Configs":
configs = store.read_configs(service_account, 'ALL', template_id, template_project, template_region)
print('configs: ', configs)
return render_template(
'view_configs.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
configs=configs)
elif action == "Create Static Asset Tags":
return render_template(
'static_asset_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
current_time=datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S'),
tag_history_option=history_enabled)
elif action == "Create Dynamic Table Tags":
return render_template(
'dynamic_table_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
tag_history_option=history_enabled)
elif action == "Create Dynamic Column Tags":
return render_template(
'dynamic_column_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
tag_history_option=history_enabled)
elif action == "Create Data Catalog Entries":
return render_template(
'entry_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
tag_history_option=history_enabled)
elif action == "Create Glossary Asset Tags":
return render_template(
'glossary_asset_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
tag_history_option=history_enabled)
elif action == "Create Sensitive Column Tags":
return render_template(
'sensitive_column_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
tag_history_option=history_enabled)
elif action == "Import Tags":
return render_template(
'import_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
tag_history_option=history_enabled)
elif action == "Restore Tags":
return render_template(
'restore_config.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
fields=template_fields,
tag_history_option=history_enabled)
elif action == "Switch Template / Return Home" or action == 'Return Home':
return render_template(
'home.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account)