nagira 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +4 -0
- data/Rakefile +10 -0
- data/lib/app/routes/get/status.rb +15 -11
- data/version.txt +1 -1
- metadata +2 -2
data/History.md
CHANGED
data/Rakefile
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require_relative 'lib/nagira'
|
3
3
|
|
4
|
+
# Release
|
5
|
+
# - rspec
|
6
|
+
# - run app, test
|
7
|
+
# - bump version
|
8
|
+
# - tag
|
9
|
+
# - gem build
|
10
|
+
# - gem install
|
11
|
+
# - tag push
|
12
|
+
# - gem push
|
13
|
+
#
|
4
14
|
def log_user msg
|
5
15
|
puts "#{Time.now} -- #{msg.chomp}"
|
6
16
|
end
|
@@ -62,10 +62,12 @@ class Nagira < Sinatra::Base
|
|
62
62
|
|
63
63
|
|
64
64
|
hostname = hostname.to_i if hostname =~ /^\d+$/
|
65
|
-
if @
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
if @status && @status[hostname]
|
66
|
+
if @output == :state
|
67
|
+
@data = @status[hostname]['servicestatus'][service].slice("hostname", "service_description", "current_state")
|
68
|
+
else
|
69
|
+
@data = @status[hostname]['servicestatus'][service]
|
70
|
+
end
|
69
71
|
end
|
70
72
|
nil
|
71
73
|
end
|
@@ -83,13 +85,15 @@ class Nagira < Sinatra::Base
|
|
83
85
|
get "/_status/:hostname/_services" do |hostname|
|
84
86
|
|
85
87
|
hostname = hostname.to_i if hostname =~ /^\d+$/
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
88
|
+
if @status && @status[hostname]
|
89
|
+
case @output
|
90
|
+
when :list
|
91
|
+
@data = @status[hostname]['servicestatus'].keys
|
92
|
+
when :state
|
93
|
+
@data = @status.each { |k,v| @data[k] = v.slice("host_name", "service_description", "current_state") }
|
94
|
+
else
|
95
|
+
@data = @status[hostname]['servicestatus']
|
96
|
+
end
|
93
97
|
end
|
94
98
|
|
95
99
|
nil
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.8
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nagira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|