xcskarel 0.3 → 0.3.1
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/bin/xcskarel +16 -0
- data/lib/karel/server.rb +6 -0
- data/lib/karel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6af488d80910f9ee7f28c8760bc09018a0163c55
|
4
|
+
data.tar.gz: 54c6dffe9173bee13c2b96caa5bd61b8141da76d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b1a79f3a81df97a677f234c35d7667ac6742e6cb07f67eb200e24daca88544ffab15a0673ba79ab33d2eda88cedc61da2f208b5bca499d10d81c0911865fafa
|
7
|
+
data.tar.gz: 866283bd79ff5ae6727fe42ac2193f0a3580c865119925ded8f40e75d59460c77211fcdd83051fc0ca991eee0ebbb6e12e2d8ee459907042cb9c1cf1f5a63e07
|
data/bin/xcskarel
CHANGED
@@ -68,6 +68,22 @@ class XCSKarelApplication
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
command :health do |c|
|
72
|
+
c.syntax = 'xcskarel health [options]'
|
73
|
+
c.description = 'Fetches health information of the specified server'
|
74
|
+
c.example 'get health', 'xcskarel health --hostname 127.0.0.1'
|
75
|
+
add_xcs_options(c)
|
76
|
+
c.action do |args, options|
|
77
|
+
server = create_server_from_options(options)
|
78
|
+
all_health = server.get_health
|
79
|
+
unless options.no_filter
|
80
|
+
all_health = XCSKarel.filter_key_paths(all_health, ['uptime'])
|
81
|
+
end
|
82
|
+
out = options.no_pretty ? JSON.generate(all_health) : JSON.pretty_generate(all_health)
|
83
|
+
puts out
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
71
87
|
command :'server start' do |c|
|
72
88
|
c.syntax = 'xcskarel server start [options]'
|
73
89
|
c.description = 'Start local Xcode Server'
|
data/lib/karel/server.rb
CHANGED
@@ -34,6 +34,12 @@ module XCSKarel
|
|
34
34
|
JSON.parse(response.body)['results']
|
35
35
|
end
|
36
36
|
|
37
|
+
def get_health
|
38
|
+
response = get_endpoint("/health")
|
39
|
+
raise "Failed to get Health of #{@host}" if response.status != 200
|
40
|
+
JSON.parse(response.body)
|
41
|
+
end
|
42
|
+
|
37
43
|
def headers
|
38
44
|
headers = {
|
39
45
|
'user-agent' => 'xcskarel', # XCS wants user agent. for some API calls. not for others. sigh.
|
data/lib/karel/version.rb
CHANGED