python/dna/apy/worker.py
def get(self, worker_id):
        ''' Return status report '''
        code = 200

        if worker_id == 'all':
            report = {'workers': [{
                'id': job,
                'report': self._inspect_worker(job)}
                for job in self.jobs]
            }

        elif worker_id in self.jobs:
            report = {
                'id': worker_id,
                'report': self._inspect_worker(worker_id)
            }

        else:
            report = {'error': 'job {} unknown'.format(worker_id)}
            code = 404

        return flask.jsonify(report), code
def get(self, worker_id):
        ''' Return status report '''
        code = 200

        if worker_id == 'all':
            report = {'workers': [{
                'id': job,
                'report': self._inspect_worker(job)}
                for job in self.jobs]
            }

        elif worker_id in self.jobs:
            report = {
                'id': worker_id,
                'report': self._inspect_worker(worker_id)
            }

        else:
            report = {'error': 'job {} unknown'.format(worker_id)}
            code = 404

        return flask.jsonify(report), code
def get ( self , worker_id ) : code = 200 if worker_id == 'all' : report = { 'workers' : [ { 'id' : job , 'report' : self . _inspect_worker ( job ) } for job in self . jobs ] } elif worker_id in self . jobs : report = { 'id' : worker_id , 'report' : self . _inspect_worker ( worker_id ) } else : report = { 'error' : 'job {} unknown' . format ( worker_id ) } code = 404 return flask . jsonify ( report ) , code
Return status report
Return status report