imperituroard 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dae0092e4f87b047adb62157ee51cb3e917bc3d7
4
- data.tar.gz: be638036010d680252df866b5b09fb49bddd6628
3
+ metadata.gz: d07f8ba8173fac1753c044f8f0e6e06a6598e7b5
4
+ data.tar.gz: 3170f430dec13119ba8ba95de2224b54cdc35d1e
5
5
  SHA512:
6
- metadata.gz: a0e130dbe846d930dfe7da4a6290f76e4c1f6326e944ea4dbc693bafe90b9087ee4915e0e08dd83c346fb35c6a0ea68ce88ce5f690db27e47ab6b82e1ffaa3c6
7
- data.tar.gz: f9c6ffd509148ae09d85fc4aac1439686612283d735fc020f3e45d76fd62e94d41b938d6a033fd93be6e2221612009b66d8a8da948e64fd32e0ee0c252baa93f
6
+ metadata.gz: fbb564b3afc160a77cc9b8e9e0dffb2675b5a89cfc9e7042ca62348aa29cd0057428c35090066ab80db51dbe3b2ee466817fb9a5f882a2cc5fe4082a0bbac184
7
+ data.tar.gz: 7ac4309248422d5d326b1e9c5ad98d1595ec79bc6f3e51bb9ae31632225e465b7b4677d201f149c32004c72b897e7c182d61e143be863ec63d70c311d9e2a59f
@@ -168,6 +168,10 @@ class Iot
168
168
  iot_connector.add_device_to_prof_2(login, imei_list, real_ip, remote_ip)
169
169
  end
170
170
 
171
+ def add_device_to_profile2(request_f, real_ip, remote_ip)
172
+ iot_connector.add_device_to_prof2_2(request_f, real_ip, remote_ip)
173
+ end
174
+
171
175
 
172
176
  #!!2 Find device (only mongo datebase. IOT platform not need)
173
177
  # procedure for data selection from mongo database.
@@ -270,10 +274,19 @@ class Iot
270
274
  mongo_client.audit_logger(proc_name, src_ip, input_json, output_json, real_ip)
271
275
  end
272
276
 
277
+
278
+ ####################################################################
279
+ #######technological procedures
280
+ ####################################################################
281
+ def delete_all_iot_device_in_db
282
+ iot_connector.delete_all_devices_in_database
283
+ end
284
+
273
285
  def test111
274
286
  iot_connector.test1278493
275
287
  end
276
288
 
289
+
277
290
  end
278
291
 
279
292
 
@@ -209,7 +209,167 @@ class IotFunctions_2
209
209
  thr1.join
210
210
 
211
211
  resp_out[:body][:tosoapgw] = internal_func.iot_create_dev_soapgw_answer(input_json, resp_out)
