def get_coordinator(self, jobid, actions_offset=1): params = self._get_params() params.update({'offset': actions_offset}) params.update({'len': ACTIONS_PER_PAGE}) params.update({'order': 'desc'}) resp = self._root.get('job/%s' % (jobid, ), params) return Coordinator(self, resp)
def aggregate_coordinator_instances(): dates = [ '1', '2', '3', '6', '7', '8', '10', '12', '15', '16', '20', '23', '30', '40' ] assert_equal([ '1-3', '6-8', '10-10', '12-12', '15-16', '20-20', '23-23', '30-30', '40-40' ], Coordinator.aggreate(dates))
def get_coordinator(self, jobid, offset=None, cnt=None, filters=None): params = self._get_params() if offset is not None: params['offset'] = str(offset) if cnt is not None: params['len'] = str(cnt) if filters is None: filters = {} params.update({'order': 'desc'}) filter_list = [] for key, val in filters: if key not in OozieApi.VALID_JOB_FILTERS: raise ValueError('"%s" is not a valid filter for selecting jobs' % (key,)) filter_list.append('%s=%s' % (key, val)) params['filter'] = ';'.join(filter_list) resp = self._root.get('job/%s' % (jobid,), params) return Coordinator(self, resp)
def aggregate_coordinator_instances(): dates = ['1', '2', '3', '6', '7', '8', '10', '12', '15', '16', '20', '23', '30', '40'] assert_equal(['1-3', '6-8', '10-10', '12-12', '15-16', '20-20', '23-23', '30-30', '40-40'], Coordinator.aggreate(dates))
def get_coordinator(self, jobid): params = self._get_params() params.update({'len': -1}) resp = self._root.get('job/%s' % (jobid, ), params) return Coordinator(self, resp)
def get_coordinator(self, jobid): params = self._get_params() resp = self._root.get('job/%s' % (jobid, ), params) return Coordinator(self, resp)