influxdb-client 1.3.0.pre.716 → 1.3.0.pre.759
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 +6 -1
- data/README.md +15 -1
- data/examples/influxdb_18_example.rb +35 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487d78a5e0f67e936824a91579205d82590bd4862af57db48fa0b53f1bb9b9cb
|
4
|
+
data.tar.gz: 9e3a030accc881397f0065c8a2657a0723dff4c44d4310674cece71d8bf1ff42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd8b65da087ec191ad6c514b4eae6dcb14355e178e5df017b6e455f673adc127f8cc78abd72e0b2c2a631333cd80ab11ef8341ffc7bd52563a009f0003d1f8a
|
7
|
+
data.tar.gz: fbb716e0841c0567b0faa98b62d6038af9065d6156e24ef897949b2d6253eacb2a9245b1a9dccf6ff7ed7821091f27413df7608dcc66ab02d91c6a4b3d0209df
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
## 1.3.0 [unreleased]
|
2
2
|
|
3
3
|
### Features
|
4
|
+
|
4
5
|
1. [#32](https://github.com/influxdata/influxdb-client-ruby/pull/32): Checks the health of a running InfluxDB instance by querying the /health
|
5
6
|
|
7
|
+
### Documentation
|
8
|
+
|
9
|
+
1. [#35](https://github.com/influxdata/influxdb-client-ruby/pull/35): Clarify how to use a client with InfluxDB 1.8
|
10
|
+
|
6
11
|
## 1.2.0 [2020-03-13]
|
7
12
|
|
8
13
|
### Features
|
@@ -13,7 +18,7 @@
|
|
13
18
|
### Security
|
14
19
|
1. [#29](https://github.com/influxdata/influxdb-client-ruby/pull/29): Upgrade rake to version 12.3.3 - [CVE-2020-8130](https://github.com/advisories/GHSA-jppv-gw3r-w3q8)
|
15
20
|
|
16
|
-
###
|
21
|
+
### Bug Fixes
|
17
22
|
1. [#22](https://github.com/influxdata/influxdb-client-ruby/pull/22): Fixed batch write
|
18
23
|
1. [#28](https://github.com/influxdata/influxdb-client-ruby/pull/28): Correctly parse CSV where multiple results include multiple tables
|
19
24
|
1. [#30](https://github.com/influxdata/influxdb-client-ruby/pull/30): Send Content-Type headers
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
This repository contains the reference Ruby client for the InfluxDB 2.0.
|
12
12
|
|
13
|
-
#### Note: Use this client library with InfluxDB 2.x and InfluxDB 1.8
|
13
|
+
#### Note: Use this client library with InfluxDB 2.x and InfluxDB 1.8+ ([see details](#influxdb-18-api-compatibility)). For connecting to InfluxDB 1.7 or earlier instances, use the [influxdb-ruby](https://github.com/influxdata/influxdb-ruby) client library.
|
14
14
|
|
15
15
|
## Installation
|
16
16
|
|
@@ -237,6 +237,20 @@ The time range could be specified as:
|
|
237
237
|
|
238
238
|
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/).
|
239
239
|
|
240
|
+
### InfluxDB 1.8 API compatibility
|
241
|
+
|
242
|
+
[InfluxDB 1.8.0 introduced forward compatibility APIs](https://docs.influxdata.com/influxdb/latest/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.
|
243
|
+
|
244
|
+
The following forward compatible APIs are available:
|
245
|
+
|
246
|
+
| API | Endpoint | Description |
|
247
|
+
|:----------|:----------|:----------|
|
248
|
+
| [query_api.rb](lib/influxdb2/client/query_api.rb) | [/api/v2/query](https://docs.influxdata.com/influxdb/latest/tools/api/#api-v2-query-http-endpoint) | Query data in InfluxDB 1.8.0+ using the InfluxDB 2.0 API and [Flux](https://docs.influxdata.com/flux/latest/) _(endpoint should be enabled by [`flux-enabled` option](https://docs.influxdata.com/influxdb/latest/administration/config/#flux-enabled-false))_ |
|
249
|
+
| [write_api.rb](lib/influxdb2/client/write_api.rb) | [/api/v2/write](https://docs.influxdata.com/influxdb/latest/tools/api/#api-v2-write-http-endpoint) | Write data to InfluxDB 1.8.0+ using the InfluxDB 2.0 API |
|
250
|
+
| [health_api.rb](lib/influxdb2/client/health_api.rb) | [/health](https://docs.influxdata.com/influxdb/latest/tools/api/#health-http-endpoint) | Check the health of your InfluxDB instance |
|
251
|
+
|
252
|
+
For detail info see [InfluxDB 1.8 example](examples/influxdb_18_example.rb).
|
253
|
+
|
240
254
|
## Local tests
|
241
255
|
|
242
256
|
```
|
@@ -0,0 +1,35 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
|
2
|
+
require 'influxdb2/client'
|
3
|
+
|
4
|
+
username = 'username'
|
5
|
+
password = 'password'
|
6
|
+
|
7
|
+
database = 'telegraf'
|
8
|
+
retention_policy = 'autogen'
|
9
|
+
|
10
|
+
bucket = "#{database}/#{retention_policy}"
|
11
|
+
|
12
|
+
client = InfluxDB2::Client.new('http://localhost:8086',
|
13
|
+
"#{username}:#{password}",
|
14
|
+
bucket: bucket,
|
15
|
+
org: '-',
|
16
|
+
use_ssl: false,
|
17
|
+
precision: InfluxDB2::WritePrecision::NANOSECOND)
|
18
|
+
|
19
|
+
puts '*** Write Points ***'
|
20
|
+
|
21
|
+
write_api = client.create_write_api
|
22
|
+
point = InfluxDB2::Point.new(name: 'mem')
|
23
|
+
.add_tag('host', 'host1')
|
24
|
+
.add_field('used_percent', 21.43234543)
|
25
|
+
puts point.to_line_protocol
|
26
|
+
write_api.write(data: point)
|
27
|
+
|
28
|
+
puts '*** Query Points ***'
|
29
|
+
|
30
|
+
query_api = client.create_query_api
|
31
|
+
query = "from(bucket: \"#{bucket}\") |> range(start: -1h)"
|
32
|
+
result = query_api.query(query: query)
|
33
|
+
result[0].records.each { |record| puts "#{record.time} #{record.measurement}: #{record.field} #{record.value}" }
|
34
|
+
|
35
|
+
client.close!
|
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.3.0.pre.
|
4
|
+
version: 1.3.0.pre.759
|
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-04-
|
11
|
+
date: 2020-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- bin/influxdb-restart.sh
|
146
146
|
- bin/pom.xml
|
147
147
|
- bin/swagger.yml
|
148
|
+
- examples/influxdb_18_example.rb
|
148
149
|
- influxdb-client.gemspec
|
149
150
|
- lib/influxdb2/client.rb
|
150
151
|
- lib/influxdb2/client/client.rb
|