imperituroard 0.5.3 → 0.5.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/imperituroard.gemspec +3 -0
- data/lib/.DS_Store +0 -0
- data/lib/imperituroard.rb +47 -11
- data/lib/imperituroard/.DS_Store +0 -0
- data/lib/imperituroard/add_functions/logger/any_functions.rb +22 -0
- data/lib/imperituroard/platforms/cps/cps_multiple_thread_req.rb +0 -0
- data/lib/imperituroard/platforms/staros/get_data_ssh.rb +54 -0
- data/lib/imperituroard/platforms/staros/staros_automation.rb +95 -0
- data/lib/imperituroard/platforms/staros/staros_automation_fun.rb +37 -0
- data/lib/imperituroard/platforms/staros/staros_parser.rb +141 -0
- data/lib/imperituroard/projects/dns.rb +1 -1
- data/lib/imperituroard/projects/iot.rb +1 -1
- data/lib/imperituroard/projects/iot/add_functions.rb +27 -27
- data/lib/imperituroard/projects/mhub.rb +2 -0
- data/lib/imperituroard/projects/mhub/infobip.rb +1 -1
- data/lib/imperituroard/projects/mhub/sk.rb +171 -157
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb +124 -12
- data/lib/imperituroard/projects/ukaz60.rb +140 -0
- data/lib/imperituroard/projects/ukaz60/belgim.rb +221 -0
- data/lib/imperituroard/projects/ukaz60/dns.rb +18 -0
- data/lib/imperituroard/projects/{dns/ukaz60 → ukaz60}/dns_update.rb +2 -134
- data/lib/imperituroard/projects/ukaz60/fortigate.rb +210 -0
- data/lib/imperituroard/projects/ukaz60/staros.rb +141 -0
- data/lib/imperituroard/projects/ukaz60/ukaz60_add_func.rb +306 -0
- data/lib/imperituroard/projects/vpn/ezuev_fun/functions_ezuev.rb +29 -0
- data/lib/imperituroard/version.rb +1 -1
- metadata +30 -3
@@ -96,27 +96,27 @@ class AdditionalFunc
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def check_input_1(login, imei_list)
|
99
|
-
{:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
|
99
|
+
{:code => 200, :result => "Request completed successfully", :body => "Data checked"}
|
100
100
|
end
|
101
101
|
|
102
102
|
def check_input_2(login, imei_list)
|
103
|
-
{:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
|
103
|
+
{:code => 200, :result => "Request completed successfully", :body => "Data checked"}
|
104
104
|
end
|
105
105
|
|
106
106
|
def check_input_3(login, imei_list)
|
107
|
-
{:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
|
107
|
+
{:code => 200, :result => "Request completed successfully", :body => "Data checked"}
|
108
108
|
end
|
109
109
|
|
110
110
|
def check_input_4(login, imei_list)
|
111
|
-
{:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
|
111
|
+
{:code => 200, :result => "Request completed successfully", :body => "Data checked"}
|
112
112
|
end
|
113
113
|
|
114
114
|
def check_input_5(login, imei_list)
|
115
|
-
{:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
|
115
|
+
{:code => 200, :result => "Request completed successfully", :body => "Data checked"}
|
116
116
|
end
|
117
117
|
|
118
118
|
def check_input_6(login, imei_list)
|
119
|
-
{:code=>200, :result=>"Request completed successfully", :body=>"Data checked"}
|
119
|
+
{:code => 200, :result => "Request completed successfully", :body => "Data checked"}
|
120
120
|
end
|
121
121
|
|
122
122
|
def iot_query_dev_soapgw_answer(input_params, output_answer)
|
@@ -127,28 +127,28 @@ class AdditionalFunc
|
|
127
127
|
|
128
128
|
begin
|
129
129
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
130
|
+
if output_answer[:code]==200
|
131
|
+
dataaa = []
|
132
|
+
dataaa_failed = []
|
133
|
+
|
134
|
+
ddd = answ_dev_query_format_process(output_answer[:data])[:body]
|
135
|
+
p ddd
|
136
|
+
|
137
|
+
answ = {:code => output_answer[:code],
|
138
|
+
:result => output_answer[:result],
|
139
|
+
:data => ddd[:ok],
|
140
|
+
:error_list => ddd[:failed]
|
141
|
+
}
|
142
|
+
else
|
143
|
+
answ = {:code => output_answer[:code],
|
144
|
+
:result => output_answer[:result],
|
145
|
+
:data => [],
|
146
|
+
:error_list => input_params[:imei]
|
147
|
+
}
|
148
|
+
end
|
149
149
|
rescue
|
150
|
-
answ = {
|
151
|
-
|
150
|
+
answ = {:code => 500,
|
151
|
+
:result => "Unknown error"
|
152
152
|
}
|
153
153
|
end
|
154
154
|
|
@@ -51,6 +51,7 @@ class MhubFunctions_2
|
|
51
51
|
# "notifyContentType"=>"application/json"}}
|
52
52
|
|
53
53
|
|
54
|
+
#for bank dabrabyt
|
54
55
|
def get_send_message_2(params, ip_src, ip_real, ip_vip)
|
55
56
|
|
56
57
|
input_params = {:params => params}
|
@@ -123,6 +124,7 @@ class MhubFunctions_2
|
|
123
124
|
end
|
124
125
|
|
125
126
|
|
127
|
+
#for bank dabrabyt
|
126
128
|
def rec_deliv_report_2(params, ip_src, ip_real, ip_vip)
|
127
129
|
input_params = {:params => params, :ip_src => ip_src, :ip_real => ip_real, :ip_vip => ip_vip}
|
128
130
|
output_params = {}
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
|
8
|
-
class
|
8
|
+
class Infobip_2
|
9
9
|
|
10
10
|
def test
|
11
11
|
gg = "{\"destinations\"=>[{\"to\"=>{\"phoneNumber\"=>\"375297116638\", \"emailAddress\"=>nil}}], \"scenarioKey\"=>\"1\", \"viber\"=>nil, \"sms\"=>{\"text\"=>\"карточка готова\"}, \"sendAt\"=>\"2019-08-15T08:40:00.000\", \"notifyUrl\"=>\"https://bpmonline.bankdabrabyt.by:444/0/ServiceModel/ScGetReports.svc/GetReports\", \"notifyContentType\"=>\"application/json\", \"controller\"=>\"bank\", \"action\"=>\"api\", \"bank\"=>{\"destinations\"=>[{\"to\"=>{\"phoneNumber\"=>\"375297116638\", \"emailAddress\"=>nil}}], \"scenarioKey\"=>\"1\", \"viber\"=>nil, \"sms\"=>{\"text\"=>\"карточка готова\"}, \"sendAt\"=>\"2019-08-15T08:40:00.000\", \"notifyUrl\"=>\"https://bpmonline.bankdabrabyt.by:444/0/ServiceModel/ScGetReports.svc/GetReports\", \"notifyContentType\"=>\"application/json\"}}"
|
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'imperituroard/projects/iot/internal_functions'
|
2
|
+
require 'imperituroard/projects/mhub/subs/dabrab/dabrab_proced'
|
2
3
|
|
3
4
|
class Sksk_2
|
4
5
|
|
5
|
-
attr_accessor :sk_url, :sk_url_broadcast, :sk_login, :sk_password, :internal_func, :telegram_connector
|
6
|
+
attr_accessor :sk_url, :sk_url_broadcast, :sk_login, :sk_password, :internal_func, :telegram_connector, :dabrab_add_func
|
6
7
|
|
7
8
|
def initialize(sk_url, sk_login, sk_password, sk_url_broadcast, telegram_api_url, telegram_chat_id)
|
8
9
|
@sk_url = sk_url
|
@@ -11,6 +12,7 @@ class Sksk_2
|
|
11
12
|
@internal_func = InternalFunc.new
|
12
13
|
@sk_url_broadcast = sk_url_broadcast
|
13
14
|
@telegram_connector = Telegram_2.new(telegram_api_url, telegram_chat_id)
|
15
|
+
@dabrab_add_func = Dabrab.new
|
14
16
|
end
|
15
17
|
|
16
18
|
|
@@ -82,50 +84,49 @@ class Sksk_2
|
|
82
84
|
request_message = {}
|
83
85
|
|
84
86
|
begin
|
85
|
-
|
86
87
|
thr_sk_send_viber_one = Thread.new do
|
88
|
+
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text)
|
89
|
+
|
90
|
+
if viber_mess_ans[:code] == 200
|
91
|
+
uri = URI(sk_url)
|
92
|
+
#8 - client id
|
93
|
+
|
94
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
95
|
+
https.use_ssl=true
|
96
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
97
|
+
req = Net::HTTP::Post.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
|
98
|
+
|
99
|
+
req.basic_auth sk_login, sk_password
|
100
|
+
|
101
|
+
req["Content-Type"] = "application/json"
|
102
|
+
req["Accept"] = "application/json"
|
103
|
+
|
104
|
+
request_message = {
|
105
|
+
"phone_number": msisdn,
|
106
|
+
#"extra_id": "4232j4h89932kjhs",
|
107
|
+
"callback_url": callback_url,
|
108
|
+
#"start_time": "2019-08-16 09:59:10",
|
109
|
+
"tag": "Dabrab_custom_api_1",
|
110
|
+
"channels": [
|
111
|
+
"viber"
|
112
|
+
],
|
113
|
+
"channel_options": {
|
114
|
+
"viber": viber_mess_ans[:body][:to_sk_format]
|
115
|
+
}
|
116
|
+
}
|
117
|
+
req.body = request_message.to_json
|
118
|
+
res = https.request(req)
|
119
|
+
output_params = {:code => 200,
|
120
|
+
:result => "Sksk_2.sk_send_viber_one: Request processed",
|
121
|
+
:body => {:request_message => request_message,
|
122
|
+
:res_code => res.code,
|
123
|
+
:res_body => JSON.parse(res.body.to_s)}}
|
124
|
+
|
125
|
+
else
|
126
|
+
output_params = {:code => 508, :result => "Sksk_2.sk_send_viber_one: Something wrong with dabrabyt_text_field_parse"}
|
127
|
+
end
|
87
128
|
|
88
129
|
|
89
|
-
uri = URI(sk_url)
|
90
|
-
#8 - client id
|
91
|
-
|
92
|
-
https = Net::HTTP.new(uri.host, uri.port)
|
93
|
-
https.use_ssl=true
|
94
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
95
|
-
req = Net::HTTP::Post.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
|
96
|
-
|
97
|
-
req.basic_auth sk_login, sk_password
|
98
|
-
|
99
|
-
req["Content-Type"] = "application/json"
|
100
|
-
req["Accept"] = "application/json"
|
101
|
-
|
102
|
-
request_message = {
|
103
|
-
"phone_number": msisdn,
|
104
|
-
#"extra_id": "4232j4h89932kjhs",
|
105
|
-
"callback_url": callback_url,
|
106
|
-
#"start_time": "2019-08-16 09:59:10",
|
107
|
-
"tag": "Dabrab_custom_api_1",
|
108
|
-
"channels": [
|
109
|
-
"viber"
|
110
|
-
],
|
111
|
-
"channel_options": {
|
112
|
-
"viber": {
|
113
|
-
"text": text,
|
114
|
-
"ttl": 60,
|
115
|
-
# "img": "http://olddogs.org/logo.png",
|
116
|
-
# "caption": "Old Dogs need you!",
|
117
|
-
# "action": "http://olddogs.org",
|
118
|
-
},
|
119
|
-
}
|
120
|
-
}
|
121
|
-
req.body = request_message.to_json
|
122
|
-
res = https.request(req)
|
123
|
-
output_params = {:code => 200,
|
124
|
-
:result => "Sksk_2.sk_send_viber_one: Request processed",
|
125
|
-
:body => {:request_message => request_message,
|
126
|
-
:res_code => res.code,
|
127
|
-
:res_body => JSON.parse(res.body.to_s)}}
|
128
|
-
|
129
130
|
end
|
130
131
|
|
131
132
|
thr_sk_send_viber_one.join
|
@@ -149,53 +150,54 @@ class Sksk_2
|
|
149
150
|
|
150
151
|
thr_sk_send_viber_sms_one = Thread.new do
|
151
152
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
153
|
+
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_txt)
|
154
|
+
|
155
|
+
if viber_mess_ans[:code] == 200
|
156
|
+
uri = URI(sk_url)
|
157
|
+
#8 - client id
|
158
|
+
|
159
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
160
|
+
https.use_ssl=true
|
161
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
162
|
+
req = Net::HTTP::Post.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
|
163
|
+
|
164
|
+
req.basic_auth sk_login, sk_password
|
165
|
+
|
166
|
+
req["Content-Type"] = "application/json"
|
167
|
+
req["Accept"] = "application/json"
|
168
|
+
|
169
|
+
request_message = {
|
170
|
+
"phone_number": msisdn,
|
171
|
+
#"extra_id": "4232j4h89932kjhs",
|
172
|
+
"callback_url": callback_url,
|
173
|
+
#"start_time": "2019-08-16 09:59:10",
|
174
|
+
"tag": "Dabrab_custom_api_1",
|
175
|
+
"channels": [
|
176
|
+
"viber",
|
177
|
+
"sms"
|
178
|
+
],
|
179
|
+
"channel_options": {
|
180
|
+
"sms": {
|
181
|
+
"text": sms_text,
|
182
|
+
"alpha_name": alphaname,
|
183
|
+
"ttl": 600
|
184
|
+
},
|
185
|
+
"viber": viber_mess_ans[:body][:to_sk_format]
|
186
|
+
}
|
187
|
+
}
|
188
|
+
|
189
|
+
req.body = request_message.to_json
|
190
|
+
res = https.request(req)
|
191
|
+
|
192
|
+
output_params = {:code => 200,
|
193
|
+
:result => "Sksk_2.sk_send_viber_sms_one: Request processed",
|
194
|
+
:body => {:request_message => request_message,
|
195
|
+
:res_code => res.code,
|
196
|
+
:res_body => JSON.parse(res.body.to_s)}}
|
197
|
+
|
198
|
+
else
|
199
|
+
output_params = {:code => 508, :result => "Sksk_2.sk_send_viber_sms_one: Something wrong with dabrabyt_text_field_parse"}
|
200
|
+
end
|
199
201
|
|
200
202
|
end
|
201
203
|
|
@@ -281,44 +283,49 @@ class Sksk_2
|
|
281
283
|
begin
|
282
284
|
|
283
285
|
thr_sk_send_viber_list = Thread.new do
|
284
|
-
uri = URI(sk_url_broadcast)
|
285
|
-
#8 - client id
|
286
286
|
|
287
|
-
|
288
|
-
https.use_ssl = true
|
289
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
290
|
-
req = Net::HTTP::Post.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
|
287
|
+
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(text)
|
291
288
|
|
292
|
-
|
293
|
-
|
289
|
+
if viber_mess_ans[:code] == 200
|
290
|
+
uri = URI(sk_url_broadcast)
|
291
|
+
#8 - client id
|
294
292
|
|
295
|
-
|
293
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
294
|
+
https.use_ssl = true
|
295
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
296
|
+
req = Net::HTTP::Post.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
|
296
297
|
|
298
|
+
req["Content-Type"] = "application/json"
|
299
|
+
req["Accept"] = "application/json"
|
297
300
|
|
298
|
-
|
299
|
-
request_message = {
|
300
|
-
"recipients": msisdn_list,
|
301
|
-
"callback_url": callback_url,
|
302
|
-
"tag": "Dabrab_custom_api_1",
|
303
|
-
"channels": [
|
304
|
-
"viber"
|
305
|
-
],
|
306
|
-
"channel_options": {
|
307
|
-
"viber": {
|
308
|
-
"text": text,
|
309
|
-
"ttl": 60
|
310
|
-
}
|
311
|
-
}
|
312
|
-
}
|
301
|
+
req.basic_auth sk_login, sk_password
|
313
302
|
|
314
|
-
req.body = request_message.to_json
|
315
|
-
res = https.request(req)
|
316
303
|
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
304
|
+
# [{"phone_number": 375298766719}, {"phone_number": 375295730878}]
|
305
|
+
request_message = {
|
306
|
+
"recipients": msisdn_list,
|
307
|
+
"callback_url": callback_url,
|
308
|
+
"tag": "Dabrab_custom_api_1",
|
309
|
+
"channels": [
|
310
|
+
"viber"
|
311
|
+
],
|
312
|
+
"channel_options": {
|
313
|
+
"viber": viber_mess_ans[:body][:to_sk_format]
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
req.body = request_message.to_json
|
318
|
+
res = https.request(req)
|
319
|
+
|
320
|
+
output_params = {:code => 200,
|
321
|
+
:result => "Sksk_2.sk_send_viber_list: Request processed",
|
322
|
+
:body => {:request_message => request_message,
|
323
|
+
:res_code => res.code,
|
324
|
+
:res_body => JSON.parse(res.body.to_s)}}
|
325
|
+
else
|
326
|
+
output_params = {:code => 508, :result => "Sksk_2.sk_send_viber_list: Something wrong with dabrabyt_text_field_parse"}
|
327
|
+
end
|
328
|
+
|
322
329
|
end
|
323
330
|
thr_sk_send_viber_list.join
|
324
331
|
rescue
|
@@ -337,50 +344,57 @@ class Sksk_2
|
|
337
344
|
|
338
345
|
begin
|
339
346
|
thr_sk_send_viber_sms_list = Thread.new do
|
340
|
-
uri = URI(sk_url_broadcast)
|
341
|
-
#8 - client id
|
342
347
|
|
343
|
-
|
344
|
-
https.use_ssl = true
|
345
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
346
|
-
req = Net::HTTP::Post.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
|
348
|
+
viber_mess_ans = dabrab_add_func.dabrabyt_text_field_parse(viber_text)
|
347
349
|
|
348
|
-
|
350
|
+
if viber_mess_ans[:code] == 200
|
349
351
|
|
352
|
+
uri = URI(sk_url_broadcast)
|
353
|
+
#8 - client id
|
350
354
|
|
351
|
-
|
352
|
-
|
355
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
356
|
+
https.use_ssl = true
|
357
|
+
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
358
|
+
req = Net::HTTP::Post.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
|
353
359
|
|
354
|
-
|
355
|
-
request_message = {
|
356
|
-
"recipients": msisdn_list,
|
357
|
-
"callback_url": callback_url,
|
358
|
-
"tag": "Dabrab_custom_api_1",
|
359
|
-
"channels": [
|
360
|
-
"viber",
|
361
|
-
"sms"
|
362
|
-
],
|
363
|
-
"channel_options": {
|
364
|
-
"sms": {
|
365
|
-
"alpha_name": alphaname,
|
366
|
-
"text": sms_text,
|
367
|
-
"ttl": 60
|
368
|
-
},
|
369
|
-
"viber": {
|
370
|
-
"text": viber_text,
|
371
|
-
"ttl": 60
|
372
|
-
}
|
373
|
-
}
|
374
|
-
}
|
360
|
+
req.basic_auth sk_login, sk_password
|
375
361
|
|
376
|
-
req.body = request_message.to_json
|
377
|
-
res = https.request(req)
|
378
362
|
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
363
|
+
req["Content-Type"] = "application/json"
|
364
|
+
req["Accept"] = "application/json"
|
365
|
+
|
366
|
+
# [{"phone_number": 375298766719}, {"phone_number": 375295730878}]
|
367
|
+
request_message = {
|
368
|
+
"recipients": msisdn_list,
|
369
|
+
"callback_url": callback_url,
|
370
|
+
"tag": "Dabrab_custom_api_1",
|
371
|
+
"channels": [
|
372
|
+
"viber",
|
373
|
+
"sms"
|
374
|
+
],
|
375
|
+
"channel_options": {
|
376
|
+
"sms": {
|
377
|
+
"alpha_name": alphaname,
|
378
|
+
"text": sms_text,
|
379
|
+
"ttl": 60
|
380
|
+
},
|
381
|
+
"viber": viber_mess_ans[:body][:to_sk_format]
|
382
|
+
}
|
383
|
+
}
|
384
|
+
|
385
|
+
req.body = request_message.to_json
|
386
|
+
res = https.request(req)
|
387
|
+
|
388
|
+
output_params = {:code => 200,
|
389
|
+
:result => "Sksk_2.sk_send_viber_sms_list: Request processed",
|
390
|
+
:body => {:request_message => request_message,
|
391
|
+
:res_code => res.code,
|
392
|
+
:res_body => JSON.parse(res.body.to_s)}}
|
393
|
+
|
394
|
+
else
|
395
|
+
output_params = {:code => 508, :result => "Sksk_2.sk_send_viber_sms_list: Something wrong with dabrabyt_text_field_parse"}
|
396
|
+
end
|
397
|
+
|
384
398
|
end
|
385
399
|
|
386
400
|
thr_sk_send_viber_sms_list.join
|