def __init__(self, request, *args, **kwargs):
        super(JobConfigAction, self).__init__(request, *args, **kwargs)
        job_ex_id = request.REQUEST.get("job_execution_id")
        if job_ex_id is not None:
            job_ex_id = request.REQUEST.get("job_execution_id")
            job_ex = saharaclient.job_execution_get(request, job_ex_id)
            job_configs = job_ex.job_configs
            edp_configs = {}

            if 'configs' in job_configs:
                configs, edp_configs = (
                    self.clean_edp_configs(job_configs['configs']))
                self.fields['job_configs'].initial = (
                    json.dumps(configs))

            if 'params' in job_configs:
                self.fields['job_params'].initial = (
                    json.dumps(job_configs['params']))
            job_args = json.dumps(job_configs['args'])
            self.fields['job_args_array'].initial = job_args

            if self.MAIN_CLASS in edp_configs:
                self.fields['main_class'].initial = (
                    edp_configs[self.MAIN_CLASS])
            if self.JAVA_OPTS in edp_configs:
                self.fields['java_opts'].initial = (
                    edp_configs[self.JAVA_OPTS])

            if self.EDP_MAPPER in edp_configs:
                self.fields['streaming_mapper'].initial = (
                    edp_configs[self.EDP_MAPPER])
            if self.EDP_REDUCER in edp_configs:
                self.fields['streaming_reducer'].initial = (
                    edp_configs[self.EDP_REDUCER])
Example #2
0
    def __init__(self, request, *args, **kwargs):
        super(JobConfigAction, self).__init__(request, *args, **kwargs)
        job_ex_id = request.REQUEST.get("job_execution_id")
        if job_ex_id is not None:
            job_ex_id = request.REQUEST.get("job_execution_id")
            job_ex = saharaclient.job_execution_get(request, job_ex_id)
            job_configs = job_ex.job_configs
            edp_configs = {}

            if "configs" in job_configs:
                configs, edp_configs = self.clean_edp_configs(job_configs["configs"])
                self.fields["job_configs"].initial = json.dumps(configs)

            if "params" in job_configs:
                self.fields["job_params"].initial = json.dumps(job_configs["params"])

            if "args" in job_configs:
                self.fields["job_args_array"].initial = json.dumps(job_configs["args"])

            if self.MAIN_CLASS in edp_configs:
                self.fields["main_class"].initial = edp_configs[self.MAIN_CLASS]
            if self.JAVA_OPTS in edp_configs:
                self.fields["java_opts"].initial = edp_configs[self.JAVA_OPTS]

            if self.EDP_MAPPER in edp_configs:
                self.fields["streaming_mapper"].initial = edp_configs[self.EDP_MAPPER]
            if self.EDP_REDUCER in edp_configs:
                self.fields["streaming_reducer"].initial = edp_configs[self.EDP_REDUCER]
            if self.EDP_HBASE_COMMON_LIB in edp_configs:
                self.fields["hbase_common_lib"].initial = edp_configs[self.EDP_HBASE_COMMON_LIB]
Example #3
0
    def get_context_data(self, request):
        job_execution_id = self.tab_group.kwargs['job_execution_id']
        job_execution = saharaclient.job_execution_get(request,
                                                       job_execution_id)
        object_names = self.get_object_names(job_execution, request)

        return {"job_execution": job_execution, "object_names": object_names}
Example #4
0
    def __init__(self, request, *args, **kwargs):
        super(JobConfigAction, self).__init__(request, *args, **kwargs)
        job_ex_id = request.REQUEST.get("job_execution_id")
        if job_ex_id is not None:
            job_ex_id = request.REQUEST.get("job_execution_id")
            job_ex = saharaclient.job_execution_get(request, job_ex_id)
            job_configs = job_ex.job_configs
            edp_configs = {}

            if 'configs' in job_configs:
                configs, edp_configs = (self.clean_edp_configs(
                    job_configs['configs']))
                self.fields['job_configs'].initial = (json.dumps(configs))

            if 'params' in job_configs:
                self.fields['job_params'].initial = (json.dumps(
                    job_configs['params']))
            job_args = json.dumps(job_configs['args'])
            self.fields['job_args_array'].initial = job_args

            if self.MAIN_CLASS in edp_configs:
                self.fields['main_class'].initial = (
                    edp_configs[self.MAIN_CLASS])
            if self.JAVA_OPTS in edp_configs:
                self.fields['java_opts'].initial = (
                    edp_configs[self.JAVA_OPTS])

            if self.EDP_MAPPER in edp_configs:
                self.fields['streaming_mapper'].initial = (
                    edp_configs[self.EDP_MAPPER])
            if self.EDP_REDUCER in edp_configs:
                self.fields['streaming_reducer'].initial = (
                    edp_configs[self.EDP_REDUCER])
