rest-ftp-daemon 0.306.0 → 0.306.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rest-ftp-daemon/api/dashboard.rb +2 -2
- data/lib/rest-ftp-daemon/api/root.rb +4 -14
- data/lib/rest-ftp-daemon/helpers/api.rb +24 -0
- data/lib/rest-ftp-daemon/{helpers.rb → helpers/common.rb} +1 -1
- data/lib/rest-ftp-daemon/{help_views.rb → helpers/views.rb} +1 -1
- data/lib/rest-ftp-daemon/job.rb +1 -1
- data/lib/rest-ftp-daemon/job_queue.rb +1 -1
- data/lib/rest-ftp-daemon/notification.rb +2 -2
- data/lib/rest-ftp-daemon/paginate.rb +1 -1
- data/lib/rest-ftp-daemon.rb +3 -3
- data/rest-ftp-daemon.gemspec +1 -1
- metadata +4 -4
- data/lib/rest-ftp-daemon/help_apis.rb +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 372111b2b2e4ff339dd45950692792e665189752
|
4
|
+
data.tar.gz: 951510fba629f42100adc30c231918fad393c19c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0fb55a01ba93e20345e929c3f21191aa43de48934a243f2f007bfb6ec518f360930f543220d8071e8c1bb88932e6f89a932cde241b0abd7e85a4d2e24cf0b64
|
7
|
+
data.tar.gz: eba0e1863549d8de14877bc095324594e8aa217f17c6589b6fdd1763821226673782767680890a4aae6a56f8f16fa64211308ee5d26b83b97a2a4081a2e54625
|
data/Gemfile.lock
CHANGED
@@ -17,8 +17,8 @@ module RestFtpDaemon
|
|
17
17
|
|
18
18
|
# Inject helpers
|
19
19
|
scope_object = eval("self", binding)
|
20
|
-
scope_object.extend RestFtpDaemon::
|
21
|
-
scope_object.extend RestFtpDaemon::
|
20
|
+
scope_object.extend RestFtpDaemon::ViewsHelper
|
21
|
+
scope_object.extend RestFtpDaemon::CommonHelpers
|
22
22
|
|
23
23
|
# Do the rendering !
|
24
24
|
haml_engine.render(scope_object, values)
|
@@ -6,6 +6,10 @@ module RestFtpDaemon
|
|
6
6
|
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
7
7
|
|
8
8
|
### LOGGING & HELPERS
|
9
|
+
helpers RestFtpDaemon::CommonHelpers
|
10
|
+
helpers RestFtpDaemon::ApiHelpers
|
11
|
+
helpers BmcDaemonLib::LoggerHelper
|
12
|
+
|
9
13
|
helpers do
|
10
14
|
def log_prefix
|
11
15
|
['API', nil, nil]
|
@@ -14,18 +18,6 @@ module RestFtpDaemon
|
|
14
18
|
def logger
|
15
19
|
Root.logger
|
16
20
|
end
|
17
|
-
|
18
|
-
def log_request
|
19
|
-
if env.nil?
|
20
|
-
puts "HTTP_ENV_IS_NIL: #{env.inspect}"
|
21
|
-
return
|
22
|
-
end
|
23
|
-
|
24
|
-
request_method = env['REQUEST_METHOD']
|
25
|
-
request_path = env['REQUEST_PATH']
|
26
|
-
request_uri = env['REQUEST_URI']
|
27
|
-
log_info "HTTP #{request_method} #{request_uri}", params
|
28
|
-
end
|
29
21
|
end
|
30
22
|
|
31
23
|
before do
|
@@ -33,8 +25,6 @@ module RestFtpDaemon
|
|
33
25
|
end
|
34
26
|
|
35
27
|
### CLASS CONFIG
|
36
|
-
helpers RestFtpDaemon::HelpApis
|
37
|
-
helpers BmcDaemonLib::LoggerHelper
|
38
28
|
logger BmcDaemonLib::LoggerPool.instance.get :api
|
39
29
|
do_not_route_head!
|
40
30
|
do_not_route_options!
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module RestFtpDaemon
|
2
|
+
module ApiHelpers
|
3
|
+
|
4
|
+
def log_request
|
5
|
+
if env.nil?
|
6
|
+
puts "HTTP_ENV_IS_NIL: #{env.inspect}"
|
7
|
+
return
|
8
|
+
end
|
9
|
+
|
10
|
+
request_method = env['REQUEST_METHOD']
|
11
|
+
request_path = env['REQUEST_PATH']
|
12
|
+
request_uri = env['REQUEST_URI']
|
13
|
+
log_info "HTTP #{request_method} #{request_uri}", params
|
14
|
+
end
|
15
|
+
|
16
|
+
def get_censored_config
|
17
|
+
config = Conf.to_hash
|
18
|
+
config[:users] = Conf[:users].keys if Conf[:users]
|
19
|
+
config[:endpoints] = Conf[:endpoints].keys if Conf[:endpoints]
|
20
|
+
config
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
data/lib/rest-ftp-daemon/job.rb
CHANGED
@@ -5,7 +5,7 @@ module RestFtpDaemon
|
|
5
5
|
class Job
|
6
6
|
include BmcDaemonLib::LoggerHelper
|
7
7
|
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
8
|
-
include
|
8
|
+
include CommonHelpers
|
9
9
|
|
10
10
|
# Class constants
|
11
11
|
FIELDS = [:source, :target, :label, :priority, :pool, :notify, :overwrite, :mkdir, :tempfile]
|
@@ -5,7 +5,7 @@ require 'rest_client'
|
|
5
5
|
module RestFtpDaemon
|
6
6
|
class Notification
|
7
7
|
include BmcDaemonLib::LoggerHelper
|
8
|
-
include
|
8
|
+
include CommonHelpers
|
9
9
|
|
10
10
|
# Class options
|
11
11
|
attr_reader :logger
|
@@ -87,7 +87,7 @@ module RestFtpDaemon
|
|
87
87
|
# Log reponse body
|
88
88
|
response_lines = response.body.lines
|
89
89
|
if response_lines.size > 1
|
90
|
-
human_size =
|
90
|
+
human_size = format_bytes(response.body.bytesize, "B")
|
91
91
|
log_info "received [#{response.code}] #{human_size} (#{response_lines.size} lines)", response_lines
|
92
92
|
else
|
93
93
|
log_info "received [#{response.code}] #{response.body.strip}"
|
data/lib/rest-ftp-daemon.rb
CHANGED
@@ -18,9 +18,9 @@ require_relative "shared/patch_haml"
|
|
18
18
|
# Project's libs
|
19
19
|
require_relative "rest-ftp-daemon/constants"
|
20
20
|
require_relative "rest-ftp-daemon/exceptions"
|
21
|
-
require_relative "rest-ftp-daemon/
|
22
|
-
require_relative "rest-ftp-daemon/
|
23
|
-
require_relative "rest-ftp-daemon/helpers"
|
21
|
+
require_relative "rest-ftp-daemon/helpers/common"
|
22
|
+
require_relative "rest-ftp-daemon/helpers/views"
|
23
|
+
require_relative "rest-ftp-daemon/helpers/api"
|
24
24
|
require_relative "rest-ftp-daemon/metrics"
|
25
25
|
require_relative "rest-ftp-daemon/paginate"
|
26
26
|
require_relative "rest-ftp-daemon/uri"
|
data/rest-ftp-daemon.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest-ftp-daemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.306.
|
4
|
+
version: 0.306.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno MEDICI
|
@@ -335,9 +335,9 @@ files:
|
|
335
335
|
- lib/rest-ftp-daemon/constants.rb
|
336
336
|
- lib/rest-ftp-daemon/counters.rb
|
337
337
|
- lib/rest-ftp-daemon/exceptions.rb
|
338
|
-
- lib/rest-ftp-daemon/
|
339
|
-
- lib/rest-ftp-daemon/
|
340
|
-
- lib/rest-ftp-daemon/helpers.rb
|
338
|
+
- lib/rest-ftp-daemon/helpers/api.rb
|
339
|
+
- lib/rest-ftp-daemon/helpers/common.rb
|
340
|
+
- lib/rest-ftp-daemon/helpers/views.rb
|
341
341
|
- lib/rest-ftp-daemon/job.rb
|
342
342
|
- lib/rest-ftp-daemon/job_queue.rb
|
343
343
|
- lib/rest-ftp-daemon/launcher.rb
|