

def on_put(self, req, resp, session_id, job_id):
    '\n        add a job to a session\n\n        :param req:\n        :param resp:\n        :param session_id:\n        :param job_id:\n        :return:\n        '
    user_id = req.get_header('X-User-ID', '')
    job_doc = self.db.get_job(user_id=user_id, job_id=job_id)
    job_schedule = job_doc.get('job_schedule', {
        
    })
    session_update_doc = {
        'jobs': {
            job_id: {
                'client_id': job_doc['client_id'],
                'status': job_schedule.get('status', ''),
                'result': job_schedule.get('result', ''),
                'time_started': job_schedule.get('time_started', ''),
                'time_ended': job_schedule.get('time_ended', ''),
            },
        },
    }
    self.db.update_session(user_id=user_id, session_id=session_id, patch_doc=session_update_doc)
    session_doc = self.db.get_session(user_id=user_id, session_id=session_id)
    job_update_doc = {
        'session_id': session_id,
        'session_tag': session_doc['session_tag'],
        'job_schedule': session_doc['schedule'],
    }
    self.db.update_job(user_id=user_id, job_id=job_id, patch_doc=job_update_doc)
    resp.status = falcon.HTTP_204

dataset/ETHPy150Open openstack/freezer-api/freezer_api/api/v1/sessions.py SessionsJob.on_put/original