Example #5
0
 def get_data(self, request, job_execution_id):
     try:
         return saharaclient.job_execution_get(request, job_execution_id)
     except api_base.APIException as e:
         if e.error_code == 404:
             raise Http404
         else:
             messages.error(request, _("Unable to update row"))
Example #6
0
 def get_data(self, request, job_execution_id):
     try:
         return saharaclient.job_execution_get(request, job_execution_id)
     except api_base.APIException as e:
         if e.error_code == 404:
             raise Http404
         else:
             messages.error(request, _("Unable to update row"))
Example #7
0
    def get_context_data(self, request):
        job_execution_id = self.tab_group.kwargs['job_execution_id']
        job_execution = saharaclient.job_execution_get(request,
                                                       job_execution_id)
        object_names = self.get_object_names(job_execution,
                                             request)

        return {"job_execution": job_execution,
                "object_names": object_names}
Example #8
0
 def get_object(self):
     jex_id = self.kwargs["job_execution_id"]
     try:
         return saharaclient.job_execution_get(self.request, jex_id)
     except Exception:
         msg = _('Unable to retrieve details for job "%s".') % jex_id
         redirect = reverse("horizon:project:data_processing."
                            "job_executions:job-executions")
         exceptions.handle(self.request, msg, redirect=redirect)
Example #9
0
    def get_context_data(self, request):
        jex_id = self.tab_group.kwargs['job_execution_id']
        try:
            job_execution = saharaclient.job_execution_get(request, jex_id)
        except Exception as e:
            job_execution = {}
            LOG.error("Unable to fetch job details: %s" % str(e))
            return {"job_execution": job_execution}
        object_names = self.get_object_names(job_execution, request)

        return {"job_execution": job_execution, "object_names": object_names}
Example #10
0
    def get_context_data(self, request):
        job_execution_id = self.tab_group.kwargs['job_execution_id']
        job_execution = saharaclient.job_execution_get(request,
                                                       job_execution_id)
        object_names = self.get_object_names(job_execution,
                                             request)
        object_names['input_url'] = job_execution.data_source_urls.get(
            job_execution.input_id)
        object_names['output_url'] = job_execution.data_source_urls.get(
            job_execution.output_id)

        return {"job_execution": job_execution,
                "object_names": object_names}
Example #11
0
    def get_context_data(self, request):
        jex_id = self.tab_group.kwargs['job_execution_id']
        try:
            job_execution = saharaclient.job_execution_get(request, jex_id)
        except Exception as e:
            job_execution = {}
            LOG.error("Unable to fetch job details: %s" % str(e))
            return {"job_execution": job_execution}
        object_names = self.get_object_names(job_execution,
                                             request)

        return {"job_execution": job_execution,
                "object_names": object_names}