212
- mongo_client.audit_logger("add_device_to_profile", remote_ip, input_json, resp_out, real_ip)
212
+ mongo_client.audit_logger("add_device_to_profile", remote_ip, input_json, resp_out, real_ip, {})
213
+ resp_out
214
+ end
215
+
216
+
217
+
218
+ def add_device_to_prof2_2(request_full, real_ip, remote_ip)
219
+
220
+ #{"autorization"=>{"login"=>"test", "token"=>"tE3aFvs27"}, "devlist"=>[{"devices"=>{"imei"=>123419520034999, "type"=>"1000002", "profile"=>0}}]}
221
+
222
+ login = request_full["autorization"]["login"]
223
+
224
+ im_li =[]
225
+
226
+ for sd in request_full["devlist"]
227
+ im_li.append(sd["devices"])
228
+ end
229
+ imei_list = im_li
230
+
231
+ input_json = {:request_full => request_full}
232
+ resp_out = {}
233
+ begin
234
+
235
+ thr1 = Thread.new do
236
+ if add_functions_connector.check_input_1(login, imei_list)[:code]==200
237
+
238
+ imei = []
239
+ list1 = {}
240
+ for_insert = []
241
+ not_processed_list = []
242
+ processed_list = []
243
+
244
+ for ii in imei_list
245
+ valid_resp = internal_func.imei_validate(ii["imei"])
246
+ if valid_resp[:checked]
247
+ list1[ii["imei"]] = ii
248
+ imei.append(ii["imei"])
249
+ else
250
+ not_processed_list.append({:imei => ii["imei"], :error => valid_resp[:result]})
251
+ end
252
+ end
253
+
254
+ if imei != []
255
+ list_checked = mongo_client.check_imei_exists(imei)
256
+
257
+ for ss in list_checked[:body][:exists]
258
+ not_processed_list.append({:imei => ss, :error => "Device exists in database"})
259
+ p ss
260
+ p "ss"
261
+ p list_checked
262
+ end
263
+
264
+ for jj in list_checked[:body][:not_exists]
265
+ begin
266
+ get_login_info = mongo_client.check_login_prof_perm_id_one(login, list1[jj]["profile"])[:code]
267
+ if get_login_info==200
268
+ for_insert.append(list1[jj])
269
+ else
270
+ not_processed_list.append({:imei => list1[jj], :error => "Permission denied for this profile"})
271
+ end
272
+ rescue
273
+ not_processed_list.append({:imei => list1[jj], :error => "Unknown error"})
274
+ end
275
+ end
276
+ end
277
+
278
+ begin
279
+ added_on_iot_platf = []
280
+ if for_insert != []
281
+ ##Logic for IOT Platform connection###
282
+
283
+
284
+ for aaa in for_insert
285
+
286
+ #########change 2020.05.11. imperituroard
287
+ #########replace process for get iot app_id and password from users to profile
288
+
289
+ #credentials = mongo_client.get_iot_oceanconnect_credent(login)
290
+ credentials = mongo_client.get_iot_oceanconn_credent_2(aaa["profile"])
291
+
292
+ #########
293
+
294
+ if aaa.key?("type") && !aaa.key?("device_type")
295
+ aaa["device_type"] = aaa["type"]
296
+ aaa = internal_func.delete_key_hash(aaa, "type")
297
+ end
298
+
299
+ aaa = internal_func.hash_val_to_string(aaa)
300
+
301
+ if credentials[:code] == 200
302
+
303
+ begin
304
+ dev_name = aaa["imei"].to_s
305
+
306
+ #get {"model"=>"BGT_PPMC", "ManufacturerID"=>"unknown", "ManufacturerNAME"=>"unknown", "device_type"=>"unknown"}
307
+ #from database
308
+ model_data = mongo_client.get_device_type_info_universal(aaa["device_type"])
309
+ profile_data = mongo_client.get_profile_universal(aaa["profile"])
310
+ p profile_data
311
+ p model_data
312
+ p "model_data"
313
+ resss = hua_aceanconnect_connector.add_new_device_on_huawei(credentials[:body][:app_id],
314
+ credentials[:body][:secret],
315
+ aaa["imei"],
316
+ dev_name,
317
+ aaa["description"],
318
+ model_data[:body]["device_type"],
319
+ aaa["profile"],
320
+ model_data[:body]["ManufacturerID"],
321
+ model_data[:body]["ManufacturerNAME"],
322
+ model_data[:body]["model"]
323
+ )
324
+ if resss[:code]=="200"
325
+ if resss[:body].key?("error_code") && resss[:body]["error_code"] != 200
326
+ not_processed_list.append({:imei => aaa["imei"], :error => resss})
327
+ else
328
+ s1 = aaa
329
+ s1[:huadata] = resss
330
+ s1[:created] = DateTime.now
331
+ s1["device_type"] = model_data[:body]["model"]
332
+ s1["profile"] = profile_data["profile_id"]
333
+ added_on_iot_platf.append(s1)
334
+ end
335
+ else
336
+ not_processed_list.append({:imei => aaa["imei"], :error => resss})
337
+ end
338
+ rescue
339
+ not_processed_list.append({:imei => aaa["imei"], :error => "Unknown error with insertion imei on IOT platform"})
340
+ end
341
+ #########end iot platform logic#######
342
+
343
+ else
344
+ resss_err = {:code => 400, :result => "IOT platform credentials not found"}
345
+ not_processed_list.append({:imei => aaa["imei"], :error => resss_err})
346
+ end
347
+
348
+ end
349
+
350
+ if added_on_iot_platf.length != 0
351
+ mongo_client.imei_insert_list(added_on_iot_platf)
352
+ resp_out = {:code => 200, :result => "Data processed", :body => {:imei_processed => added_on_iot_platf, :error_list => not_processed_list}}
353
+ else
354
+ resp_out = {:code => 202, :result => "Empty list. Nothing for insertion", :body => {:imei_processed => added_on_iot_platf, :error_list => not_processed_list}}
355
+ end
356
+ else
357
+ resp_out = {:code => 202, :result => "Nothing for insertion", :body => {:imei_processed => added_on_iot_platf, :error_list => not_processed_list}}
358
+ end
359
+ rescue
360
+ resp_out = {:code => 505, :result => "Error with database communication"}
361
+ end
362
+ else
363
+ resp_out = {:code => 509, :result => "Input data invalid"}
364
+ end
365
+ end
366
+ rescue
367
+ resp_out = {:code => 507, :result => "Unknown SDK error"}
368
+ end
369
+ thr1.join
370
+
371
+ resp_out[:body][:tosoapgw] = internal_func.iot_create_dev_soapgw_answer(input_json, resp_out)
372
+ mongo_client.audit_logger("add_device_to_profile", remote_ip, input_json, resp_out, real_ip, {})
213
373
  resp_out
