influxdb-client 2.3.0.pre.4516 → 2.4.0.pre.4800
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/README.md +23 -23
- data/lib/influxdb-client.rb +7 -0
- data/lib/influxdb2/client/client.rb +7 -0
- data/lib/influxdb2/client/default_api.rb +8 -13
- data/lib/influxdb2/client/delete_api.rb +1 -1
- data/lib/influxdb2/client/flux_csv_parser.rb +21 -2
- data/lib/influxdb2/client/health_api.rb +1 -1
- data/lib/influxdb2/client/invocable_scripts_api.rb +147 -0
- data/lib/influxdb2/client/models/script.rb +299 -0
- data/lib/influxdb2/client/models/script_create_request.rb +259 -0
- data/lib/influxdb2/client/models/script_invocation_params.rb +210 -0
- data/lib/influxdb2/client/models/script_language.rb +36 -0
- data/lib/influxdb2/client/models/script_update_request.rb +229 -0
- data/lib/influxdb2/client/models/scripts.rb +212 -0
- data/lib/influxdb2/client/ping_api.rb +1 -1
- data/lib/influxdb2/client/query_api.rb +2 -2
- data/lib/influxdb2/client/version.rb +1 -1
- data/test/influxdb/flux_csv_parser_test.rb +17 -0
- data/test/influxdb/invocable_scripts_api_test.rb +41 -0
- metadata +11 -2
@@ -23,7 +23,7 @@ require_relative 'flux_csv_parser'
|
|
23
23
|
require 'json'
|
24
24
|
|
25
25
|
module InfluxDB2
|
26
|
-
# The client of the InfluxDB 2.
|
26
|
+
# The client of the InfluxDB 2.x that implement Query HTTP API endpoint.
|
27
27
|
#
|
28
28
|
class QueryApi < DefaultApi
|
29
29
|
DEFAULT_DIALECT = InfluxDB2::Dialect.new(header: true, delimiter: ',', comment_prefix: '#',
|
@@ -76,7 +76,7 @@ module InfluxDB2
|
|
76
76
|
uri = _parse_uri('/api/v2/query')
|
77
77
|
uri.query = URI.encode_www_form(org: org_param)
|
78
78
|
|
79
|
-
|
79
|
+
_request_json(payload.to_body.to_json, uri)
|
80
80
|
end
|
81
81
|
|
82
82
|
def _generate_payload(query: nil, dialect: nil, params: nil)
|
@@ -489,4 +489,21 @@ class FluxCsvParserErrorTest < MiniTest::Test
|
|
489
489
|
assert_equal tables[0].records[10].values['le'], Float::INFINITY
|
490
490
|
assert_equal tables[0].records[11].values['le'], -Float::INFINITY
|
491
491
|
end
|
492
|
+
|
493
|
+
def test_parse_without_datatype
|
494
|
+
data = ',result,table,_start,_stop,_field,_measurement,host,region,_value2,value1,value_str
|
495
|
+
,,0,1677-09-21T00:12:43.145224192Z,2018-07-16T11:21:02.547596934Z,free,mem,A,west,121,11,test
|
496
|
+
,,1,1677-09-21T00:12:43.145224192Z,2018-07-16T11:21:02.547596934Z,free,mem,A,west,121,11,test'
|
497
|
+
|
498
|
+
tables = InfluxDB2::FluxCsvParser.new(data, stream: false, response_mode: InfluxDB2::FluxResponseMode::ONLY_NAMES)
|
499
|
+
.parse
|
500
|
+
.tables
|
501
|
+
assert_equal 2, tables.size
|
502
|
+
assert_equal 11, tables[0].columns.size
|
503
|
+
assert_equal 1, tables[0].records.size
|
504
|
+
assert_equal 11, tables[0].records[0].values.size
|
505
|
+
assert_equal '0', tables[0].records[0].values['table']
|
506
|
+
assert_equal '11', tables[0].records[0].values['value1']
|
507
|
+
assert_equal 'west', tables[0].records[0].values['region']
|
508
|
+
end
|
492
509
|
end
|
@@ -0,0 +1,41 @@
|
|
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 InvocableScriptsApiTest < MiniTest::Test
|
24
|
+
def setup
|
25
|
+
WebMock.disable_net_connect!
|
26
|
+
@client = InfluxDB2::Client.new('http://localhost:8086', 'my-token',
|
27
|
+
bucket: 'my-bucket',
|
28
|
+
org: 'my-org',
|
29
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND,
|
30
|
+
use_ssl: false)
|
31
|
+
end
|
32
|
+
|
33
|
+
def teardown
|
34
|
+
@client.close!
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_create_instance
|
38
|
+
invocable_scripts_api = @client.create_invocable_scripts_api
|
39
|
+
refute_nil invocable_scripts_api
|
40
|
+
end
|
41
|
+
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: 2.
|
4
|
+
version: 2.4.0.pre.4800
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Bednar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,10 +128,17 @@ files:
|
|
128
128
|
- lib/influxdb2/client/flux_table.rb
|
129
129
|
- lib/influxdb2/client/health_api.rb
|
130
130
|
- lib/influxdb2/client/influx_error.rb
|
131
|
+
- lib/influxdb2/client/invocable_scripts_api.rb
|
131
132
|
- lib/influxdb2/client/models/delete_predicate_request.rb
|
132
133
|
- lib/influxdb2/client/models/dialect.rb
|
133
134
|
- lib/influxdb2/client/models/health_check.rb
|
134
135
|
- lib/influxdb2/client/models/query.rb
|
136
|
+
- lib/influxdb2/client/models/script.rb
|
137
|
+
- lib/influxdb2/client/models/script_create_request.rb
|
138
|
+
- lib/influxdb2/client/models/script_invocation_params.rb
|
139
|
+
- lib/influxdb2/client/models/script_language.rb
|
140
|
+
- lib/influxdb2/client/models/script_update_request.rb
|
141
|
+
- lib/influxdb2/client/models/scripts.rb
|
135
142
|
- lib/influxdb2/client/ping_api.rb
|
136
143
|
- lib/influxdb2/client/point.rb
|
137
144
|
- lib/influxdb2/client/query_api.rb
|
@@ -144,6 +151,7 @@ files:
|
|
144
151
|
- test/influxdb/delete_api_integration_test.rb
|
145
152
|
- test/influxdb/delete_api_test.rb
|
146
153
|
- test/influxdb/flux_csv_parser_test.rb
|
154
|
+
- test/influxdb/invocable_scripts_api_test.rb
|
147
155
|
- test/influxdb/point_test.rb
|
148
156
|
- test/influxdb/query_api_integration_test.rb
|
149
157
|
- test/influxdb/query_api_stream_test.rb
|
@@ -185,6 +193,7 @@ test_files:
|
|
185
193
|
- test/influxdb/delete_api_integration_test.rb
|
186
194
|
- test/influxdb/delete_api_test.rb
|
187
195
|
- test/influxdb/flux_csv_parser_test.rb
|
196
|
+
- test/influxdb/invocable_scripts_api_test.rb
|
188
197
|
- test/influxdb/point_test.rb
|
189
198
|
- test/influxdb/query_api_integration_test.rb
|
190
199
|
- test/influxdb/query_api_stream_test.rb
|