sensu 0.25.1 → 0.25.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/sensu/api/http_handler.rb +4 -2
- data/lib/sensu/api/routes.rb +26 -22
- data/lib/sensu/constants.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53fdc73c392979cab9dbc537fe2cd118d40692c5
|
4
|
+
data.tar.gz: 0656b8f002a58d2785e0b84dc7550efeb64e8dfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93ac81536b9e6370157c0d87eaab2a22c73fc8769a0ccf44bbbeb3fa053561627470a6b60f99fc0ebe76cf889c5e092d88592eebfdc6386f107fa9898f84ab01
|
7
|
+
data.tar.gz: a23633c7703136d4b92ab344f3e4619357eee34ddb274d268fd6612ace5be433095805af92d2995bad5a1d7d3248f48feb070414fb40b0fe433dc4782ed42f6e
|
data/CHANGELOG.md
CHANGED
@@ -172,7 +172,7 @@ module Sensu
|
|
172
172
|
def respond
|
173
173
|
@response.status = @response_status || 200
|
174
174
|
@response.status_string = @response_status_string || "OK"
|
175
|
-
if @response_content
|
175
|
+
if @response_content && @http_request_method != HEAD_METHOD
|
176
176
|
@response.content_type "application/json"
|
177
177
|
@response.content = Sensu::JSON.dump(@response_content)
|
178
178
|
end
|
@@ -305,7 +305,7 @@ module Sensu
|
|
305
305
|
def route_request
|
306
306
|
if @http_request_method == OPTIONS_METHOD
|
307
307
|
respond
|
308
|
-
|
308
|
+
elsif ROUTES.has_key?(@http_request_method)
|
309
309
|
route = ROUTES[@http_request_method].detect do |route|
|
310
310
|
@http_request_uri =~ route[0]
|
311
311
|
end
|
@@ -314,6 +314,8 @@ module Sensu
|
|
314
314
|
else
|
315
315
|
not_found!
|
316
316
|
end
|
317
|
+
else
|
318
|
+
not_found!
|
317
319
|
end
|
318
320
|
end
|
319
321
|
|
data/lib/sensu/api/routes.rb
CHANGED
@@ -24,33 +24,37 @@ module Sensu
|
|
24
24
|
include Results
|
25
25
|
|
26
26
|
GET_METHOD = "GET".freeze
|
27
|
+
HEAD_METHOD = "HEAD".freeze
|
27
28
|
POST_METHOD = "POST".freeze
|
28
29
|
DELETE_METHOD = "DELETE".freeze
|
29
30
|
OPTIONS_METHOD = "OPTIONS".freeze
|
30
31
|
|
32
|
+
GET_ROUTES = [
|
33
|
+
[INFO_URI, :get_info],
|
34
|
+
[HEALTH_URI, :get_health],
|
35
|
+
[CLIENTS_URI, :get_clients],
|
36
|
+
[CLIENT_URI, :get_client],
|
37
|
+
[CLIENT_HISTORY_URI, :get_client_history],
|
38
|
+
[CHECKS_URI, :get_checks],
|
39
|
+
[CHECK_URI, :get_check],
|
40
|
+
[EVENTS_URI, :get_events],
|
41
|
+
[EVENTS_CLIENT_URI, :get_events_client],
|
42
|
+
[EVENT_URI, :get_event],
|
43
|
+
[AGGREGATES_URI, :get_aggregates],
|
44
|
+
[AGGREGATE_URI, :get_aggregate],
|
45
|
+
[AGGREGATE_CLIENTS_URI, :get_aggregate_clients],
|
46
|
+
[AGGREGATE_CHECKS_URI, :get_aggregate_checks],
|
47
|
+
[AGGREGATE_RESULTS_SEVERITY_URI, :get_aggregate_results_severity],
|
48
|
+
[STASHES_URI, :get_stashes],
|
49
|
+
[STASH_URI, :get_stash],
|
50
|
+
[RESULTS_URI, :get_results],
|
51
|
+
[RESULTS_CLIENT_URI, :get_results_client],
|
52
|
+
[RESULT_URI, :get_result]
|
53
|
+
]
|
54
|
+
|
31
55
|
ROUTES = {
|
32
|
-
GET_METHOD =>
|
33
|
-
|
34
|
-
[HEALTH_URI, :get_health],
|
35
|
-
[CLIENTS_URI, :get_clients],
|
36
|
-
[CLIENT_URI, :get_client],
|
37
|
-
[CLIENT_HISTORY_URI, :get_client_history],
|
38
|
-
[CHECKS_URI, :get_checks],
|
39
|
-
[CHECK_URI, :get_check],
|
40
|
-
[EVENTS_URI, :get_events],
|
41
|
-
[EVENTS_CLIENT_URI, :get_events_client],
|
42
|
-
[EVENT_URI, :get_event],
|
43
|
-
[AGGREGATES_URI, :get_aggregates],
|
44
|
-
[AGGREGATE_URI, :get_aggregate],
|
45
|
-
[AGGREGATE_CLIENTS_URI, :get_aggregate_clients],
|
46
|
-
[AGGREGATE_CHECKS_URI, :get_aggregate_checks],
|
47
|
-
[AGGREGATE_RESULTS_SEVERITY_URI, :get_aggregate_results_severity],
|
48
|
-
[STASHES_URI, :get_stashes],
|
49
|
-
[STASH_URI, :get_stash],
|
50
|
-
[RESULTS_URI, :get_results],
|
51
|
-
[RESULTS_CLIENT_URI, :get_results_client],
|
52
|
-
[RESULT_URI, :get_result]
|
53
|
-
],
|
56
|
+
GET_METHOD => GET_ROUTES,
|
57
|
+
HEAD_METHOD => GET_ROUTES,
|
54
58
|
POST_METHOD => [
|
55
59
|
[CLIENTS_URI, :post_clients],
|
56
60
|
[REQUEST_URI, :post_request],
|
data/lib/sensu/constants.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.25.
|
4
|
+
version: 0.25.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Porter
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-06-
|
12
|
+
date: 2016-06-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|