influxdb-client 1.17.0.pre.3024 → 2.0.0.pre.3196
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/README.md +18 -2
- data/lib/influxdb2/client/client.rb +2 -0
- data/lib/influxdb2/client/default_api.rb +19 -7
- data/lib/influxdb2/client/flux_csv_parser.rb +8 -1
- data/lib/influxdb2/client/version.rb +1 -1
- data/test/influxdb/flux_csv_parser_test.rb +27 -2
- data/test/influxdb/redirect_test.rb +145 -0
- data/test/influxdb/write_api_test.rb +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33f286d2a281bd72623ee0284de96e20aebfc433a39642478c43f31d0258ee50
|
4
|
+
data.tar.gz: 98d9e3ddc4d6e892daa5bfeba7601af15e4c4da0440ad1ea8fa0d7740e38e21a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2f655f21aa5f143abc469b653a90bc9ca381371ad4c60d2bf35fc7019e0e1b6f8ce3d4403f30acaff03a134b0d31bc42c7001dc893dd5db9ad7d08b705dbfbc
|
7
|
+
data.tar.gz: 95f5b211418be1dd31067dd7f266cbb2a57dc8736e66147908ae6c5edf48036ed021ae299915b04c3d19783d1962f487623f01881bceb27dba08f8d60696170e
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,19 @@
|
|
1
|
-
##
|
1
|
+
## 2.0.0 [unreleased]
|
2
|
+
|
3
|
+
### Breaking Changes
|
4
|
+
Due to a security reason `Authorization` header is not forwarded when redirect leads to a different domain.
|
5
|
+
To overcome this limitation you have to set the client property `redirect_forward_authorization` to `true`.
|
6
|
+
|
7
|
+
### Features
|
8
|
+
1. [#89](https://github.com/influxdata/influxdb-client-ruby/pull/89): `Authorization` header is not forwarded when redirect leads to a different domain
|
9
|
+
|
10
|
+
### Bug Fixes
|
11
|
+
1. [#89](https://github.com/influxdata/influxdb-client-ruby/pull/89): Correct redirect location
|
12
|
+
|
13
|
+
## 1.17.0 [2021-08-20]
|
14
|
+
|
15
|
+
### Bug Fixes
|
16
|
+
1. [#87](https://github.com/influxdata/influxdb-client-ruby/pull/87): Parsing infinite numbers
|
2
17
|
|
3
18
|
## 1.16.0 [2021-07-09]
|
4
19
|
|
data/README.md
CHANGED
@@ -23,6 +23,7 @@ This repository contains the reference Ruby client for the InfluxDB 2.0.
|
|
23
23
|
- [Management API](#management-api)
|
24
24
|
- [Advanced Usage](#advanced-usage)
|
25
25
|
- [Default Tags](#default-tags)
|
26
|
+
- [Proxy configuration](#proxy-configuration)
|
26
27
|
- [Contributing](#contributing)
|
27
28
|
- [License](#license)
|
28
29
|
|
@@ -63,13 +64,13 @@ The client can be installed manually or with bundler.
|
|
63
64
|
To install the client gem manually:
|
64
65
|
|
65
66
|
```
|
66
|
-
gem install influxdb-client -v 1.
|
67
|
+
gem install influxdb-client -v 1.17.0
|
67
68
|
```
|
68
69
|
|
69
70
|
For management API:
|
70
71
|
|
71
72
|
```
|
72
|
-
gem install influxdb-client-apis -v 1.
|
73
|
+
gem install influxdb-client-apis -v 1.17.0
|
73
74
|
```
|
74
75
|
|
75
76
|
## Usage
|
@@ -93,6 +94,7 @@ client = InfluxDB2::Client.new('https://localhost:8086', 'my-token')
|
|
93
94
|
| write_timeout | Number of seconds to wait for one block of data to be written | Integer | 10 |
|
94
95
|
| read_timeout | Number of seconds to wait for one block of data to be read | Integer | 10 |
|
95
96
|
| max_redirect_count | Maximal number of followed HTTP redirects | Integer | 10 |
|
97
|
+
| redirect_forward_authorization | Pass Authorization header to different domain during HTTP redirect. | bool | false |
|
96
98
|
| use_ssl | Turn on/off SSL for HTTP communication | bool | true |
|
97
99
|
| verify_mode | Sets the flags for the certification verification at beginning of SSL/TLS session. | `OpenSSL::SSL::VERIFY_NONE` or `OpenSSL::SSL::VERIFY_PEER` | none |
|
98
100
|
|
@@ -400,6 +402,20 @@ client.close!
|
|
400
402
|
|
401
403
|
Server availability can be checked using the `client.health` method. That is equivalent of the [influx ping](https://v2.docs.influxdata.com/v2.0/reference/cli/influx/ping/).
|
402
404
|
|
405
|
+
### Proxy configuration
|
406
|
+
|
407
|
+
You can configure the client to tunnel requests through an HTTP proxy. To configure the proxy use a `http_proxy` environment variable.
|
408
|
+
|
409
|
+
```ruby
|
410
|
+
ENV['HTTP_PROXY'] = 'http://my-user:my-password@my-proxy:8099'
|
411
|
+
```
|
412
|
+
|
413
|
+
Client automatically follows HTTP redirects. The default redirect policy is to follow up to 10 consecutive requests.
|
414
|
+
You can configure redirect counts by the client property: `max_redirect_count`.
|
415
|
+
|
416
|
+
Due to a security reason `Authorization` header is not forwarded when redirect leads to a different domain.
|
417
|
+
To overcome this limitation you have to set the client property `redirect_forward_authorization` to `true`.
|
418
|
+
|
403
419
|
### InfluxDB 1.8 API compatibility
|
404
420
|
|
405
421
|
[InfluxDB 1.8.0 introduced forward compatibility APIs](https://docs.influxdata.com/influxdb/v1.8/tools/api/#influxdb-2-0-api-compatibility-endpoints) for InfluxDB 2.0. This allow you to easily move from InfluxDB 1.x to InfluxDB 2.0 Cloud or open source.
|
@@ -42,6 +42,8 @@ module InfluxDB2
|
|
42
42
|
# @option options [Integer] :write_timeout Number of seconds to wait for one block of data to be written
|
43
43
|
# @option options [Integer] :read_timeout Number of seconds to wait for one block of data to be read
|
44
44
|
# @option options [Integer] :max_redirect_count Maximal number of followed HTTP redirects
|
45
|
+
# @option options [bool] :redirect_forward_authorization Pass Authorization header to different domain
|
46
|
+
# during HTTP redirect.
|
45
47
|
# @option options [bool] :use_ssl Turn on/off SSL for HTTP communication
|
46
48
|
# @option options [Integer] :verify_mode Sets the flags for the certification verification
|
47
49
|
# at beginning of SSL/TLS session. Could be one of `OpenSSL::SSL::VERIFY_NONE` or `OpenSSL::SSL::VERIFY_PEER`.
|
@@ -73,21 +73,24 @@ module InfluxDB2
|
|
73
73
|
_post(payload, uri, headers: headers.merge(HEADER_CONTENT_TYPE => 'text/plain'))
|
74
74
|
end
|
75
75
|
|
76
|
-
def _post(payload, uri, limit: @max_redirect_count, headers: {})
|
77
|
-
_request(payload, uri, limit: limit,
|
76
|
+
def _post(payload, uri, limit: @max_redirect_count, add_authorization: true, headers: {})
|
77
|
+
_request(payload, uri, limit: limit, add_authorization: add_authorization,
|
78
|
+
headers: headers, request: Net::HTTP::Post)
|
78
79
|
end
|
79
80
|
|
80
|
-
def _get(uri, limit: @max_redirect_count, headers: {})
|
81
|
-
_request(nil, uri, limit: limit,
|
81
|
+
def _get(uri, limit: @max_redirect_count, add_authorization: true, headers: {})
|
82
|
+
_request(nil, uri, limit: limit, add_authorization: add_authorization,
|
83
|
+
headers: headers.merge('Accept' => 'application/json'), request: Net::HTTP::Get)
|
82
84
|
end
|
83
85
|
|
84
|
-
def _request(payload, uri, limit: @max_redirect_count, headers: {},
|
86
|
+
def _request(payload, uri, limit: @max_redirect_count, add_authorization: true, headers: {},
|
87
|
+
request: Net::HTTP::Post)
|
85
88
|
raise InfluxError.from_message("Too many HTTP redirects. Exceeded limit: #{@max_redirect_count}") if limit.zero?
|
86
89
|
|
87
90
|
http = _prepare_http_client(uri)
|
88
91
|
|
89
92
|
request = request.new(uri.request_uri)
|
90
|
-
request['Authorization'] = "Token #{@options[:token]}"
|
93
|
+
request['Authorization'] = "Token #{@options[:token]}" if add_authorization
|
91
94
|
request['User-Agent'] = "influxdb-client-ruby/#{InfluxDB2::VERSION}"
|
92
95
|
headers.each { |k, v| request[k] = v }
|
93
96
|
|
@@ -100,7 +103,16 @@ module InfluxDB2
|
|
100
103
|
response
|
101
104
|
when Net::HTTPRedirection then
|
102
105
|
location = response['location']
|
103
|
-
|
106
|
+
redirect_forward_authorization = @options[:redirect_forward_authorization] || false
|
107
|
+
|
108
|
+
uri_redirect = URI.parse(location)
|
109
|
+
uri_redirect.query = uri.query
|
110
|
+
uri_redirect.path = File.join(uri_redirect.path, uri.path)
|
111
|
+
|
112
|
+
redirect_forward_authorization ||= (uri_redirect.host == uri.host) && (uri_redirect.port == uri.port)
|
113
|
+
|
114
|
+
_post(payload, uri_redirect, limit: limit - 1, add_authorization: redirect_forward_authorization,
|
115
|
+
headers: headers)
|
104
116
|
else
|
105
117
|
raise InfluxError.from_response(response)
|
106
118
|
end
|
@@ -240,7 +240,14 @@ module InfluxDB2
|
|
240
240
|
when 'unsignedLong', 'long', 'duration'
|
241
241
|
str_val.to_i
|
242
242
|
when 'double'
|
243
|
-
str_val
|
243
|
+
case str_val
|
244
|
+
when '+Inf'
|
245
|
+
Float::INFINITY
|
246
|
+
when '-Inf'
|
247
|
+
-Float::INFINITY
|
248
|
+
else
|
249
|
+
str_val.to_f
|
250
|
+
end
|
244
251
|
when 'base64Binary'
|
245
252
|
Base64.decode64(str_val)
|
246
253
|
when 'dateTime:RFC3339', 'dateTime:RFC3339Nano'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# The MIT
|
1
|
+
# The MIT
|
2
2
|
#
|
3
3
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
# of this software and associated documentation files (the "Software"), to deal
|
@@ -166,7 +166,7 @@ class FluxCsvParserTest < MiniTest::Test
|
|
166
166
|
"#default,mean,,,,,,,,,,,\n" \
|
167
167
|
",result,table,_start,_stop,_time,_value,_field,_measurement,language,license,name,owner\n" \
|
168
168
|
',,0,2020-11-02T07:29:49.55050738Z,2020-12-02T07:29:49.55050738Z,2020-11-02T09:00:00Z,9,' \
|
169
|
-
"stars,
|
169
|
+
"stars,gh,Ruby,MIT,influxdb-client-ruby,influxdata\n"
|
170
170
|
|
171
171
|
tables = InfluxDB2::FluxCsvParser.new(data).parse.tables
|
172
172
|
records = tables[0].records
|
@@ -464,4 +464,29 @@ class FluxCsvParserErrorTest < MiniTest::Test
|
|
464
464
|
assert_equal true, tables[0].columns[2].group
|
465
465
|
assert_equal 1, tables[1].records.size
|
466
466
|
end
|
467
|
+
|
468
|
+
def test_parse_infinity
|
469
|
+
data = '#group,false,false,true,true,true,true,true,true,true,true,false,false
|
470
|
+
#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,string,string,string,double,double
|
471
|
+
#default,_result,,,,,,,,,,,
|
472
|
+
,result,table,_start,_stop,_field,_measurement,language,license,name,owner,le,_value
|
473
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,0,0
|
474
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,10,0
|
475
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,20,0
|
476
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,30,0
|
477
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,40,0
|
478
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,50,0
|
479
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,60,0
|
480
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,70,0
|
481
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,80,0
|
482
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,90,0
|
483
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,+Inf,15
|
484
|
+
,,0,2021-06-23T06:50:11.897825012Z,2021-06-25T06:50:11.897825012Z,stars,gh,C#,MIT,ruby,influxdata,-Inf,15'
|
485
|
+
|
486
|
+
tables = InfluxDB2::FluxCsvParser.new(data).parse.tables
|
487
|
+
assert_equal 1, tables.size
|
488
|
+
assert_equal 12, tables[0].records.size
|
489
|
+
assert_equal tables[0].records[10].values['le'], Float::INFINITY
|
490
|
+
assert_equal tables[0].records[11].values['le'], -Float::INFINITY
|
491
|
+
end
|
467
492
|
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
# The MIT License
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
# of this software and associated documentation files (the "Software"), to deal
|
5
|
+
# in the Software without restriction, including without limitation the rights
|
6
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
# copies of the Software, and to permit persons to whom the Software is
|
8
|
+
# furnished to do so, subject to the following conditions:
|
9
|
+
#
|
10
|
+
# The above copyright notice and this permission notice shall be included in
|
11
|
+
# all copies or substantial portions of the Software.
|
12
|
+
#
|
13
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
# THE SOFTWARE.
|
20
|
+
|
21
|
+
require 'test_helper'
|
22
|
+
|
23
|
+
class WriteApiTest < MiniTest::Test
|
24
|
+
def setup
|
25
|
+
WebMock.disable_net_connect!
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_redirect_same
|
29
|
+
stub_request(:any, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
30
|
+
.to_return(status: 307, headers:
|
31
|
+
{ 'location' => 'http://localhost:8086' })
|
32
|
+
.then.to_return(status: 204)
|
33
|
+
stub_request(:any, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
34
|
+
.to_return(status: 204)
|
35
|
+
|
36
|
+
client = InfluxDB2::Client.new('http://localhost:8086', 'my-token',
|
37
|
+
bucket: 'my-bucket',
|
38
|
+
org: 'my-org',
|
39
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND,
|
40
|
+
use_ssl: false)
|
41
|
+
|
42
|
+
client.create_write_api.write(data: 'h2o,location=west value=33i 15')
|
43
|
+
|
44
|
+
headers = {
|
45
|
+
'Authorization' => 'Token my-token',
|
46
|
+
'User-Agent' => "influxdb-client-ruby/#{InfluxDB2::VERSION}",
|
47
|
+
'Content-Type' => 'text/plain'
|
48
|
+
}
|
49
|
+
|
50
|
+
assert_requested(:post, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
51
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_redirect_301
|
55
|
+
stub_request(:any, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
56
|
+
.to_return(status: 301, headers:
|
57
|
+
{ 'location' => 'http://localhost:9090/' })
|
58
|
+
.then.to_return(status: 204)
|
59
|
+
stub_request(:any, 'http://localhost:9090/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
60
|
+
.to_return(status: 204)
|
61
|
+
|
62
|
+
client = InfluxDB2::Client.new('http://localhost:8086', 'my-token',
|
63
|
+
bucket: 'my-bucket',
|
64
|
+
org: 'my-org',
|
65
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND,
|
66
|
+
use_ssl: false)
|
67
|
+
|
68
|
+
client.create_write_api.write(data: 'h2o,location=west value=33i 15')
|
69
|
+
|
70
|
+
headers = {
|
71
|
+
'Authorization' => 'Token my-token',
|
72
|
+
'User-Agent' => "influxdb-client-ruby/#{InfluxDB2::VERSION}",
|
73
|
+
'Content-Type' => 'text/plain'
|
74
|
+
}
|
75
|
+
|
76
|
+
assert_requested(:post, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
77
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
78
|
+
|
79
|
+
assert_not_requested(:post, 'http://localhost:9090/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
80
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
81
|
+
|
82
|
+
assert_requested(:post, 'http://localhost:9090/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
83
|
+
times: 1, body: 'h2o,location=west value=33i 15')
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_redirect_301_allow
|
87
|
+
stub_request(:any, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
88
|
+
.to_return(status: 301, headers:
|
89
|
+
{ 'location' => 'http://localhost:9090/' })
|
90
|
+
.then.to_return(status: 204)
|
91
|
+
stub_request(:any, 'http://localhost:9090/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
92
|
+
.to_return(status: 204)
|
93
|
+
|
94
|
+
client = InfluxDB2::Client.new('http://localhost:8086', 'my-token',
|
95
|
+
bucket: 'my-bucket',
|
96
|
+
org: 'my-org',
|
97
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND,
|
98
|
+
use_ssl: false,
|
99
|
+
redirect_forward_authorization: true)
|
100
|
+
|
101
|
+
client.create_write_api.write(data: 'h2o,location=west value=33i 15')
|
102
|
+
|
103
|
+
headers = {
|
104
|
+
'Authorization' => 'Token my-token',
|
105
|
+
'User-Agent' => "influxdb-client-ruby/#{InfluxDB2::VERSION}",
|
106
|
+
'Content-Type' => 'text/plain'
|
107
|
+
}
|
108
|
+
|
109
|
+
assert_requested(:post, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
110
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
111
|
+
|
112
|
+
assert_requested(:post, 'http://localhost:9090/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
113
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
114
|
+
end
|
115
|
+
|
116
|
+
def test_redirect_different_path
|
117
|
+
stub_request(:any, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
118
|
+
.to_return(status: 301, headers:
|
119
|
+
{ 'location' => 'http://localhost:8086/influxdb/' })
|
120
|
+
.then.to_return(status: 204)
|
121
|
+
stub_request(:any, 'http://localhost:8086/influxdb/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
122
|
+
.to_return(status: 204)
|
123
|
+
|
124
|
+
client = InfluxDB2::Client.new('http://localhost:8086', 'my-token',
|
125
|
+
bucket: 'my-bucket',
|
126
|
+
org: 'my-org',
|
127
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND,
|
128
|
+
use_ssl: false,
|
129
|
+
redirect_forward_authorization: true)
|
130
|
+
|
131
|
+
client.create_write_api.write(data: 'h2o,location=west value=33i 15')
|
132
|
+
|
133
|
+
headers = {
|
134
|
+
'Authorization' => 'Token my-token',
|
135
|
+
'User-Agent' => "influxdb-client-ruby/#{InfluxDB2::VERSION}",
|
136
|
+
'Content-Type' => 'text/plain'
|
137
|
+
}
|
138
|
+
|
139
|
+
assert_requested(:post, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
140
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
141
|
+
|
142
|
+
assert_requested(:post, 'http://localhost:8086/influxdb/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
143
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
144
|
+
end
|
145
|
+
end
|
@@ -201,7 +201,7 @@ class WriteApiTest < MiniTest::Test
|
|
201
201
|
def test_follow_redirect
|
202
202
|
stub_request(:any, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
203
203
|
.to_return(status: 307, headers:
|
204
|
-
{ 'location' => 'http://localhost:9090/
|
204
|
+
{ 'location' => 'http://localhost:9090/' })
|
205
205
|
.then.to_return(status: 204)
|
206
206
|
stub_request(:any, 'http://localhost:9090/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
207
207
|
.to_return(status: 204)
|
@@ -223,7 +223,7 @@ class WriteApiTest < MiniTest::Test
|
|
223
223
|
def test_follow_redirect_max
|
224
224
|
stub_request(:any, 'http://localhost:8086/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
225
225
|
.to_return(status: 307, headers:
|
226
|
-
{ 'location' => 'http://localhost:8086/
|
226
|
+
{ 'location' => 'http://localhost:8086/' })
|
227
227
|
|
228
228
|
client = InfluxDB2::Client.new('http://localhost:8086', 'my-token',
|
229
229
|
bucket: 'my-bucket',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: influxdb-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre.3196
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Bednar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- test/influxdb/query_api_integration_test.rb
|
162
162
|
- test/influxdb/query_api_stream_test.rb
|
163
163
|
- test/influxdb/query_api_test.rb
|
164
|
+
- test/influxdb/redirect_test.rb
|
164
165
|
- test/influxdb/write_api_batching_test.rb
|
165
166
|
- test/influxdb/write_api_integration_test.rb
|
166
167
|
- test/influxdb/write_api_test.rb
|
@@ -201,6 +202,7 @@ test_files:
|
|
201
202
|
- test/influxdb/query_api_integration_test.rb
|
202
203
|
- test/influxdb/query_api_stream_test.rb
|
203
204
|
- test/influxdb/query_api_test.rb
|
205
|
+
- test/influxdb/redirect_test.rb
|
204
206
|
- test/influxdb/write_api_batching_test.rb
|
205
207
|
- test/influxdb/write_api_integration_test.rb
|
206
208
|
- test/influxdb/write_api_test.rb
|