hawkular-client 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9461b58571db98a5be62adf87a4b0eecb7e817f
4
- data.tar.gz: 3aa940779ef467732f5d1176a06be0194341f1d7
3
+ metadata.gz: a8d5706d902b60d4a1c404fad9f0d95e043c46eb
4
+ data.tar.gz: 10935a5c5b4a9cacee09f950590b7dea2c40a581
5
5
  SHA512:
6
- metadata.gz: 07a86f9b9b326c22dabfa8dc746a45bf5db6c3483643b85bac616bf904e07bca3f256cf97c4c8a8b2ecedbe709b1e8d2e7c62f5727ebd37633377378f614eca0
7
- data.tar.gz: 0582a5844edf3bc3657f8a6e56d133b2704fa8c4b5446aceb0372b1a5852b3aeb766e4e9628d46bc5018dff3d0f283bbeaa8aaf1edc09ba9d0f476a0297d153f
6
+ metadata.gz: d4c026030662146d6d67ce0ba3da0830a7a7f4c7edef2634bc225af17f0ae0e724aa1adae96964aa2a859e53f225d02456ca982ac5367c5864896f2bb7068294
7
+ data.tar.gz: 48aff9a3b3b0cd8e5d433b98ceb933434643d8fd58cae797a01d9b960e65a43b6c76796a0d19cb9760b9b3952c7c136e937c817137c9f665e0f1635272fa7c79
data/CHANGES.rdoc CHANGED
@@ -3,6 +3,10 @@
3
3
  This document describes the relevant changes between releases of the
4
4
  _hawkular-client_ project.
5
5
 
6
+ === V 2.2.1
7
+
8
+ * Fix a regression where URI:HTTP objects were no longer accepted as input for entrypoints.
9
+
6
10
  === V 2.2.0
7
11
 
8
12
  This release is needed to work with hawkular-services v0.0.5+
@@ -131,14 +131,16 @@ module Hawkular
131
131
  # also, this function always remove the slash at the end of the URL, so if your entrypoint is
132
132
  # http://localhost/hawkular/inventory/ this function will return http://localhost/hawkular/inventory
133
133
  # to the URL
134
- # @param entrypoint [String] base path
134
+ # @param entrypoint [String] base path (URIs are also accepted)
135
135
  # @param suffix_path [String] sufix path to be added if it doesn't exist
136
136
  # @return [String] URL with path attached to it at the end
137
137
  def normalize_entrypoint_url(entrypoint, suffix_path)
138
+ fail ArgumentError, 'suffix_path must not be empty' if suffix_path.empty?
138
139
  strip_path = suffix_path.gsub(%r{/$}, '')
139
140
  strip_path.nil? || suffix_path = strip_path
140
141
  strip_path = suffix_path.gsub(%r{^/}, '')
141
142
  strip_path.nil? || suffix_path = strip_path
143
+ entrypoint = entrypoint.to_s
142
144
  strip_entrypoint = entrypoint.gsub(%r{/$}, '')
143
145
  strip_path.nil? && strip_entrypoint = entrypoint
144
146
  relative_path_rgx = Regexp.new("\/#{Regexp.quote(suffix_path)}(\/)*$")
@@ -4,5 +4,5 @@
4
4
  # @see https://github.com/hawkular
5
5
  module Hawkular
6
6
  # Version of the Hawkular Ruby Gem
7
- VERSION = '2.2.0'
7
+ VERSION = '2.2.1'
8
8
  end
@@ -31,6 +31,32 @@ module Hawkular::Client::RSpec
31
31
  expect { @hawkular_client.inventory_lyst_feeds }.to raise_error(NoMethodError)
32
32
  end
33
33
 
