influxdb-client 1.2.0.pre.573 → 1.2.0.pre.585
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/CHANGELOG.md +1 -0
- data/lib/influxdb2/client/default_api.rb +1 -0
- data/test/influxdb/delete_api_test.rb +21 -0
- data/test/influxdb/query_api_test.rb +20 -0
- data/test/influxdb/write_api_test.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45b8cb1432e1dc4ef373fd01beac43ef565ecfdea21a8197e00619c5438bf17d
|
4
|
+
data.tar.gz: 12cf7f4b2ae4d055f4dcee263ba3dcaee4f08f9c9180679369320674ed96a1ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df04b2b5aae151b34be7522e10c225253613bad280c3259895e451d33f3702b640ecf6437efb1526d3c1387ade620a7fbb6cf502bd104f334c6b5367f3861727
|
7
|
+
data.tar.gz: af06b2c22b40955b2010235634df46f986b0f8e7f218e5f693d7dc0b44ac5ef016ef51d83342edfafdcd5e98056b99b31122ca26beb3cfb6a18f5f413bbece1a
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
### Features
|
4
4
|
1. [#23](https://github.com/influxdata/influxdb-client-ruby/issues/23): Added DeleteApi to delete time series data from InfluxDB.
|
5
5
|
1. [#24](https://github.com/influxdata/influxdb-client-ruby/issues/24): Added jitter_interval and retry_interval to WriteApi
|
6
|
+
1. [#26](https://github.com/influxdata/influxdb-client-ruby/issues/26): Set User-Agent to influxdb-client-ruby/<VERSION> for all requests
|
6
7
|
|
7
8
|
### Bugs
|
8
9
|
1. [#22](https://github.com/influxdata/influxdb-client-ruby/pull/22): Fixed batch write
|
@@ -96,4 +96,25 @@ class DeleteApiTest < MiniTest::Test
|
|
96
96
|
|
97
97
|
assert_requested(:post, 'http://localhost:9999/api/v2/delete?bucket=my-bucket&org=my-org', times: 1, body: body)
|
98
98
|
end
|
99
|
+
|
100
|
+
def test_user_agent_header
|
101
|
+
stub_request(:any, 'http://localhost:9999/api/v2/delete?bucket=my-bucket&org=my-org')
|
102
|
+
.to_return(status: 204)
|
103
|
+
client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
|
104
|
+
bucket: 'my-bucket',
|
105
|
+
org: 'my-org',
|
106
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND,
|
107
|
+
use_ssl: false)
|
108
|
+
|
109
|
+
client.create_delete_api.delete('2019-02-03T04:05:06+07:00', '2019-04-03T04:05:06+07:00',
|
110
|
+
bucket: 'my-bucket', org: 'my-org')
|
111
|
+
|
112
|
+
body = '{"start":"2019-02-03T04:05:06+07:00","stop":"2019-04-03T04:05:06+07:00"}'
|
113
|
+
headers = {
|
114
|
+
'Authorization' => 'Token my-token',
|
115
|
+
'User-Agent' => "influxdb-client-ruby/#{InfluxDB2::VERSION}"
|
116
|
+
}
|
117
|
+
assert_requested(:post, 'http://localhost:9999/api/v2/delete?bucket=my-bucket&org=my-org',
|
118
|
+
times: 1, body: body, headers: headers)
|
119
|
+
end
|
99
120
|
end
|
@@ -72,4 +72,24 @@ class QueryApiTest < MiniTest::Test
|
|
72
72
|
assert_equal 10, record1.value
|
73
73
|
assert_equal 'free', record1.field
|
74
74
|
end
|
75
|
+
|
76
|
+
def test_user_agent_header
|
77
|
+
stub_request(:post, 'http://localhost:9999/api/v2/query?org=my-org')
|
78
|
+
.to_return(body: SUCCESS_DATA)
|
79
|
+
|
80
|
+
client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
|
81
|
+
bucket: 'my-bucket',
|
82
|
+
org: 'my-org',
|
83
|
+
use_ssl: false)
|
84
|
+
|
85
|
+
client.create_query_api
|
86
|
+
.query(query: 'from(bucket:"my-bucket") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()')
|
87
|
+
|
88
|
+
headers = {
|
89
|
+
'Authorization' => 'Token my-token',
|
90
|
+
'User-Agent' => "influxdb-client-ruby/#{InfluxDB2::VERSION}"
|
91
|
+
}
|
92
|
+
assert_requested(:post, 'http://localhost:9999/api/v2/query?org=my-org',
|
93
|
+
times: 1, headers: headers)
|
94
|
+
end
|
75
95
|
end
|
@@ -251,4 +251,24 @@ class WriteApiTest < MiniTest::Test
|
|
251
251
|
|
252
252
|
assert_equal 'The time precision not_supported is not supported.', error.message
|
253
253
|
end
|
254
|
+
|
255
|
+
def test_user_agent_header
|
256
|
+
stub_request(:any, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns')
|
257
|
+
.to_return(status: 204)
|
258
|
+
|
259
|
+
client = InfluxDB2::Client.new('http://localhost:9999', 'my-token',
|
260
|
+
bucket: 'my-bucket',
|
261
|
+
org: 'my-org',
|
262
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND,
|
263
|
+
use_ssl: false)
|
264
|
+
|
265
|
+
client.create_write_api.write(data: 'h2o,location=west value=33i 15')
|
266
|
+
|
267
|
+
headers = {
|
268
|
+
'Authorization' => 'Token my-token',
|
269
|
+
'User-Agent' => "influxdb-client-ruby/#{InfluxDB2::VERSION}"
|
270
|
+
}
|
271
|
+
assert_requested(:post, 'http://localhost:9999/api/v2/write?bucket=my-bucket&org=my-org&precision=ns',
|
272
|
+
times: 1, body: 'h2o,location=west value=33i 15', headers: headers)
|
273
|
+
end
|
254
274
|
end
|
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: 1.2.0.pre.
|
4
|
+
version: 1.2.0.pre.585
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Bednar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|