lib/imperituroard/projects/iot/mongoconnector.rb in imperituroard-1.1.17 vs lib/imperituroard/projects/iot/mongoconnector.rb in imperituroard-1.1.18
- old
+ new
@@ -64,9 +64,34 @@
end
internal_func.printer_texter(out_resp, "debug")
out_resp
end
+ def audit_spa_logger(proc_name, url_str, input_json, output_json)
+ out_resp = {}
+ p "iiiiiiiot"
+ p input_json
+ begin
+ current = internal_func.datetimenow
+ collection = client[:audit_spa]
+ doc = {
+ :proc_name => proc_name,
+ :date => current,
+ :url => url_str,
+ :iot_platform_request => input_json,
+ :iot_platform_responce => output_json
+ }
+ p doc
+ result = collection.insert_one(doc)
+ out_resp = {:code => 200, :result => "audit_logger: Request completed successfully", :body => result}
+ rescue
+ out_resp = {:code => 507, :result => "audit_logger: Unknown SDK error"}
+ end
+ internal_func.printer_texter(out_resp, "debug")
+ out_resp
+ end
+
+
#:code => 507, :result => "Unknown SDK error"
#{:code => 200, :result => "Request completed successfully", :body => result_ps}
def get_profiles_by_login(login)
out_resp = {}
begin