本文整理汇总了Python中oozie.models2.Coordinator.find_all_parameters方法的典型用法代码示例。如果您正苦于以下问题:Python Coordinator.find_all_parameters方法的具体用法?Python Coordinator.find_all_parameters怎么用?Python Coordinator.find_all_parameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oozie.models2.Coordinator
的用法示例。
在下文中一共展示了Coordinator.find_all_parameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: submit_coordinator
# 需要导入模块: from oozie.models2 import Coordinator [as 别名]
# 或者: from oozie.models2.Coordinator import find_all_parameters [as 别名]
def submit_coordinator(request, doc_id):
coordinator = Coordinator(document=Document2.objects.get(id=doc_id))
ParametersFormSet = formset_factory(ParameterForm, extra=0)
if request.method == 'POST':
params_form = ParametersFormSet(request.POST)
if params_form.is_valid():
mapping = dict([(param['name'], param['value']) for param in params_form.cleaned_data])
mapping['dryrun'] = request.POST.get('dryrun_checkbox') == 'on'
jsonify = request.POST.get('format') == 'json'
job_id = _submit_coordinator(request, coordinator, mapping)
if jsonify:
return JsonResponse({'status': 0, 'job_id': job_id}, safe=False)
else:
request.info(_('Coordinator submitted.'))
return redirect(reverse('oozie:list_oozie_coordinator', kwargs={'job_id': job_id}))
else:
request.error(_('Invalid submission form: %s' % params_form.errors))
else:
parameters = coordinator.find_all_parameters()
initial_params = ParameterForm.get_initial_params(dict([(param['name'], param['value']) for param in parameters]))
params_form = ParametersFormSet(initial=initial_params)
popup = render('editor2/submit_job_popup.mako', request, {
'params_form': params_form,
'name': coordinator.name,
'action': reverse('oozie:editor_submit_coordinator', kwargs={'doc_id': coordinator.id}),
'show_dryrun': True,
'return_json': request.GET.get('format') == 'json'
}, force_template=True).content
return JsonResponse(popup, safe=False)
示例2: coordinator_parameters
# 需要导入模块: from oozie.models2 import Coordinator [as 别名]
# 或者: from oozie.models2.Coordinator import find_all_parameters [as 别名]
def coordinator_parameters(request):
response = {'status': -1}
try:
coordinator = Coordinator(document=Document2.objects.get(type='oozie-coordinator2', uuid=request.GET.get('uuid')))
response['status'] = 0
response['parameters'] = coordinator.find_all_parameters(with_lib_path=False)
except Exception, e:
response['message'] = str(e)