hawkular-client 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -3
  3. data/CHANGES.rdoc +8 -0
  4. data/README.rdoc +12 -5
  5. data/hawkularclient.gemspec +2 -2
  6. data/lib/alerts/alerts_api.rb +193 -0
  7. data/lib/{hawkularclient.rb → hawkular.rb} +93 -52
  8. data/lib/hawkular_all.rb +7 -0
  9. data/lib/inventory/inventory_api.rb +378 -0
  10. data/lib/metrics/metric_api.rb +20 -10
  11. data/lib/metrics/metrics_client.rb +52 -0
  12. data/lib/metrics/tenant_api.rb +1 -1
  13. data/lib/metrics/version.rb +3 -1
  14. data/lib/version.rb +8 -0
  15. data/spec/integration/alerts_spec.rb +143 -0
  16. data/spec/integration/inventory_spec.rb +191 -0
  17. data/spec/integration/metric_spec.rb +33 -0
  18. data/spec/spec_helper.rb +14 -1
  19. data/spec/unit/base_spec.rb +57 -0
  20. data/spec/vcr_cassettes/Alert/Alerts/Should_acknowledge_an_alert.yml +183 -0
  21. data/spec/vcr_cassettes/Alert/Alerts/Should_fetch_single_alert.yml +69 -0
  22. data/spec/vcr_cassettes/Alert/Alerts/Should_list_alerts.yml +85 -0
  23. data/spec/vcr_cassettes/Alert/Alerts/Should_list_alerts_for_trigger.yml +142 -0
  24. data/spec/vcr_cassettes/Alert/Alerts/Should_list_alerts_for_unknown_trigger.yml +46 -0
  25. data/spec/vcr_cassettes/Alert/Alerts/Should_resolve_an_alert.yml +181 -0
  26. data/spec/vcr_cassettes/Alert/Alerts/Should_resolve_an_alert2.yml +49 -0
  27. data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers.yml +62 -0
  28. data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers_for_ID.yml +55 -0
  29. data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers_for_Tag.yml +68 -0
  30. data/spec/vcr_cassettes/Alert/Triggers/Should_List_Triggers_for_Tags.yml +68 -0
  31. data/spec/vcr_cassettes/Alert/Triggers/Should_get_a_single_Trigger_with_conditions.yml +138 -0
  32. data/spec/vcr_cassettes/Alert/Triggers/Should_get_a_single_metric_Trigger.yml +50 -0
  33. data/spec/vcr_cassettes/Gauge_metrics/Platform_mem.yml +44 -0
  34. data/spec/vcr_cassettes/Gauge_metrics/Platform_mem_def.yml +45 -0
  35. data/spec/vcr_cassettes/Inventory/Should_List_datasources_with_no_props.yml +228 -0
  36. data/spec/vcr_cassettes/Inventory/Should_list_URLs.yml +105 -0
  37. data/spec/vcr_cassettes/Inventory/Should_list_WildFlys.yml +104 -0
  38. data/spec/vcr_cassettes/Inventory/Should_list_WildFlys_with_props.yml +162 -0
  39. data/spec/vcr_cassettes/Inventory/Should_list_children_of_WildFly.yml +180 -0
  40. data/spec/vcr_cassettes/Inventory/Should_list_feeds.yml +102 -0
  41. data/spec/vcr_cassettes/Inventory/Should_list_heap_metrics_for_WildFlys.yml +308 -0
  42. data/spec/vcr_cassettes/Inventory/Should_list_metrics_for_WildFlys.yml +172 -0
  43. data/spec/vcr_cassettes/Inventory/Should_list_types_with_bad_feed.yml +101 -0
  44. data/spec/vcr_cassettes/Inventory/Should_list_types_with_feed.yml +109 -0
  45. data/spec/vcr_cassettes/Inventory/Should_list_types_without_feed.yml +110 -0
  46. data/spec/vcr_cassettes/Metrics/Status.yml +44 -0
  47. data/spec/vcr_cassettes/No_Tenant/Should_fail.yml +42 -0
  48. data/spec/vcr_cassettes/Tenants/Should_Get_Tenant_For_Explicit_Credentials.yml +50 -0
  49. data/spec/vcr_cassettes/Tenants/Should_Get_Tenant_For_Implicit_Credentials.yml +50 -0
  50. metadata +74 -3