214
374
  end
215
375
 
@@ -272,7 +432,7 @@ class IotFunctions_2
272
432
 
273
433
  resp_out[:data][:tosoapgw] = add_functions_connector.iot_query_dev_soapgw_answer(input_json, resp_out)
274
434
 
275
- mongo_client.audit_logger("device_find", remote_ip, input_json, resp_out, real_ip)
435
+ mongo_client.audit_logger("device_find", remote_ip, input_json, resp_out, real_ip, {})
276
436
  resp_out
277
437
 
278
438
  end
@@ -444,7 +604,7 @@ class IotFunctions_2
444
604
  end
445
605
 
446
606
  thr3.join
447
- mongo_client.audit_logger("imei_replace", remote_ip, input_json, resp_out, real_ip)
607
+ mongo_client.audit_logger("imei_replace", remote_ip, input_json, resp_out, real_ip, {})
448
608
 
449
609
  resp_out
450
610
 
@@ -531,7 +691,7 @@ class IotFunctions_2
531
691
  resp_out = {:code => 507, :result => "Unknown SDK error"}
532
692
  end
533
693
  thr4.join
534
- mongo_client.audit_logger("device_remove", remote_ip, input_json, resp_out, real_ip)
694
+ mongo_client.audit_logger("device_remove", remote_ip, input_json, resp_out, real_ip, {})
535
695
  resp_out
536
696
  end
537
697
 
@@ -611,7 +771,7 @@ class IotFunctions_2
611
771
  resp_out = {:code => 507, :result => "Unknown SDK error"}
612
772
  end
613
773
  thr5.join
614
- mongo_client.audit_logger("device_add_address", remote_ip, input_json, resp_out, real_ip)
774
+ mongo_client.audit_logger("device_add_address", remote_ip, input_json, resp_out, real_ip, {})
615
775
  resp_out
616
776
  end
617
777
 
@@ -689,7 +849,7 @@ class IotFunctions_2
689
849
  resp_out = {:code => 507, :result => "Unknown SDK error"}
690
850
  end
691
851
  thr6.join
692
- mongo_client.audit_logger("device_remove", remote_ip, input_json, resp_out, real_ip)
852
+ mongo_client.audit_logger("device_remove", remote_ip, input_json, resp_out, real_ip, {})
693
853
  resp_out
694
854
  end
695
855
 
@@ -717,7 +877,7 @@ class IotFunctions_2
717
877
  end
718
878
  end
719
879
  thr7.join
720
- mongo_client.audit_logger("autorize_subscriber", remote_ip, input_json, resp_out, real_ip)
880
+ mongo_client.audit_logger("autorize_subscriber", remote_ip, input_json, resp_out, real_ip, {})
721
881
  resp_out
722
882
  end
723
883
 
