parameters: ()
return_statement: return util.response_success()
docstring: Save a compiled bot to object storage.
docstring_summary: Save a compiled bot to object storage.
docstring_tokens: Save a compiled bot to object storage .
function: def upload_bot():
      """Save a compiled bot to object storage."""
      user_id = flask.request.form.get("user_id", None)
      bot_id = flask.request.form.get("bot_id", None)
  
      if "bot.zip" not in flask.request.files:
          raise util.APIError(400, message="Please provide the bot file.")
  
      uploaded_file = flask.request.files["bot.zip"]
      # Save to GCloud
      blob = gcloud_storage.Blob("{}_{}".format(user_id, bot_id),
                                 model.get_bot_bucket(),
                                 chunk_size=262144)
      blob.upload_from_file(uploaded_file)
      return util.response_success()
function_tokens: def upload_bot ( ) : user_id = flask . request . form . get ( "user_id" , None ) bot_id = flask . request . form . get ( "bot_id" , None ) if "bot.zip" not in flask . request . files : raise util . APIError ( 400 , message = "Please provide the bot file." ) uploaded_file = flask . request . files [ "bot.zip" ] # Save to GCloud blob = gcloud_storage . Blob ( "{}_{}" . format ( user_id , bot_id ) , model . get_bot_bucket ( ) , chunk_size = 262144 ) blob . upload_from_file ( uploaded_file ) return util . response_success ( )