def Render(self, args, token=None):

    # We only create generic hunts with /hunts/create requests.
    args.hunt_runner_args.hunt_name = "GenericHunt"

    # Anyone can create the hunt but it will be created in the paused
    # state. Permissions are required to actually start it.
    with implementation.GRRHunt.StartHunt(
        runner_args=args.hunt_runner_args,
        args=args.hunt_args,
        token=token) as hunt:

      # Nothing really to do here - hunts are always created in the paused
      # state.
      logging.info("User %s created a new %s hunt (%s)",
                   token.username, hunt.state.args.flow_runner_args.flow_name,
                   hunt.urn)

      return dict(
          status="OK",
          hunt_id=api_value_renderers.RenderValue(hunt.urn),
          hunt_args=api_value_renderers.RenderValue(hunt.state.args),
          hunt_runner_args=api_value_renderers.RenderValue(hunt.runner.args))
Creates a new hunt.
dataset/ETHPy150Open google/grr/grr/gui/api_plugins/hunt.py/ApiCreateHuntHandler.Render