imperituroard 1.1.1 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/imperituroard/projects/iot.rb +2 -8
- data/lib/imperituroard/projects/iot/add_functions.rb +2 -2
- data/lib/imperituroard/projects/iot/internal_functions.rb +8 -3
- data/lib/imperituroard/projects/iot/mongoconnector.rb +13 -3
- data/lib/imperituroard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7919ac48dbcd533bd4f368d270658af138d85a9c
|
4
|
+
data.tar.gz: 983635e4384c254401baeabb9b53c590c0ad283e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf610d13353c653e39f9af8e243cf19121c7aba27efcb6320dc24bd15db34b2b51dd96ac83e9264b9d4cf847e7d2fc64d163987e5bc45948177cbb229ea8510c
|
7
|
+
data.tar.gz: b22a70dc42f117ad123bab0a2be922b8aa236fd9f2f87dd717fd5e83aa6d711792133c1857c23b62f441bfce07c8eb243a0336cafe76ee18387e2d0ffbebb165
|
@@ -214,7 +214,6 @@ class IotFunctions_2
|
|
214
214
|
end
|
215
215
|
|
216
216
|
|
217
|
-
|
218
217
|
def add_device_to_prof2_2(request_full, real_ip, remote_ip)
|
219
218
|
|
220
219
|
#{"autorization"=>{"login"=>"test", "token"=>"tE3aFvs27"}, "devlist"=>[{"devices"=>{"imei"=>123419520034999, "type"=>"1000002", "profile"=>0}}]}
|
@@ -229,6 +228,7 @@ class IotFunctions_2
|
|
229
228
|
imei_list = im_li
|
230
229
|
|
231
230
|
input_json = {:request_full => request_full}
|
231
|
+
input_json22 = {:login => login, :imei_list => imei_list}
|
232
232
|
resp_out = {}
|
233
233
|
begin
|
234
234
|
|
@@ -368,7 +368,7 @@ class IotFunctions_2
|
|
368
368
|
end
|
369
369
|
thr1.join
|
370
370
|
|
371
|
-
resp_out[:body][:tosoapgw] = internal_func.iot_create_dev_soapgw_answer(
|
371
|
+
resp_out[:body][:tosoapgw] = internal_func.iot_create_dev_soapgw_answer(input_json22, resp_out)
|
372
372
|
mongo_client.audit_logger("add_device_to_profile", remote_ip, input_json, resp_out, real_ip, {})
|
373
373
|
resp_out
|
374
374
|
end
|
@@ -1381,10 +1381,6 @@ class IotFunctions_2
|
|
1381
1381
|
end
|
1382
1382
|
|
1383
1383
|
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
1384
|
################################################
|
1389
1385
|
############technology procedures###############
|
1390
1386
|
################################################
|
@@ -1404,8 +1400,6 @@ class IotFunctions_2
|
|
1404
1400
|
end
|
1405
1401
|
|
1406
1402
|
|
1407
|
-
|
1408
|
-
|
1409
1403
|
#for internal use. Add new device model
|
1410
1404
|
def add_model_to_mongo(model, manufacture_id, manufacture_name, device_type, description, note)
|
1411
1405
|
model = {
|
@@ -65,6 +65,7 @@ class InternalFunc
|
|
65
65
|
else
|
66
66
|
output_params = {:code => 200, :result => "if_digit_or_string: Request processed. Its string", :body => {:string => true}}
|
67
67
|
end
|
68
|
+
printer_texter({:input_params => input_params, :output_params => output_params}, "debug")
|
68
69
|
output_params
|
69
70
|
|
70
71
|
end
|
@@ -76,7 +77,6 @@ class InternalFunc
|
|
76
77
|
|
77
78
|
output_info = {}
|
78
79
|
begin
|
79
|
-
|
80
80
|
if output_answer[:code] != 200
|
81
81
|
deviceserr = []
|
82
82
|
failednum = input_params[:imei_list].length
|
@@ -151,7 +151,7 @@ class InternalFunc
|
|
151
151
|
else
|
152
152
|
answer = {:code => 400, :result => "Invalid IMEI. Data is not integer", :checked => false}
|
153
153
|
end
|
154
|
-
printer_texter({:answer => answer, :input => input}, "debug")
|
154
|
+
printer_texter({:answer => answer, :input => input, :fun => "imei_validate"}, "debug")
|
155
155
|
answer
|
156
156
|
end
|
157
157
|
|
@@ -166,13 +166,18 @@ class InternalFunc
|
|
166
166
|
|
167
167
|
#delete one key from hash
|
168
168
|
def delete_key_hash(hash_f, delete_key)
|
169
|
+
inp_fun = {:hash_f => hash_f, :delete_key => delete_key}
|
170
|
+
hash_f = hash_f.to_h
|
171
|
+
out_data = {}
|
169
172
|
res = {}
|
170
173
|
hash_f.each do |ggg|
|
171
174
|
if ggg[0].to_s != delete_key.to_s
|
172
175
|
res[ggg[0]] = ggg[1]
|
173
176
|
end
|
174
177
|
end
|
175
|
-
res
|
178
|
+
out_data = res
|
179
|
+
printer_texter({:out_data => out_data, :inp_fun => inp_fun, :fun => "delete_key_hash" }, "debug")
|
180
|
+
out_data
|
176
181
|
end
|
177
182
|
|
178
183
|
|
@@ -507,6 +507,7 @@ class MongoIot
|
|
507
507
|
#function for get iot platform credentials from profile
|
508
508
|
#universal procedure. use profile or profile id
|
509
509
|
def get_iot_oceanconn_credent_2(profile)
|
510
|
+
input_in = {:profile => profile}
|
510
511
|
out_resp = {}
|
511
512
|
begin
|
512
513
|
result_ps = []
|
@@ -528,7 +529,7 @@ class MongoIot
|
|
528
529
|
rescue
|
529
530
|
out_resp = {:code => 500, :result => "get_iot_oceanconn_credent_2: Process failed"}
|
530
531
|
end
|
531
|
-
internal_func.printer_texter(out_resp, "debug")
|
532
|
+
internal_func.printer_texter({:input_in => input_in, :out_resp => out_resp, :fun => "get_iot_oceanconn_credent_2"}, "debug")
|
532
533
|
out_resp
|
533
534
|
end
|
534
535
|
|
@@ -555,6 +556,7 @@ class MongoIot
|
|
555
556
|
|
556
557
|
#universal procedure. Use id or name
|
557
558
|
def get_device_type_info_universal(device_model)
|
559
|
+
input_fun = {:device_model => device_model}
|
558
560
|
out_resp = {}
|
559
561
|
begin
|
560
562
|
as = internal_func.if_digit_or_string(device_model)
|
@@ -588,13 +590,14 @@ class MongoIot
|
|
588
590
|
rescue
|
589
591
|
out_resp = {:code => 500, :result => "get_device_type_info_universal: procedure error", :body => {"model" => device_model, "ManufacturerID" => "unknown", "ManufacturerNAME" => "unknown", "device_type" => "unknown"}}
|
590
592
|
end
|
591
|
-
internal_func.printer_texter(out_resp, "debug")
|
593
|
+
internal_func.printer_texter({:input_fun => input_fun, :out_resp => out_resp, :fun => "get_device_type_info_universal"}, "debug")
|
592
594
|
out_resp
|
593
595
|
end
|
594
596
|
|
595
597
|
|
596
598
|
|
597
599
|
def compare_profiles(profile1, profile2)
|
600
|
+
input_inf = {:profile1 => profile1, :profile2 => profile2}
|
598
601
|
out_answ = {}
|
599
602
|
ch1 = internal_func.if_digit_or_string(profile1)
|
600
603
|
ch2 = internal_func.if_digit_or_string(profile2)
|
@@ -631,10 +634,12 @@ class MongoIot
|
|
631
634
|
out_answ = {:code => 200, :result => "compare_profiles: profiles are different", :is_the_same => false, :data_type => "different"}
|
632
635
|
end
|
633
636
|
end
|
637
|
+
internal_func.printer_texter({:input_inf => input_inf, :out => out_answ, :fun => "compare_profiles"}, "debug")
|
634
638
|
out_answ
|
635
639
|
end
|
636
640
|
|
637
641
|
def compare_device_types(type1, type2)
|
642
|
+
input_inf = {:type1 => type1, :type2 => type2}
|
638
643
|
out_answ = {}
|
639
644
|
tp1 = internal_func.if_digit_or_string(type1)
|
640
645
|
tp2 = internal_func.if_digit_or_string(type2)
|
@@ -681,12 +686,15 @@ class MongoIot
|
|
681
686
|
out_answ = {:code => 200, :result => "compare_device_types: profiles are different", :is_the_same => false, :data_type => "different"}
|
682
687
|
end
|
683
688
|
end
|
689
|
+
internal_func.printer_texter({:input_inf => input_inf, :out => out_answ, :fun => "compare_device_types"}, "debug")
|
684
690
|
out_answ
|
685
691
|
end
|
686
692
|
|
687
693
|
|
688
694
|
#universal procedure. put there profile name or id in string or int
|
689
695
|
def get_profile_universal(profile)
|
696
|
+
input_inf = {:profile => profile}
|
697
|
+
out = {}
|
690
698
|
inn = internal_func.if_digit_or_string(profile)
|
691
699
|
out = {}
|
692
700
|
if inn[:body][:string]
|
@@ -694,10 +702,12 @@ class MongoIot
|
|
694
702
|
else
|
695
703
|
out = self.get_profile_name_by_id(profile.to_i)
|
696
704
|
end
|
705
|
+
internal_func.printer_texter({:input_inf => input_inf, :out => out, :fun => "get_profile_universal"}, "debug")
|
697
706
|
out
|
698
707
|
end
|
699
708
|
|
700
709
|
def modify_attr_mongo_universal(imei, attribute)
|
710
|
+
input_add = {:imei => imei, :attribute => attribute}
|
701
711
|
out_resp = {}
|
702
712
|
begin
|
703
713
|
collection = client[:device_imei]
|
@@ -710,7 +720,7 @@ class MongoIot
|
|
710
720
|
rescue
|
711
721
|
out_resp = {:code => 507, :result => "modify_attr_mongo_universal: Unknown SDK error"}
|
712
722
|
end
|
713
|
-
internal_func.printer_texter(out_resp, "debug")
|
723
|
+
internal_func.printer_texter({:input_add => input_add, :out_resp => out_resp, :fun => "modify_attr_mongo_universal"}, "debug")
|
714
724
|
out_resp
|
715
725
|
end
|
716
726
|
|
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.
|
4
|
+
version: 1.1.7
|
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-
|
11
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|