soaring 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/soaring/cli.rb +9 -0
- data/lib/soaring/detailer.rb +32 -0
- data/lib/soaring/version.rb +1 -1
- data/lib/soaring.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d31f6669ec3757d257c9845fab4f46e039e710d
|
4
|
+
data.tar.gz: 4749fd927aeaf5fe5a78bdee99318dcf458ce1cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59e487dca3574f49203801896f310a71eda6ddaa4d86a9aa4561952c90cd50e6add65501615007d86a2ba47c67a17a14dd33c75b5f943118a33b5c2ac189d209
|
7
|
+
data.tar.gz: 69c56b91db45ff69ef6fb4b02d031b28b84d9c5818967dc9002a02eca2e0637abcbcc76d1e23cd48b3615905992f493e43046866cdbdb946ec32f4fad06c7e8c
|
data/lib/soaring/cli.rb
CHANGED
@@ -46,5 +46,14 @@ module Soaring
|
|
46
46
|
packager = Packager.new(options)
|
47
47
|
packager.package
|
48
48
|
end
|
49
|
+
|
50
|
+
desc "detail [OPTIONS]", "provide detailed status of a running service component with OPTIONS"
|
51
|
+
option :verbose, :aliases => '-v', :desc => 'Verbose logging'
|
52
|
+
option :url, :aliases => '-u', :default => 'http://localhost:9393/status-detail', :desc => 'URL of the status endpoint to hit'
|
53
|
+
option :format, :aliases => '-f', :default => 'yaml', :desc => 'The format of the output (yaml,json), defaults to yaml'
|
54
|
+
def detail
|
55
|
+
detailer = Detailer.new(options)
|
56
|
+
detailer.detail
|
57
|
+
end
|
49
58
|
end
|
50
59
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'json'
|
3
|
+
require 'yaml'
|
4
|
+
|
5
|
+
module Soaring
|
6
|
+
class Detailer
|
7
|
+
def initialize(options)
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def detail
|
12
|
+
url = URI.parse(@options[:url])
|
13
|
+
req = Net::HTTP::Get.new(url.to_s)
|
14
|
+
res = Net::HTTP.start(url.host, url.port) {|http|
|
15
|
+
http.request(req)
|
16
|
+
}
|
17
|
+
|
18
|
+
if '200' != res.code
|
19
|
+
$stderr.puts "Failed to connect with http error code #{res.code}"
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
|
23
|
+
puts JSON.parse(res.body) if 'json' == @options[:format]
|
24
|
+
print JSON.parse(res.body).to_yaml if 'yaml' == @options[:format]
|
25
|
+
|
26
|
+
rescue StandardError => exception
|
27
|
+
message = "#{exception.class}: #{exception.message}"
|
28
|
+
$stderr.puts "#{message}"
|
29
|
+
exit 1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/soaring/version.rb
CHANGED
data/lib/soaring.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barney de Villiers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- bin/soaring
|
98
98
|
- lib/soaring.rb
|
99
99
|
- lib/soaring/cli.rb
|
100
|
+
- lib/soaring/detailer.rb
|
100
101
|
- lib/soaring/initializer.rb
|
101
102
|
- lib/soaring/packager.rb
|
102
103
|
- lib/soaring/runner.rb
|
@@ -128,4 +129,3 @@ signing_key:
|
|
128
129
|
specification_version: 4
|
129
130
|
summary: Tooling for soaring with the soar architecture
|
130
131
|
test_files: []
|
131
|
-
has_rdoc:
|