@@ -0,0 +1,101 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/tenant
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Encoding:
24
+ - gzip
25
+ Expires:
26
+ - '0'
27
+ Cache-Control:
28
+ - no-cache, no-store, must-revalidate
29
+ X-Powered-By:
30
+ - Undertow/1
31
+ Server:
32
+ - WildFly/9
33
+ Pragma:
34
+ - no-cache
35
+ Date:
36
+ - Fri, 06 Nov 2015 19:45:47 GMT
37
+ Connection:
38
+ - keep-alive
39
+ Content-Type:
40
+ - application/json
41
+ Content-Length:
42
+ - '85'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: !binary |-
46
+ H4sIAAAAAAAAAKvmUlBQKkgsyVBSsFJQ0i+xNrIwMDJLMjbTtUhLNdE1MTY2
47
+ 0rUwSbbQNTUySTU0N040s0hKU9IB6cpMAeshSgNXLQAnmwH5aQAAAA==
48
+ http_version:
49
+ recorded_at: Fri, 06 Nov 2015 19:45:47 GMT
50
+ - request:
51
+ method: get
52
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/does%20not%20exist/resourceTypes
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ Accept:
58
+ - application/json
59
+ Accept-Encoding:
60
+ - gzip, deflate
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Ruby
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Content-Encoding:
71
+ - gzip
72
+ Expires:
73
+ - '0'
74
+ Cache-Control:
75
+ - no-cache, no-store, must-revalidate
76
+ X-Powered-By:
77
+ - Undertow/1
78
+ Server:
79
+ - WildFly/9
80
+ Pragma:
81
+ - no-cache
82
+ Date:
83
+ - Fri, 06 Nov 2015 19:45:47 GMT
84
+ X-Total-Count:
85
+ - '-1'
86
+ Connection:
87
+ - keep-alive
88
+ Content-Type:
89
+ - application/json
90
+ Content-Length:
91
+ - '23'
92
+ Link:
93
+ - <http://localhost:8080/hawkular/inventory/feeds/does%20not%20exist/resourceTypes>;
94
+ rel="current"
95
+ body:
96
+ encoding: ASCII-8BIT
97
+ string: !binary |-
98
+ H4sIAAAAAAAAAItWiAUAqBH2HwMAAAA=
99
+ http_version:
100
+ recorded_at: Fri, 06 Nov 2015 19:45:47 GMT
101
+ recorded_with: VCR 3.0.0
@@ -0,0 +1,109 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/tenant
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Encoding:
24
+ - gzip
25
+ Expires:
26
+ - '0'
27
+ Cache-Control:
28
+ - no-cache, no-store, must-revalidate
29
+ X-Powered-By:
30
+ - Undertow/1
31
+ Server:
32
+ - WildFly/9
33
+ Pragma:
34
+ - no-cache
35
+ Date:
36
+ - Fri, 06 Nov 2015 19:45:46 GMT
37
+ Connection:
38
+ - keep-alive
39
+ Content-Type:
40
+ - application/json
41
+ Content-Length:
42
+ - '85'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: !binary |-
46
+ H4sIAAAAAAAAAKvmUlBQKkgsyVBSsFJQ0i+xNrIwMDJLMjbTtUhLNdE1MTY2
47
+ 0rUwSbbQNTUySTU0N040s0hKU9IB6cpMAeshSgNXLQAnmwH5aQAAAA==
48
+ http_version:
49
+ recorded_at: Fri, 06 Nov 2015 19:45:46 GMT
50
+ - request:
51
+ method: get
52
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/feeds/snert/resourceTypes
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ Accept:
58
+ - application/json
59
+ Accept-Encoding:
60
+ - gzip, deflate
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Ruby
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Content-Encoding:
71
+ - gzip
72
+ Expires:
73
+ - '0'
74
+ Cache-Control:
75
+ - no-cache, no-store, must-revalidate
76
+ X-Powered-By:
77
+ - Undertow/1
78
+ Server:
79
+ - WildFly/9
80
+ Pragma:
81
+ - no-cache
82
+ Date:
83
+ - Fri, 06 Nov 2015 19:45:47 GMT
84
+ X-Total-Count:
85
+ - '16'
86
+ Connection:
87
+ - keep-alive
88
+ Content-Type:
89
+ - application/json
90
+ Content-Length:
91
+ - '438'
92
+ Link:
93
+ - <http://localhost:8080/hawkular/inventory/feeds/snert/resourceTypes>; rel="current"
94
+ body:
95
+ encoding: ASCII-8BIT
96
+ string: !binary |-
97
+ H4sIAAAAAAAAAK2UwWuDMBjF7/0rgrBbxU5dJ/M015VRKBt0sMPYIbWfnVRj
98
+ SeKGjP7vizbaGO0tN3nvkfx4+fw+0d8EIeuI+beFHpDl8NANZu58683tIAHf
99
+ 9j3PtQM/Duw714fbew/Pg23iQMiBcScJGQHKHcrD1yNQzFOyv3Fnm4pxyK1p
100
+ fTTBOTRHdwGk2ulu3JycpsbQlmkGNRUvKGhQtYUUQ+IoskmQN1rEwFhBNQpN
101
+ lxAX1STDGvKCVhqAKsrbpWTy6o802y2zqn4KoD+gtyBtpJoSRrNMQi0wx6wo
102
+ aayPhm5IFEU2ibFaRE+imAVNh8XUHlIdiaLqRiuBY1ZUORCuV6IZbSUX2eyk
103
+ Mob30LZCxMfzKhpMbhM610BQF+imeGCbRNxwzCETdzQzzVhajFN2OSRTA9Dx
104
+ hFFW8e9koD9pT21ZpGb0drHbxZnX+mndYS89xyhRub066CNey9NzTPK8U0wY
105
+ jvl5htaYiLnVN4GSQb2EpBvzTTK+4N9DmWEqAOuVnDTL/HE/LLANIhlDSkiy
106
+ XomYxI3K+seMaHEYNCkspBoSSpEnJ/T1D7vku9gfCQAA
107
+ http_version:
108
+ recorded_at: Fri, 06 Nov 2015 19:45:47 GMT
109
+ recorded_with: VCR 3.0.0
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/tenant
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Encoding:
24
+ - gzip
25
+ Expires:
26
+ - '0'
27
+ Cache-Control:
28
+ - no-cache, no-store, must-revalidate
29
+ X-Powered-By:
30
+ - Undertow/1
31
+ Server:
32
+ - WildFly/9
33
+ Pragma:
34
+ - no-cache
35
+ Date:
36
+ - Fri, 06 Nov 2015 15:31:36 GMT
37
+ Connection:
38
+ - keep-alive
39
+ Content-Type:
40
+ - application/json
41
+ Content-Length:
42
+ - '85'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: !binary |-
46
+ H4sIAAAAAAAAAKvmUlBQKkgsyVBSsFJQ0i+xNrIwMDJLMjbTtUhLNdE1MTY2
47
+ 0rUwSbbQNTUySTU0N040s0hKU9IB6cpMAeshSgNXLQAnmwH5aQAAAA==
48
+ http_version:
49
+ recorded_at: Fri, 06 Nov 2015 15:31:36 GMT
50
+ - request:
51
+ method: get
52
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes
53
+ body:
54
+ encoding: US-ASCII
55
+ string: ''
56
+ headers:
57
+ Accept:
58
+ - application/json
59
+ Accept-Encoding:
60
+ - gzip, deflate
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Ruby
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Content-Encoding:
71
+ - gzip
72
+ Expires:
73
+ - '0'
74
+ Cache-Control:
75
+ - no-cache, no-store, must-revalidate
76
+ X-Powered-By:
77
+ - Undertow/1
78
+ Server:
79
+ - WildFly/9
80
+ Pragma:
81
+ - no-cache
82
+ Date:
83
+ - Fri, 06 Nov 2015 15:31:43 GMT
84
+ X-Total-Count:
85
+ - '17'
86
+ Connection:
87
+ - keep-alive
88
+ Content-Type:
89
+ - application/json
90
+ Content-Length:
91
+ - '455'
92
+ Link:
93
+ - <http://localhost:8080/hawkular/inventory/resourceTypes>; rel="current"
94
+ body:
95
+ encoding: ASCII-8BIT
96
+ string: !binary |-
97
+ H4sIAAAAAAAAAK2UX0/CMBTF3/kUzRLfWMBt4uKenEgMkWhE44PxoYw7XNgf
98
+ 0nYaYvjutqMbXTdeTN/gnLPeX87u+oF+BwhZO8y+LHSDrBELHH/sTFbuxPZj
99
+ 8GzPdR3b9yLfvnI8uLx28cRfxSPCgreXR2soHk7W1aPi/+Aw/OeBEDCgbBQH
100
+ NAfCxPlPOyCYJfnmwhkv95RBdhyX4wyqo5sAUm1J0zFNos2SFAQVKwhoUMJC
101
+ iiFxFNkkyDMpIqC0IBqFpkuIk2qSYQFZQfYagCrK6VIyOfo9SdezdC9eBZBv
102
+ 0FuQNlJNCaNZJqGmmGFalCTSV0M3JIoim8SYT8M7XsyUJN1ihIdUR6KoutFK
103
+ YJcW+wxypleiGXUlJ9nsplKKN1C3kvMf9/Ows7lV6FhDjppAs8Ud2yTikmEG
104
+ KZ9R7TSlSdFP2eSQTHVA+xNGWfm3k4L+SltqzSI1o9P53c7PPNdP7XZ7aTlG
105
+ icrV2UXv8WqelmOS55XgnOKIHXdogXO+t/pNoGRQKyHp+nyTjA/4Z1ummHBA
106
+ cSXH1WV+u+kWWAeRjCElJFnPREzihqX4MENSbDtNcguphoRS5MEBff4BYg+j
107
+ FXAJAAA=
108
+ http_version:
109
+ recorded_at: Fri, 06 Nov 2015 15:31:43 GMT
110
+ recorded_with: VCR 3.0.0
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:8080/hawkular/metrics/status
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Hawkular-Tenant:
15
+ - vcr-test-tenant-123
16
+ Tenantid:
17
+ - vcr-test-tenant-123
18
+ Content-Type:
19
+ - application/json
20
+ User-Agent:
21
+ - Ruby
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ Connection:
28
+ - keep-alive
29
+ X-Powered-By:
30
+ - Undertow/1
31
+ Server:
32
+ - WildFly/9
33
+ Content-Type:
34
+ - application/json
35
+ Content-Length:
36
+ - '187'
37
+ Date:
38
+ - Tue, 10 Nov 2015 11:13:50 GMT
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"MetricsService":"STARTING","Implementation-Version":"0.9.0.Final-SRC-revision-9080fcfbe40a66ce8143c477b5d6f8fbadeecf3a","Built-From-Git-SHA1":"9080fcfbe40a66ce8143c477b5d6f8fbadeecf3a"}'
42
+ http_version:
43
+ recorded_at: Tue, 10 Nov 2015 11:13:50 GMT
44
+ recorded_with: VCR 3.0.0
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://localhost:8080/hawkular/metrics/counters/<%= id %>/data
6
+ body:
7
+ encoding: UTF-8
8
+ string: '[{"value":4,"timestamp":1446743049207}]'
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ Content-Length:
17
+ - '39'
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 400
23
+ message: Bad Request
24
+ headers:
25
+ Connection:
26
+ - keep-alive
27
+ X-Powered-By:
28
+ - Undertow/1
29
+ Server:
30
+ - WildFly/9
31
+ Content-Type:
32
+ - application/json
33
+ Content-Length:
34
+ - '69'
35
+ Date:
36
+ - Thu, 05 Nov 2015 17:04:09 GMT
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"errorMsg":"Tenant is not specified. Use ''Hawkular-Tenant'' header."}'
40
+ http_version:
41
+ recorded_at: Thu, 05 Nov 2015 17:04:09 GMT
42
+ recorded_with: VCR 3.0.0
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/tenant
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ Content-Type:
15
+ - application/json
16
+ User-Agent:
17
+ - Ruby
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Content-Encoding:
24
+ - gzip
25
+ Expires:
26
+ - '0'
27
+ Cache-Control:
28
+ - no-cache, no-store, must-revalidate
29
+ X-Powered-By:
30
+ - Undertow/1
31
+ Server:
32
+ - WildFly/9
33
+ Pragma:
34
+ - no-cache
35
+ Date:
36
+ - Fri, 06 Nov 2015 13:18:44 GMT
37
+ Connection:
38
+ - keep-alive
39
+ Content-Type:
40
+ - application/json
41
+ Content-Length:
42
+ - '85'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: !binary |-
46
+ H4sIAAAAAAAAAKvmUlBQKkgsyVBSsFJQ0i+xNrIwMDJLMjbTtUhLNdE1MTY2
47
+ 0rUwSbbQNTUySTU0N040s0hKU9IB6cpMAeshSgNXLQAnmwH5aQAAAA==
48
+ http_version:
49
+ recorded_at: Fri, 06 Nov 2015 13:18:44 GMT
50
+ recorded_with: VCR 3.0.0