def app(self, appid): oozie_api = get_oozie(self.user) coordinator = oozie_api.get_coordinator(jobid=appid) request = MockDjangoRequest(self.user, get=MockGet()) response = list_oozie_coordinator(request, job_id=appid) common = { 'id': coordinator.coordJobId, 'name': coordinator.coordJobName, 'status': coordinator.status, 'apiStatus': self._api_status(coordinator.status), 'progress': coordinator.get_progress(), 'type': 'schedule', 'submitted': format_time(coordinator.startTime), 'user': coordinator.user, 'canWrite': has_job_edition_permission(coordinator, self.user), } common['properties'] = json.loads(response.content) for action in common['properties']['actions']: action['apiStatus'] = self._task_api_status(action['status']) common['properties']['tasks'] = common['properties']['actions'] common['properties']['xml'] = '' common['properties']['properties'] = '' common['properties']['bundle_id'] = coordinator.conf_dict.get( 'oozie.bundle.id') common['doc_url'] = common['properties'].get('doc_url') return common
def app(self, appid): oozie_api = get_oozie(self.user) coordinator = oozie_api.get_coordinator(jobid=appid) request = MockDjangoRequest(self.user, get=MockGet()) response = list_oozie_coordinator(request, job_id=appid) common = { 'id': coordinator.coordJobId, 'name': coordinator.coordJobName, 'status': coordinator.status, 'apiStatus': self._api_status(coordinator.status), 'progress': coordinator.get_progress(), 'type': 'schedule', 'submitted': format_time(coordinator.startTime), 'user': coordinator.user, 'canWrite': has_job_edition_permission(coordinator, self.user), } common['properties'] = json.loads(response.content) for action in common['properties']['actions']: action['apiStatus'] = self._task_api_status(action['status']) common['properties']['tasks'] = common['properties']['actions'] common['properties']['xml'] = '' common['properties']['properties'] = '' common['properties']['bundle_id'] = coordinator.conf_dict.get('oozie.bundle.id') common['doc_url'] = common['properties'].get('doc_url') return common
def app(self, appid): if '@' in appid: return WorkflowActionApi(self.user).app(appid) oozie_api = get_oozie(self.user) workflow = oozie_api.get_job(jobid=appid) common = { 'id': workflow.id, 'name': workflow.appName, 'status': workflow.status, 'apiStatus': self._api_status(workflow.status), 'progress': workflow.get_progress(), 'type': 'workflow', 'user': workflow.user, 'duration': workflow.durationTime, 'submitted': workflow.submissionTime * 1000, 'canWrite': has_job_edition_permission(workflow, self.user), } request = MockDjangoRequest(self.user) response = list_oozie_workflow(request, job_id=appid) common['properties'] = json.loads(response.content) common['properties']['xml'] = '' common['properties']['properties'] = '' common['properties']['coordinator_id'] = workflow.get_parent_job_id() common['properties']['bundle_id'] = workflow.conf_dict.get( 'oozie.bundle.id') common['properties']['parameters'] = self._get_variables(workflow) common['doc_url'] = common['properties'].get('doc_url') return common
def app(self, appid): if '@' in appid: return WorkflowActionApi(self.user).app(appid) oozie_api = get_oozie(self.user) workflow = oozie_api.get_job(jobid=appid) common = { 'id': workflow.id, 'name': workflow.appName, 'status': workflow.status, 'apiStatus': self._api_status(workflow.status), 'progress': workflow.get_progress(), 'type': 'workflow', 'user': workflow.user, 'duration': workflow.durationTime, 'submitted': workflow.submissionTime * 1000, 'canWrite': has_job_edition_permission(workflow, self.user), } request = MockDjangoRequest(self.user) response = list_oozie_workflow(request, job_id=appid) common['properties'] = json.loads(response.content) common['properties']['xml'] = '' common['properties']['properties'] = '' common['properties']['coordinator_id'] = workflow.get_parent_job_id() common['properties']['bundle_id'] = workflow.conf_dict.get('oozie.bundle.id') common['properties']['parameters'] = self._get_variables(workflow) common['doc_url'] = common['properties'].get('doc_url') return common