in 5-app-infra/3-artifact-publish/docker/cdmc/tag_engine_api/main.py [0:0]
def refresh_job_status():
if 'credentials' not in session:
return redirect('/')
job_uuid = request.form['job_uuid']
config_uuid = request.form['config_uuid']
config_type = request.form['config_type']
if 'template_id' in request.form:
template_id = request.form['template_id']
else:
template_id = 'N/A' # export config handler
if 'template_project' in request.form:
template_project = request.form['template_project']
else:
template_project = 'N/A' # export config handler
if 'template_region' in request.form:
template_region = request.form['template_region']
else:
template_region = 'N/A' # export config handler
if template_id == 'N/A' and template_project == 'N/A' and template_region == 'N/A':
target_project = request.form['target_project']
target_dataset = request.form['target_dataset']
else:
target_project = 'N/A'
target_dataset = 'N/A'
service_account = request.form['service_account']
action = request.form['action']
if action == "Refresh":
job = jm.get_job_status(job_uuid)
entries = get_log_entries(service_account)
return render_template(
'job_status.html',
job_uuid=job_uuid,
entries=entries,
job_status=job['job_status'],
config_uuid=config_uuid,
config_type=config_type,
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
target_project=target_project,
target_dataset=target_dataset)
if action == "View Existing Configs":
configs = store.read_configs(service_account, 'ALL', template_id, template_project, template_region)
return render_template(
'view_configs.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account,
configs=configs)
if action == "Return Home":
return render_template(
'home.html',
template_id=template_id,
template_project=template_project,
template_region=template_region,
service_account=service_account)