Example #1
0
def create_handlers_map():
    """Create new handlers map.

  Returns:
    list of (regexp, handler) pairs for WSGIApplication constructor.
  """
    pipeline_handlers_map = []

    if pipeline:
        pipeline_handlers_map = pipeline.create_handlers_map(
            prefix=".*/pipeline")

    return pipeline_handlers_map + [
        (r".*/worker_callback.*", handlers.MapperWorkerCallbackHandler),
        (r".*/controller_callback.*", handlers.ControllerCallbackHandler),
        (r".*/kickoffjob_callback.*", handlers.KickOffJobHandler),
        (r".*/finalizejob_callback.*", handlers.FinalizeJobHandler),
        (r".*/command/start_job", handlers.StartJobHandler),
        (r".*/command/cleanup_job", handlers.CleanUpJobHandler),
        (r".*/command/abort_job", handlers.AbortJobHandler),
        (r".*/command/list_configs", status.ListConfigsHandler),
        (r".*/command/list_jobs", status.ListJobsHandler),
        (r".*/command/get_job_detail", status.GetJobDetailHandler),
        (STATIC_RE, status.ResourceHandler),
        (r".*", RedirectHandler),
    ]
Example #2
0
def create_handlers_map():
  """Create new handlers map.

  Returns:
    list of (regexp, handler) pairs for WSGIApplication constructor.
  """
  pipeline_handlers_map = []

  if pipeline:
    pipeline_handlers_map = pipeline.create_handlers_map(prefix=".*/pipeline")

  return pipeline_handlers_map + [

      (r".*/worker_callback", handlers.MapperWorkerCallbackHandler),
      (r".*/controller_callback", handlers.ControllerCallbackHandler),
      (r".*/kickoffjob_callback", handlers.KickOffJobHandler),
      (r".*/finalizejob_callback", handlers.FinalizeJobHandler),



      (r".*/command/start_job", handlers.StartJobHandler),
      (r".*/command/cleanup_job", handlers.CleanUpJobHandler),
      (r".*/command/abort_job", handlers.AbortJobHandler),
      (r".*/command/list_configs", status.ListConfigsHandler),
      (r".*/command/list_jobs", status.ListJobsHandler),
      (r".*/command/get_job_detail", status.GetJobDetailHandler),


      (STATIC_RE, status.ResourceHandler),


      (r".*", RedirectHandler),
      ]