Example #12
0
    def __init__(self, request, *args, **kwargs):
        super(JobConfigAction, self).__init__(request, *args, **kwargs)
        job_ex_id = request.REQUEST.get("job_execution_id")
        if job_ex_id is not None:
            job_ex_id = request.REQUEST.get("job_execution_id")
            job_ex = saharaclient.job_execution_get(request, job_ex_id)
            job_configs = job_ex.job_configs
            edp_configs = {}

            if 'configs' in job_configs:
                configs, edp_configs = (
                    self.clean_edp_configs(job_configs['configs']))
                self.fields['job_configs'].initial = (
                    json.dumps(configs))

            if 'params' in job_configs:
                self.fields['job_params'].initial = (
                    json.dumps(job_configs['params']))

            if 'args' in job_configs:
                self.fields['job_args_array'].initial = (
                    json.dumps(job_configs['args']))

            if self.MAIN_CLASS in edp_configs:
                self.fields['main_class'].initial = (
                    edp_configs[self.MAIN_CLASS])
            if self.JAVA_OPTS in edp_configs:
                self.fields['java_opts'].initial = (
                    edp_configs[self.JAVA_OPTS])

            if self.EDP_MAPPER in edp_configs:
                self.fields['streaming_mapper'].initial = (
                    edp_configs[self.EDP_MAPPER])
            if self.EDP_REDUCER in edp_configs:
                self.fields['streaming_reducer'].initial = (
                    edp_configs[self.EDP_REDUCER])
            if self.EDP_HBASE_COMMON_LIB in edp_configs:
                self.fields['hbase_common_lib'].initial = (
                    edp_configs[self.EDP_HBASE_COMMON_LIB])
            if self.EDP_ADAPT_FOR_OOZIE in edp_configs:
                self.fields['adapt_oozie'].initial = (
                    edp_configs[self.EDP_ADAPT_FOR_OOZIE])
            if self.EDP_ADAPT_SPARK_SWIFT in edp_configs:
                self.fields['adapt_spark_swift'].initial = (
                    edp_configs[self.EDP_ADAPT_SPARK_SWIFT])
    def __init__(self, request, *args, **kwargs):
        super(SelectHadoopPluginAction, self).__init__(request,
                                                       *args,
                                                       **kwargs)
        self.fields["job_id"] = forms.ChoiceField(
            label=_("Plugin name"),
            initial=request.GET.get("job_id") or request.POST.get("job_id"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        self.fields["job_configs"] = forms.ChoiceField(
            label=_("Job configs"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        self.fields["job_args"] = forms.ChoiceField(
            label=_("Job args"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        self.fields["job_params"] = forms.ChoiceField(
            label=_("Job params"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        job_ex_id = request.REQUEST.get("job_execution_id")
        if job_ex_id is not None:
            self.fields["job_execution_id"] = forms.ChoiceField(
                label=_("Job Execution ID"),
                initial=request.REQUEST.get("job_execution_id"),
                widget=forms.HiddenInput(
                    attrs={"class": "hidden_create_field"}))

            job_ex_id = request.REQUEST.get("job_execution_id")
            job_configs = (
                saharaclient.job_execution_get(request,
                                               job_ex_id).job_configs)

            if "configs" in job_configs:
                self.fields["job_configs"].initial = (
                    json.dumps(job_configs["configs"]))
            if "params" in job_configs:
                self.fields["job_params"].initial = (
                    json.dumps(job_configs["params"]))
            if "args" in job_configs:
                self.fields["job_args"].initial = (
                    json.dumps(job_configs["args"]))
    def __init__(self, request, *args, **kwargs):
        super(SelectHadoopPluginAction, self).__init__(request,
                                                       *args,
                                                       **kwargs)
        self.fields["job_id"] = forms.ChoiceField(
            label=_("Plugin name"),
            initial=request.GET.get("job_id") or request.POST.get("job_id"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        self.fields["job_configs"] = forms.ChoiceField(
            label=_("Job configs"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        self.fields["job_args"] = forms.ChoiceField(
            label=_("Job args"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        self.fields["job_params"] = forms.ChoiceField(
            label=_("Job params"),
            widget=forms.HiddenInput(attrs={"class": "hidden_create_field"}))

        job_ex_id = request.REQUEST.get("job_execution_id")
        if job_ex_id is not None:
            self.fields["job_execution_id"] = forms.ChoiceField(
                label=_("Job Execution ID"),
                initial=request.REQUEST.get("job_execution_id"),
                widget=forms.HiddenInput(
                    attrs={"class": "hidden_create_field"}))

            job_ex_id = request.REQUEST.get("job_execution_id")
            job_configs = (
                saharaclient.job_execution_get(request,
                                               job_ex_id).job_configs)

            if "configs" in job_configs:
                self.fields["job_configs"].initial = (
                    json.dumps(job_configs["configs"]))
            if "params" in job_configs:
                self.fields["job_params"].initial = (
                    json.dumps(job_configs["params"]))
            if "args" in job_configs:
                self.fields["job_args"].initial = (
                    json.dumps(job_configs["args"]))
Example #15
0
 def get_data(self, request, job_execution_id):
     job_execution = saharaclient.job_execution_get(request,
                                                    job_execution_id)
     return job_execution
Example #16
0
 def get_data(self, request, job_execution_id):
     job_execution = saharaclient.job_execution_get(request,
                                                    job_execution_id)
     return job_execution