parameters: (
      *,
      job_id: int = Path(..., title="The ID of job to delete", ge=1),
      response: Response,
      current_user: User = Depends(get_current_user),
  )
return_statement: return {"message": "Job %d succesfully deleted." % job_id}
docstring: Delete job record from catalog
docstring_summary: Delete job record from catalog
docstring_tokens: Delete job record from catalog
function: def delete_job(
      *,
      job_id: int = Path(..., title="The ID of job to delete", ge=1),
      response: Response,
      current_user: User = Depends(get_current_user),
  ):
      """
      Delete job record from catalog
      """
      # Director gives no success nor failed information
      # We implemente validation here (check if job exists before and after deletion)
      jobStatusResponse = read_job_status(
          job_id=job_id, response=response, current_user=current_user
      )
      if not "jobid" in jobStatusResponse:
          response.status_code = 404
          return {
              "message": "No job with id %d found on director %s."
              % (job_id, current_user.directorName)
          }
      # delete a specific job record given bei jobid
      deleteCommand = "delete jobid=%d" % job_id
      try:
          result = current_user.jsonDirector.call(deleteCommand)
      except Exception as e:
          response.status_code = 500
          return {
              "message": "Could not delete jobid %d on director %s. Message: '%s'"
              % (job_id, current_identity.directorName, e)
          }
      jobStatusResponse = read_job_status(
          job_id=job_id, response=response, current_user=current_user
      )
      if "jobid" in jobStatusResponse:
          response.status_code = 500
          return {
              "message": "Job with id %d still exists on director %s. Delete failed"
              % (job_id, current_user.directorName)
          }
      response.status_code = 200
      return {"message": "Job %d succesfully deleted." % job_id}
function_tokens: def delete_job ( * , job_id : int = Path ( ... , title = "The ID of job to delete" , ge = 1 ) , response : Response , current_user : User = Depends ( get_current_user ) , ) : # Director gives no success nor failed information # We implemente validation here (check if job exists before and after deletion) jobStatusResponse = read_job_status ( job_id = job_id , response = response , current_user = current_user ) if not "jobid" in jobStatusResponse : response . status_code = 404 return { "message" : "No job with id %d found on director %s." % ( job_id , current_user . directorName ) } # delete a specific job record given bei jobid deleteCommand = "delete jobid=%d" % job_id try : result = current_user . jsonDirector . call ( deleteCommand ) except Exception as e : response . status_code = 500 return { "message" : "Could not delete jobid %d on director %s. Message: '%s'" % ( job_id , current_identity . directorName , e ) } jobStatusResponse = read_job_status ( job_id = job_id , response = response , current_user = current_user ) if "jobid" in jobStatusResponse : response . status_code = 500 return { "message" : "Job with id %d still exists on director %s. Delete failed" % ( job_id , current_user . directorName ) } response . status_code = 200 return { "message" : "Job %d succesfully deleted." % job_id }