34
+ context 'and URIs as input', vcr: { decode_compressed_response: true } do
35
+ it 'Should work with URI' do
36
+ uri = URI.parse HOST
37
+ opts = { tenant: 'hawkular' }
38
+
39
+ the_client = Hawkular::Client.new(entrypoint: uri, credentials: @creds, options: opts)
40
+ expect { the_client.inventory.list_feeds }.to_not raise_error
41
+ end
42
+
43
+ it 'Should work with URI on metrics client' do
44
+ uri = URI.parse HOST
45
+ opts = { tenant: 'hawkular' }
46
+
47
+ the_client = Hawkular::Metrics::Client.new(uri, @creds, opts)
48
+ expect { the_client.http_get '/status' }.to_not raise_error
49
+ end
50
+
51
+ it 'Should work with https URI on metrics client' do
52
+ uri = URI.parse 'https://localhost:8080'
53
+ opts = { tenant: 'hawkular' }
54
+
55
+ the_client = Hawkular::Metrics::Client.new(uri, @creds, opts)
56
+ expect !the_client.nil?
57
+ end
58
+ end
59
+
34
60
  context 'and Inventory client', vcr: { decode_compressed_response: true } do
35
61
  before(:all) do
36
62
  ::RSpec::Mocks.with_temporary_scope do
@@ -138,5 +138,21 @@ describe 'Base Spec' do
138
138
 
139
139
  ret = c.normalize_entrypoint_url 'http://127.0.0.1/hawkular/alerts/', 'hawkular/alerts'
140
140
  expect(ret).to eq('http://127.0.0.1/hawkular/alerts')
141
+
142
+ ret = c.normalize_entrypoint_url 'https://127.0.0.1/hawkular/alerts/', 'hawkular/alerts'
143
+ expect(ret).to eq('https://127.0.0.1/hawkular/alerts')
144
+
145
+ ret = c.normalize_entrypoint_url 'https://localhost:8080/', 'hawkular/alerts'
146
+ expect(ret).to eq('https://localhost:8080/hawkular/alerts')
147
+
148
+ expect { c.normalize_entrypoint_url 'https://localhost:8080/hawkular/alerts', '' }.to raise_error(ArgumentError)
149
+
150
+ uri = URI.parse 'https://localhost:8080/'
151
+ ret = c.normalize_entrypoint_url uri, 'hawkular/alerts'
152
+ expect(ret).to eq('https://localhost:8080/hawkular/alerts')
153
+
154
+ uri = URI.parse 'http://localhost:8080/hawkular/alerts/'
155
+ ret = c.normalize_entrypoint_url uri, '/hawkular/alerts/'
156
+ expect(ret).to eq('http://localhost:8080/hawkular/alerts')
141
157
  end
142
158
  end
