class_docstr: Handle requests for the dump/ REST endpoint
docstr: Handle the POST requests for load/
docstr_tok: ["Handle","the","POST","requests","for","load\/"]
code: def on_post_load(self, req: Request, resp: Response):
      """Handle the POST requests for load/"""
      if (
          self.current_task is not None
          and not self.current_task.is_completed()
      ):
          raise falcon.HTTPForbidden(
              description="An import is already running"
          )
      load_host = None
      resolve = None
      name = None
      version = None
      for part in req.get_media():
          if part.name == "file":
              if part.filename:
                  load_host = generate_temporary_file(basename="load")
                  with open(load_host, "wb") as dst:
                      part.stream.pipe(dst)
          elif part.name == "resolve":
              resolve = part.get_text().strip()
              if resolve not in ("ignore", "overwrite", "bump"):
                  raise falcon.HTTPInvalidParam(
                      "Invalid value for resolve", "resolve"
                  )
          elif part.name == "name":
              name = part.get_text().strip() or None
          elif part.name == "version":
              version = part.get_text().strip()
              if version:
                  try:
                      version = int(version)
                  except ValueError:
                      raise falcon.HTTPInvalidParam(
                          "Version must be an integer", "version"
                      )
                  if version < 0:
                      raise falcon.HTTPInvalidParam(
                          "Version must be a positiver integer",
                          "version",
                      )
              else:
                  version = None
          else:
              raise falcon.HTTPInvalidParam(
                  "Unknown parameter", part.name
              )
      if load_host is None:
          raise falcon.HTTPInvalidParam(
              "Missing file to import", "file"
          )
      if resolve is None:
          raise falcon.HTTPInvalidParam(
              "Missing resolve policy", "resolve"
          )
      self.current_task = ImportTask()
      p = multiprocessing.Process(
          target=_import_data,
          args=(
              self.current_task,
              self.storage,
              load_host,
              resolve,
              name,
              version,
          ),
      )
      p.start()
      resp.body = json.dumps({"task": self.current_task.task_id})
  
imports: import json
  import logging
  import multiprocessing
  import os
  import traceback
  import uuid
  from datetime import datetime
  from queue import Empty
  import falcon
  from falcon import Request, Response
  from orion.core.io.database import DatabaseError
  from orion.core.utils import generate_temporary_file
  from orion.storage.backup import dump_database, load_database
label_desc: Use image node_id 3 for calling the StorageResource obj's underlying member method code with example usage: obj.on_post_load(req, resp) without return types