@@ -775,7 +935,7 @@ class IotFunctions_2
775
935
  }
776
936
  resp_out = {:code => 507, :result => "Unknown SDK error", :body => {:tosoapgw => tosoapgw}}
777
937
  end
778
- mongo_client.audit_logger("get_available_prof_2", remote_ip, input_params, resp_out, real_ip)
938
+ mongo_client.audit_logger("get_available_prof_2", remote_ip, input_params, resp_out, real_ip, {})
779
939
  resp_out
780
940
  end
781
941
 
@@ -831,7 +991,7 @@ class IotFunctions_2
831
991
  }
832
992
  resp_out = {:code => 507, :result => "Unknown SDK error", :body => {:tosoapgw => tosoapgw}}
833
993
  end
834
- mongo_client.audit_logger("get_available_types_2", remote_ip, input_params, resp_out, real_ip)
994
+ mongo_client.audit_logger("get_available_types_2", remote_ip, input_params, resp_out, real_ip, {})
835
995
  resp_out
836
996
  end
837
997
 
@@ -902,7 +1062,7 @@ class IotFunctions_2
902
1062
  }
903
1063
  resp_out = {:code => 507, :result => "Unknown SDK error", :body => {:tosoapgw => tosoapgw}}
904
1064
  end
905
- mongo_client.audit_logger("get_available_types_2", remote_ip, input_params, resp_out, real_ip)
1065
+ mongo_client.audit_logger("get_available_types_2", remote_ip, input_params, resp_out, real_ip, {})
906
1066
  resp_out
907
1067
  end
908
1068
 
@@ -932,7 +1092,7 @@ class IotFunctions_2
932
1092
  rescue
933
1093
  output_answ = {:code => 507, :result => "Unknown SDK error"}
934
1094
  end
935
- mongo_client.audit_logger("get_info_data_type_2", remote_ip, input_params, output_answ, real_ip)
1095
+ mongo_client.audit_logger("get_info_data_type_2", remote_ip, input_params, output_answ, real_ip, {})
936
1096
  output_answ
937
1097
  end
938
1098
 
@@ -963,7 +1123,7 @@ class IotFunctions_2
963
1123
  rescue
964
1124
  output_answ = {:code => 507, :result => "Unknown SDK error"}
965
1125
  end
966
- mongo_client.audit_logger("get_info_data_profile_2", remote_ip, input_params, output_answ, real_ip)
1126
+ mongo_client.audit_logger("get_info_data_profile_2", remote_ip, input_params, output_answ, real_ip, {})
967
1127
  output_answ
968
1128
  end
969
1129
 
@@ -1139,7 +1299,7 @@ class IotFunctions_2
1139
1299
  thr13set.join
1140
1300
 
1141
1301
  output_answ = {:code => 200, :result => "Success", :body => {:to_soap_gw => answ_to_soapgw, :not_processed_list => not_processed_list, :processed_list => processed_list}}
1142
- mongo_client.audit_logger("set_data_replace_2", remote_ip, input_params, output_answ, real_ip)
1302
+ mongo_client.audit_logger("set_data_replace_2", remote_ip, input_params, output_answ, real_ip, {})
1143
1303
  output_answ
1144
1304
  end
1145
1305
 
@@ -1221,6 +1381,31 @@ class IotFunctions_2
1221
1381
  end
1222
1382
 
1223
1383
 
1384
+
1385
+
1386
+
1387
+
1388
+ ################################################
1389
+ ############technology procedures###############
1390
+ ################################################
1391
+
1392
+ def delete_all_devices_in_database
1393
+
1394
+ imei_list = []
1395
+ all_imei = mongo_client.get_all_imei_from_db
1396
+ all_imei[:body].each do |immm|
1397
+ imei_list.append(immm["imei"])
1398
+ end
1399
+
1400
+ imei_list.each do |del_imei|
1401
+ p del_imei
1402
+ self.device_remove_2("test", del_imei, "localhost", "localhost")
1403
+ end
1404
+ end
1405
+
1406
+
1407
+
1408
+
1224
1409
  #for internal use. Add new device model