@@ -0,0 +1,112 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/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
+ - hawkular
16
+ Content-Type:
17
+ - application/json
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Connection:
26
+ - keep-alive
27
+ X-Powered-By:
28
+ - Undertow/1
29
+ Server:
30
+ - WildFly/10
31
+ Content-Type:
32
+ - application/json
33
+ Content-Length:
34
+ - '234'
35
+ Date:
36
+ - Fri, 08 Jul 2016 10:39:13 GMT
37
+ body:
38
+ encoding: ASCII-8BIT
39
+ string: |-
40
+ {
41
+ "Implementation-Version" : "0.17.2.Final",
42
+ "Built-From-Git-SHA1" : "3c8ac6648aa0ec33643ae1b98faadc475d2c6f02",
43
+ "Inventory-Implementation" : "org.hawkular.inventory.impl.tinkerpop.TinkerpopInventory",
44
+ "Initialized" : "true"
45
+ }
46
+ http_version:
47
+ recorded_at: Fri, 08 Jul 2016 10:39:13 GMT
48
+ - request:
49
+ method: get
50
+ uri: http://jdoe:password@localhost:8080/hawkular/inventory/deprecated/feeds
51
+ body:
52
+ encoding: US-ASCII
53
+ string: ''
54
+ headers:
55
+ Accept:
56
+ - application/json
57
+ Accept-Encoding:
58
+ - gzip, deflate
59
+ Hawkular-Tenant:
60
+ - hawkular
61
+ Content-Type:
62
+ - application/json
63
+ User-Agent:
64
+ - Ruby
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Expires:
71
+ - '0'
72
+ Cache-Control:
73
+ - no-cache, no-store, must-revalidate
74
+ X-Powered-By:
75
+ - Undertow/1
76
+ Server:
77
+ - WildFly/10
78
+ Pragma:
79
+ - no-cache
80
+ Date:
81
+ - Fri, 08 Jul 2016 10:39:13 GMT
82
+ X-Total-Count:
83
+ - '2'
84
+ Connection:
85
+ - keep-alive
86
+ Content-Type:
87
+ - application/json
88
+ Content-Length:
89
+ - '542'
90
+ Link:
91
+ - <http://localhost:8080/hawkular/inventory/deprecated/feeds>; rel="current"
92
+ body:
93
+ encoding: ASCII-8BIT
94
+ string: |-
95
+ [ {
96
+ "path" : "/t;hawkular/f;5f040b77-8929-46f4-ace2-4da64c370a0e",
97
+ "properties" : {
98
+ "__identityHash" : "5c76e6f66a08176a1e413e9acb433f534c3e31a"
99
+ },
100
+ "identityHash" : "5c76e6f66a08176a1e413e9acb433f534c3e31a",
101
+ "id" : "5f040b77-8929-46f4-ace2-4da64c370a0e"
102
+ }, {
103
+ "path" : "/t;hawkular/f;70c798a0-6985-4f8a-a525-012d8d28e8a3",
104
+ "properties" : {
105
+ "__identityHash" : "fe2613e3b6df7c9dadc6f314e1902b1395445ceb"
106
+ },
107
+ "identityHash" : "fe2613e3b6df7c9dadc6f314e1902b1395445ceb",
108
+ "id" : "70c798a0-6985-4f8a-a525-012d8d28e8a3"
109
+ } ]
110
+ http_version:
111
+ recorded_at: Fri, 08 Jul 2016 10:39:13 GMT
112
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,42 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://jdoe:password@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
+ - hawkular
16
+ Content-Type:
17
+ - application/json
18
+ User-Agent:
19
+ - Ruby
20
+ response:
21
+ status:
22
+ code: 200
23
+ message: OK
24
+ headers:
25
+ Connection:
26
+ - keep-alive
27
+ X-Powered-By:
28
+ - Undertow/1
29
+ Server:
30
+ - WildFly/10
31
+ Content-Type:
32
+ - application/json
33
+ Content-Length:
34
+ - '133'
35
+ Date:
36
+ - Fri, 08 Jul 2016 10:39:13 GMT
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"MetricsService":"STARTED","Implementation-Version":"0.17.0.Final","Built-From-Git-SHA1":"c439d3797397425d340eac7c549e330d51fc2cac"}'
40
+ http_version:
41
+ recorded_at: Fri, 08 Jul 2016 10:39:13 GMT
42
+ recorded_with: VCR 3.0.3
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hawkular-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Libor Zoubek
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-07-05 00:00:00.000000000 Z
14
+ date: 2016-07-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
@@ -305,6 +305,8 @@ files:
305
305
  - spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_work_the_same_way_when_pushing_metric_data_to_non-existing_counter.yml
306
306
  - spec/vcr_cassettes/HawkularClient/and_Operations_client/Should_both_work_the_same_way.yml
307
307
  - spec/vcr_cassettes/HawkularClient/and_Operations_client_Should_both_work_the_same_way.json
308
+ - spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI.yml
309
+ - spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI_on_metrics_client.yml
308
310
  - spec/vcr_cassettes/Inventory/Helpers/create_url.yml
309
311
  - spec/vcr_cassettes/Inventory/Helpers/generate_some_events_for_websocket.yml
310
312
  - spec/vcr_cassettes/Inventory/Helpers/get_feeds.yml
@@ -479,6 +481,8 @@ test_files:
479
481
  - spec/vcr_cassettes/HawkularClient/and_Metrics_client/Should_both_work_the_same_way_when_pushing_metric_data_to_non-existing_counter.yml
480
482
  - spec/vcr_cassettes/HawkularClient/and_Operations_client/Should_both_work_the_same_way.yml
481
483
  - spec/vcr_cassettes/HawkularClient/and_Operations_client_Should_both_work_the_same_way.json
484
+ - spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI.yml
485
+ - spec/vcr_cassettes/HawkularClient/and_URIs_as_input/Should_work_with_URI_on_metrics_client.yml
482
486
  - spec/vcr_cassettes/Inventory/Helpers/create_url.yml
483
487
  - spec/vcr_cassettes/Inventory/Helpers/generate_some_events_for_websocket.yml
484
488
  - spec/vcr_cassettes/Inventory/Helpers/get_feeds.yml