291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
|
# File 'lib/cnvrg/datafiles.rb', line 291
def upload_log_file(absolute_path, relative_path, log_date)
file_name = File.basename relative_path
file_size = File.size(absolute_path).to_f
content_type = "text/x-log"
upload_resp = Cnvrg::API.request("/users/#{@owner}/" + "upload_cli_log", 'POST_FILE', {absolute_path: absolute_path, relative_path: relative_path,
file_name: file_name, log_date: log_date,
file_size: file_size, file_content_type: content_type})
if Cnvrg::CLI.is_response_success(upload_resp, false)
path = upload_resp["result"]["path"]
s3_res = upload_small_files_s3(path, absolute_path, "text/plain")
end
if s3_res
return true
end
return false
end
|