1225
1410
  def add_model_to_mongo(model, manufacture_id, manufacture_name, device_type, description, note)
1226
1411
  model = {
@@ -25,6 +25,12 @@ class HuaIot
25
25
  @client_iot_mongo = MongoIot.new(mongo_ip, mongo_port, mongo_database)
26
26
  end
27
27
 
28
+ def valid_json?(json)
29
+ JSON.parse(json)
30
+ rescue JSON::ParserError => e
31
+ json
32
+ end
33
+
28
34
  def parse_token(str)
29
35
  begin
30
36
  dd = str.split(",")
@@ -79,7 +85,9 @@ class HuaIot
79
85
  p res.code
80
86
  p res.message
81
87
  p res.body.to_s
82
- out_resp = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
88
+
89
+ out_resp = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
90
+
83
91
  fff = {:func => "get_token",
84
92
  :iot_fun => "",
85
93
  :req_header => {:content_type => 'application/x-www-form-urlencoded',
@@ -120,7 +128,9 @@ class HuaIot
120
128
  request.content_type = 'application/json'
121
129
  request.body = URI.encode_www_form(data)
122
130
  res = https.request(request)
123
- out_resp = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
131
+ #JSON.parse(res.body.to_s)
132
+ out_resp = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s) }
133
+
124
134
  fff = {:func => "token_logout",
125
135
  :iot_fun => "logout",
126
136
  :platform => "Huawei oceanconnect"
@@ -157,7 +167,7 @@ class HuaIot
157
167
  data = {nodeId: node_id}
158
168
  request.body = data.to_json
159
169
  res = https.request(request)
160
- out_resp = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
170
+ out_resp = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
161
171
  fff = {:func => "dev_register_verif_code_mode",
162
172
  :iot_fun => "Registering a Directly Connected Device (Verification Code Mode) (V2)",
163
173
  :req_header => {:content_type => 'application/json',
@@ -195,7 +205,7 @@ class HuaIot
195
205
  internal_func.printer_texter({:procedure => "dev_register_passw_code_mode2", :data => {:body => data_out, :url => url_string}}, "debug")
196
206
  request.body = data_out.to_json
197
207
  res = https.request(request)
198
- out_resp = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
208
+ out_resp = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
199
209
  fff = {:func => "dev_register_passw_code_mode2",
200
210
  :iot_fun => "2.2.4",
201
211
  :req_header => {:authorization => 'Bearer ' + token,
@@ -230,7 +240,7 @@ class HuaIot
230
240
  request.body = data_out
231
241
  res = https.request(request)
232
242
  p res.body.to_s
233
- out_resp = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
243
+ out_resp = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
234
244
  fff = {:func => "dev_reg_passw_code_mode2_2",
235
245
  :iot_fun => "2.2.4",
236
246
  :req_header => {:content_type => 'application/json',
@@ -262,7 +272,7 @@ class HuaIot
262
272
  request['app_key'] = app_id
263
273
  res = https.request(request)
264
274
  if res.body != nil
265
- out_resp = {:code => res.code, :message => res.message, :body => {:answ => JSON.parse(res.body.to_s)}}
275
+ out_resp = {:code => res.code, :message => res.message, :body => {:answ => valid_json?(res.body.to_s)}}
266
276
  else
267
277
  out_resp = {:code => res.code, :message => res.message, :body => {:answ => "no data"}}
268
278
  end
@@ -303,7 +313,7 @@ class HuaIot
303
313
  res = https.request(request)
304
314
  p res.body.to_s
305
315
  p res.code
306
- {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
316
+ {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
307
317
  end
308
318
 
309
319
  #2.2.14 Querying Device Activation Status
@@ -323,7 +333,7 @@ class HuaIot
323
333
  request['Authorization'] = 'Bearer ' + token
324
334
  request['app_key'] = app_id
325
335
  res = https.request(request)
326
- output_ans = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
336
+ output_ans = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
327
337
  fff = {:func => "querying_device_activ_status",
328
338
  :iot_fun => "2.2.14",
329
339
  :req_header => {:content_type => 'application/json',
@@ -353,7 +363,7 @@ class HuaIot
353
363
  request['Authorization'] = 'Bearer ' + token
354
364
  request['app_key'] = app_id
355
365
  res = https.request(request)
356
- out_resp = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
366
+ out_resp = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
357
367
  fff = {:func => "querying_device_info",
358
368
  :iot_fun => "2.9.1",
359
369
  :req_header => {:authorization => 'Bearer ' + token,
@@ -384,7 +394,7 @@ class HuaIot
384
394
  req_body = {deviceIds: dev_list}
385
395
  request.body = req_body.to_json
386
396
  res = https.request(request)
387
- output_str = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
397
+ output_str = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
388
398
  fff = {:func => "querying_device_direct_conn",
389
399
  :iot_fun => "2.9.6",
390
400
  :req_header => {:authorization => 'Bearer ' + token,
@@ -414,7 +424,7 @@ class HuaIot
414
424
  request['Authorization'] = 'Bearer ' + token
415
425
  request['app_key'] = app_id
416
426
  res = https.request(request)
417
- output_ans = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
427
+ output_ans = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
418
428
 
419
429
  fff = {:func => "querying_device_type_list",
420
430
  :iot_fun => "2.9.19",
@@ -448,7 +458,7 @@ class HuaIot
448
458
  data = {deviceIds: dev_list}
449
459
  request.body = data.to_json
450
460
  res = https.request(request)
451
- output_ans = {:code => res.code, :message => res.message, :body => JSON.parse(res.body.to_s)}
461
+ output_ans = {:code => res.code, :message => res.message, :body => valid_json?(res.body.to_s)}
452
462
  fff = {:func => "quer_dev_direct_conn_batches",
453
463
  :iot_fun => "2.9.6",
454
464
  :req_header => {:content_type => 'application/json',
@@ -485,7 +495,7 @@ class HuaIot
485
495
  p res.code
486
496
  p res.body
487
497
  if res.body != nil
488
- out_resp = {:code => res.code, :message => res.message, :body => {:answ => JSON.parse(res.body.to_s)}}
498
+ out_resp = {:code => res.code, :message => res.message, :body => {:answ => valid_json?(res.body.to_s)}}
489
499
  else
490
500
  out_resp = {:code => res.code, :message => res.message, :body => {:answ => "no data"}}
491
501
  end
@@ -20,7 +20,7 @@ class MongoIot
20
20
  @internal_func = InternalFunc.new
21
21
  end
22
22
 
23
- def audit_logger(proc_name, src_ip, input_json, output_json, real_ip)
23
+ def audit_logger(proc_name, src_ip, input_json, output_json, real_ip, add_params)
24
24
  out_resp = {}
25
25
  begin
26
26
  current = internal_func.datetimenow
@@ -30,7 +30,8 @@ class MongoIot
30
30
  :date => current,
31
31
  :sender => {:src_ip => src_ip, :real_ip => real_ip},
32
32
  :input_params => input_json,
33
- :output_params => output_json
33
+ :output_params => output_json,
34
+ :add_params => add_params
34
35
  }
35
36
  result = collection.insert_one(doc)
36
37
  out_resp = {:code => 200, :result => "audit_logger: Request completed successfully", :body => result}
@@ -713,5 +714,23 @@ class MongoIot
713
714
  out_resp
714
715
  end
715
716
 
717
+
718
+ def get_all_imei_from_db
719
+ out_resp = {}
720
+ begin
721
+ req2 = []
722
+ result_ps = []
723
+ collection = client[:device_imei]
724
+ collection.find({}, {:_id => 0}).each {|row|
725
+ result_ps.append(row)
726
+ }
727
+ out_resp = {:code => 200, :result => "get_all_imei_from_db: Request completed successfully", :body => result_ps}
728
+ rescue
729
+ out_resp = {:code => 507, :result => "get_all_imei_from_db: Unknown SDK error"}
730
+ end
731
+ #internal_func.printer_texter(out_resp, "debug")
732
+ out_resp
733
+ end
734
+
716
735
  end
717
736
 
@@ -1,4 +1,4 @@
1
1
  module Imperituroard
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imperituroard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-09 00:00:00.000000000 Z
11
+ date: 2020-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler