influxdb-client 1.4.0.pre.827 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +10 -1
- data/README.md +5 -5
- data/bin/swagger.yml +940 -750
- data/examples/influxdb_18_example.rb +1 -1
- data/lib/{influxdb2/client.rb → influxdb-client.rb} +0 -0
- data/lib/influxdb2/client/models/health_check.rb +22 -4
- data/lib/influxdb2/client/models/query.rb +18 -40
- data/lib/influxdb2/client/point.rb +7 -7
- data/lib/influxdb2/client/version.rb +1 -1
- data/lib/influxdb2/client/write_api.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +5 -5
File without changes
|
@@ -22,6 +22,10 @@ module InfluxDB2
|
|
22
22
|
|
23
23
|
attr_accessor :status
|
24
24
|
|
25
|
+
attr_accessor :version
|
26
|
+
|
27
|
+
attr_accessor :commit
|
28
|
+
|
25
29
|
class EnumAttributeValidator
|
26
30
|
attr_reader :datatype
|
27
31
|
attr_reader :allowable_values
|
@@ -50,7 +54,9 @@ module InfluxDB2
|
|
50
54
|
:'name' => :'name',
|
51
55
|
:'message' => :'message',
|
52
56
|
:'checks' => :'checks',
|
53
|
-
:'status' => :'status'
|
57
|
+
:'status' => :'status',
|
58
|
+
:'version' => :'version',
|
59
|
+
:'commit' => :'commit'
|
54
60
|
}
|
55
61
|
end
|
56
62
|
|
@@ -60,7 +66,9 @@ module InfluxDB2
|
|
60
66
|
:'name' => :'String',
|
61
67
|
:'message' => :'String',
|
62
68
|
:'checks' => :'Array<HealthCheck>',
|
63
|
-
:'status' => :'String'
|
69
|
+
:'status' => :'String',
|
70
|
+
:'version' => :'String',
|
71
|
+
:'commit' => :'String'
|
64
72
|
}
|
65
73
|
end
|
66
74
|
|
@@ -89,6 +97,14 @@ module InfluxDB2
|
|
89
97
|
if attributes.has_key?(:'status')
|
90
98
|
self.status = attributes[:'status']
|
91
99
|
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'version')
|
102
|
+
self.version = attributes[:'version']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'commit')
|
106
|
+
self.commit = attributes[:'commit']
|
107
|
+
end
|
92
108
|
end
|
93
109
|
|
94
110
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -134,7 +150,9 @@ module InfluxDB2
|
|
134
150
|
name == o.name &&
|
135
151
|
message == o.message &&
|
136
152
|
checks == o.checks &&
|
137
|
-
status == o.status
|
153
|
+
status == o.status &&
|
154
|
+
version == o.version &&
|
155
|
+
commit == o.commit
|
138
156
|
end
|
139
157
|
|
140
158
|
# @see the `==` method
|
@@ -146,7 +164,7 @@ module InfluxDB2
|
|
146
164
|
# Calculates hash code according to all attributes.
|
147
165
|
# @return [Fixnum] Hash code
|
148
166
|
def hash
|
149
|
-
[name, message, checks, status].hash
|
167
|
+
[name, message, checks, status, version, commit].hash
|
150
168
|
end
|
151
169
|
|
152
170
|
# Builds the object from hash
|
@@ -13,27 +13,21 @@ OpenAPI Generator version: 3.3.4
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module InfluxDB2
|
16
|
-
# Query influx
|
16
|
+
# Query influx using the Flux language
|
17
17
|
class Query
|
18
18
|
attr_accessor :extern
|
19
19
|
|
20
20
|
# Query script to execute.
|
21
21
|
attr_accessor :query
|
22
22
|
|
23
|
-
# The type of query.
|
23
|
+
# The type of query. Must be \"flux\".
|
24
24
|
attr_accessor :type
|
25
25
|
|
26
|
-
# Required for `influxql` type queries.
|
27
|
-
attr_accessor :db
|
28
|
-
|
29
|
-
# Required for `influxql` type queries.
|
30
|
-
attr_accessor :rp
|
31
|
-
|
32
|
-
# Required for `influxql` type queries.
|
33
|
-
attr_accessor :cluster
|
34
|
-
|
35
26
|
attr_accessor :dialect
|
36
27
|
|
28
|
+
# Specifies the time that should be reported as \"now\" in the query. Default is the server's now time.
|
29
|
+
attr_accessor :now
|
30
|
+
|
37
31
|
class EnumAttributeValidator
|
38
32
|
attr_reader :datatype
|
39
33
|
attr_reader :allowable_values
|
@@ -62,10 +56,8 @@ module InfluxDB2
|
|
62
56
|
:'extern' => :'extern',
|
63
57
|
:'query' => :'query',
|
64
58
|
:'type' => :'type',
|
65
|
-
:'
|
66
|
-
:'
|
67
|
-
:'cluster' => :'cluster',
|
68
|
-
:'dialect' => :'dialect'
|
59
|
+
:'dialect' => :'dialect',
|
60
|
+
:'now' => :'now'
|
69
61
|
}
|
70
62
|
end
|
71
63
|
|
@@ -75,10 +67,8 @@ module InfluxDB2
|
|
75
67
|
:'extern' => :'File',
|
76
68
|
:'query' => :'String',
|
77
69
|
:'type' => :'String',
|
78
|
-
:'
|
79
|
-
:'
|
80
|
-
:'cluster' => :'String',
|
81
|
-
:'dialect' => :'Dialect'
|
70
|
+
:'dialect' => :'Dialect',
|
71
|
+
:'now' => :'DateTime'
|
82
72
|
}
|
83
73
|
end
|
84
74
|
|
@@ -100,25 +90,15 @@ module InfluxDB2
|
|
100
90
|
|
101
91
|
if attributes.has_key?(:'type')
|
102
92
|
self.type = attributes[:'type']
|
103
|
-
else
|
104
|
-
self.type = 'flux'
|
105
|
-
end
|
106
|
-
|
107
|
-
if attributes.has_key?(:'db')
|
108
|
-
self.db = attributes[:'db']
|
109
|
-
end
|
110
|
-
|
111
|
-
if attributes.has_key?(:'rp')
|
112
|
-
self.rp = attributes[:'rp']
|
113
|
-
end
|
114
|
-
|
115
|
-
if attributes.has_key?(:'cluster')
|
116
|
-
self.cluster = attributes[:'cluster']
|
117
93
|
end
|
118
94
|
|
119
95
|
if attributes.has_key?(:'dialect')
|
120
96
|
self.dialect = attributes[:'dialect']
|
121
97
|
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'now')
|
100
|
+
self.now = attributes[:'now']
|
101
|
+
end
|
122
102
|
end
|
123
103
|
|
124
104
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -136,7 +116,7 @@ module InfluxDB2
|
|
136
116
|
# @return true if the model is valid
|
137
117
|
def valid?
|
138
118
|
return false if @query.nil?
|
139
|
-
type_validator = EnumAttributeValidator.new('String', ['flux'
|
119
|
+
type_validator = EnumAttributeValidator.new('String', ['flux'])
|
140
120
|
return false unless type_validator.valid?(@type)
|
141
121
|
true
|
142
122
|
end
|
@@ -144,7 +124,7 @@ module InfluxDB2
|
|
144
124
|
# Custom attribute writer method checking allowed values (enum).
|
145
125
|
# @param [Object] type Object to be assigned
|
146
126
|
def type=(type)
|
147
|
-
validator = EnumAttributeValidator.new('String', ['flux'
|
127
|
+
validator = EnumAttributeValidator.new('String', ['flux'])
|
148
128
|
unless validator.valid?(type)
|
149
129
|
fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
|
150
130
|
end
|
@@ -159,10 +139,8 @@ module InfluxDB2
|
|
159
139
|
extern == o.extern &&
|
160
140
|
query == o.query &&
|
161
141
|
type == o.type &&
|
162
|
-
|
163
|
-
|
164
|
-
cluster == o.cluster &&
|
165
|
-
dialect == o.dialect
|
142
|
+
dialect == o.dialect &&
|
143
|
+
now == o.now
|
166
144
|
end
|
167
145
|
|
168
146
|
# @see the `==` method
|
@@ -174,7 +152,7 @@ module InfluxDB2
|
|
174
152
|
# Calculates hash code according to all attributes.
|
175
153
|
# @return [Fixnum] Hash code
|
176
154
|
def hash
|
177
|
-
[extern, query, type,
|
155
|
+
[extern, query, type, dialect, now].hash
|
178
156
|
end
|
179
157
|
|
180
158
|
# Builds the object from hash
|
@@ -28,7 +28,7 @@ module InfluxDB2
|
|
28
28
|
class Point
|
29
29
|
# Create DataPoint instance for specified measurement name.
|
30
30
|
#
|
31
|
-
# @example
|
31
|
+
# @example InfluxDB2::Point.new(name: "h2o",
|
32
32
|
# tags: {host: 'aws', region: 'us'},
|
33
33
|
# fields: {level: 5, saturation: "99%"},
|
34
34
|
# time: 123)
|
@@ -64,7 +64,7 @@ module InfluxDB2
|
|
64
64
|
|
65
65
|
# Adds or replaces a tag value for a point.
|
66
66
|
#
|
67
|
-
# @example
|
67
|
+
# @example InfluxDB2::Point.new(name: "h2o")
|
68
68
|
# .add_tag("location", "europe")
|
69
69
|
# .add_field("level", 2)
|
70
70
|
#
|
@@ -77,7 +77,7 @@ module InfluxDB2
|
|
77
77
|
|
78
78
|
# Adds or replaces a field value for a point.
|
79
79
|
#
|
80
|
-
# @example
|
80
|
+
# @example InfluxDB2::Point.new(name: "h2o")
|
81
81
|
# .add_tag("location", "europe")
|
82
82
|
# .add_field("level", 2)
|
83
83
|
#
|
@@ -90,15 +90,15 @@ module InfluxDB2
|
|
90
90
|
|
91
91
|
# Updates the timestamp for the point.
|
92
92
|
#
|
93
|
-
# @example
|
93
|
+
# @example InfluxDB2::Point.new(name: "h2o")
|
94
94
|
# .add_tag("location", "europe")
|
95
95
|
# .add_field("level", 2)
|
96
|
-
# .time(Time.new(2015, 10, 15, 8, 20, 15),
|
96
|
+
# .time(Time.new(2015, 10, 15, 8, 20, 15), InfluxDB2::WritePrecision::MILLISECOND)
|
97
97
|
#
|
98
|
-
# @example
|
98
|
+
# @example InfluxDB2::Point.new(name: "h2o")
|
99
99
|
# .add_tag("location", "europe")
|
100
100
|
# .add_field("level", 2)
|
101
|
-
# .time(123,
|
101
|
+
# .time(123, InfluxDB2::WritePrecision::NANOSECOND)
|
102
102
|
#
|
103
103
|
# @param [Object] time the timestamp
|
104
104
|
# @param [WritePrecision] precision the timestamp precision
|
@@ -101,14 +101,14 @@ module InfluxDB2
|
|
101
101
|
# },
|
102
102
|
# {name: 'gpu', fields: {value: 0.9999}}
|
103
103
|
# ],
|
104
|
-
# precision:
|
104
|
+
# precision: InfluxDB2::WritePrecision::NANOSECOND,
|
105
105
|
# bucket: 'my-bucket',
|
106
106
|
# org: 'my-org'
|
107
107
|
# )
|
108
108
|
#
|
109
109
|
# @example write(data: 'h2o,location=west value=33i 15')
|
110
110
|
#
|
111
|
-
# @example point =
|
111
|
+
# @example point = InfluxDB2::Point.new(name: 'h2o')
|
112
112
|
# .add_tag('location', 'europe')
|
113
113
|
# .add_field('level', 2)
|
114
114
|
#
|
data/test/test_helper.rb
CHANGED
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.
|
4
|
+
version: 1.5.0
|
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-
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,7 +147,7 @@ files:
|
|
147
147
|
- bin/swagger.yml
|
148
148
|
- examples/influxdb_18_example.rb
|
149
149
|
- influxdb-client.gemspec
|
150
|
-
- lib/
|
150
|
+
- lib/influxdb-client.rb
|
151
151
|
- lib/influxdb2/client/client.rb
|
152
152
|
- lib/influxdb2/client/default_api.rb
|
153
153
|
- lib/influxdb2/client/delete_api.rb
|
@@ -194,9 +194,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: 2.2.0
|
195
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
|
-
- - "
|
197
|
+
- - ">="
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
199
|
+
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubygems_version: 3.0.3
|
202
202
|
signing_key:
|