Skip to content

Commit 6129475

Browse files
authored
feat: add Management api (influxdata#69)
1 parent 4f56bb7 commit 6129475

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+17670
-176
lines changed

.circleci/config.yml

+97-18
Original file line numberDiff line numberDiff line change
@@ -37,38 +37,50 @@ commands:
3737
parameters:
3838
ruby-image:
3939
type: string
40+
gemspec-file:
41+
type: string
42+
path:
43+
type: string
4044
steps:
4145
- restore_cache:
4246
name: Restoring Gem Cache
4347
keys:
44-
- &cache-key gem-cache-{{ checksum "influxdb-client.gemspec" }}-<< parameters.ruby-image >>
45-
- gem-cache-{{ checksum "influxdb-client.gemspec" }}
48+
- &cache-key gem-cache-{{ checksum "<< parameters.path >>/<< parameters.gemspec-file >>" }}-<< parameters.ruby-image >>
49+
- gem-cache-{{ checksum "<< parameters.path >>/<< parameters.gemspec-file >>" }}
4650
- gem-cache-
4751
- run:
4852
name: Install dependencies
4953
command: |
54+
cd << parameters.path >>
5055
gem install bundler
5156
bundle config set path 'vendor/bundle'
5257
bundle install --jobs=4 --retry=3
5358
- run:
5459
name: Static code analyze
5560
command: |
61+
cd << parameters.path >>
5662
bundle exec rake rubocop
5763
- run:
5864
name: Run tests
5965
command: |
66+
cd << parameters.path >>
6067
export MINITEST_REPORTER=JUnitReporter
6168
bundle exec rake test
6269
- save_cache:
6370
name: Saving Gem Cache
6471
key: *cache-key
6572
paths:
66-
- ./vendor/bundle
73+
- << parameters.path >>/vendor/bundle
6774
when: always
75+
- storing-test-results:
76+
path: << parameters.path >>
6877
storing-test-results:
78+
parameters:
79+
path:
80+
type: string
6981
steps:
7082
- store_test_results:
71-
path: test/reports
83+
path: << parameters.path >>/test/reports
7284

7385
jobs:
7486
tests-ruby:
@@ -79,6 +91,12 @@ jobs:
7991
influxdb-image:
8092
type: string
8193
default: &default-influxdb-image "influxdb:v2.0.4"
94+
gemspec-file:
95+
type: string
96+
default: influxdb-client.gemspec
97+
path:
98+
type: string
99+
default: .
82100
docker:
83101
- image: << parameters.ruby-image >>
84102
- image: &influx-image quay.io/influxdb/<< parameters.influxdb-image >>
@@ -88,11 +106,17 @@ jobs:
88106
- prepare
89107
- test:
90108
ruby-image: << parameters.ruby-image >>
91-
- storing-test-results
109+
gemspec-file: << parameters.gemspec-file >>
110+
path: << parameters.path >>
92111

93112
deploy-preview:
94113
docker:
95114
- image: *default-ruby-image
115+
parameters:
116+
gemspec-file:
117+
type: string
118+
path:
119+
type: string
96120
steps:
97121
- run:
98122
name: Early return if this build is from a forked repository
@@ -108,40 +132,95 @@ jobs:
108132
- run:
109133
name: Build a Gem bundle
110134
command: |
111-
gem build influxdb-client.gemspec
135+
cd << parameters.path >>
136+
gem build << parameters.gemspec-file >>
112137
- run:
113138
name: Deploy pre-release into https://rubygems.org
114139
command: |
140+
cd << parameters.path >>
115141
gem push influxdb-client-*.pre.$CIRCLE_BUILD_NUM.gem
116142
workflows:
117143
version: 2
118144
build:
119145
jobs:
120146
- tests-ruby:
121-
name: ruby-3.0
147+
name: client-r3.0
148+
ruby-image: "circleci/ruby:3.0-buster"
149+
- tests-ruby:
150+
name: APIs-r3.0
122151
ruby-image: "circleci/ruby:3.0-buster"
152+
gemspec-file: influxdb-client-apis.gemspec
153+
path: ./apis
154+
requires:
155+
- client-r3.0
123156
- tests-ruby:
124-
name: ruby-2.7
157+
name: client-r2.7
125158
ruby-image: "circleci/ruby:2.7-buster"
126159
- tests-ruby:
127-
name: ruby-2.6
160+
name: APIs-r2.7
161+
ruby-image: "circleci/ruby:2.7-buster"
162+
gemspec-file: influxdb-client-apis.gemspec
163+
path: ./apis
164+
requires:
165+
- client-r2.7
128166
- tests-ruby:
129-
name: ruby-2.6-nightly
167+
name: client-r2.6
168+
- tests-ruby:
169+
name: APIs-r2.6
170+
gemspec-file: influxdb-client-apis.gemspec
171+
path: ./apis
172+
requires:
173+
- client-r2.6
174+
- tests-ruby:
175+
name: client-r2.6-nightly
176+
influxdb-image: "influxdb2:nightly"
177+
- tests-ruby:
178+
name: APIs-r2.6-nightly
130179
influxdb-image: "influxdb2:nightly"
180+
gemspec-file: influxdb-client-apis.gemspec
181+
path: ./apis
182+
requires:
183+
- client-r2.6-nightly
131184
- tests-ruby:
132-
name: ruby-2.5
185+
name: client-r2.5
133186
ruby-image: "circleci/ruby:2.5-stretch"
134187
- tests-ruby:
135-
name: ruby-2.4
188+
name: APIs-r2.5
189+
ruby-image: "circleci/ruby:2.5-stretch"
190+
gemspec-file: influxdb-client-apis.gemspec
191+
path: ./apis
192+
requires:
193+
- client-r2.5
194+
- tests-ruby:
195+
name: client-r2.4
136196
ruby-image: "circleci/ruby:2.4-stretch"
197+
- tests-ruby:
198+
name: APIs-r2.4
199+
ruby-image: "circleci/ruby:2.4-stretch"
200+
gemspec-file: influxdb-client-apis.gemspec
201+
path: ./apis
202+
requires:
203+
- client-r2.4
204+
- deploy-preview:
205+
name: Deploy Client
206+
gemspec-file: influxdb-client.gemspec
207+
path: .
208+
requires:
209+
- APIs-r3.0
210+
- APIs-r2.7
211+
- APIs-r2.6
212+
- APIs-r2.6-nightly
213+
- APIs-r2.5
214+
- APIs-r2.4
215+
filters:
216+
branches:
217+
only: master
137218
- deploy-preview:
219+
name: Deploy APIs
220+
gemspec-file: influxdb-client-apis.gemspec
221+
path: ./apis
138222
requires:
139-
- ruby-3.0
140-
- ruby-2.7
141-
- ruby-2.6
142-
- ruby-2.6-nightly
143-
- ruby-2.5
144-
- ruby-2.4
223+
- Deploy Client
145224
filters:
146225
branches:
147226
only: master

.codecov.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
ignore:
22
- "lib/influxdb2/client/models/**/*"
3-
- "test/influxdb/**/*"
3+
- "test/influxdb/**/*"
4+
- "apis/lib/influxdb2/apis/generated/**/*"
5+
- "apis/test/influxdb2/**/*"

.gitignore

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
/.bundle/
2-
/.idea/
2+
.idea/
33
/.yardoc
44
/_yardoc/
5-
/coverage/
5+
coverage/
66
/doc/
77
/pkg/
88
/spec/reports/
99
/tmp/
10-
/Gemfile.lock
10+
Gemfile.lock
1111
/test/reports/
1212
.rakeTasks
13-
/influxdb-client-*.gem
13+
influxdb-client-*.gem
1414
/TAGS
15-
/vendor
15+
vendor
16+
docs
1617
/.openapi-generator/
18+
bin/generated/

.rubocop-cops.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#
2+
# The MIT License
3+
#
4+
# Permission is hereby granted, free of charge, to any person obtaining a copy
5+
# of this software and associated documentation files (the "Software"), to deal
6+
# in the Software without restriction, including without limitation the rights
7+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
# copies of the Software, and to permit persons to whom the Software is
9+
# furnished to do so, subject to the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be included in
12+
# all copies or substantial portions of the Software.
13+
#
14+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20+
# THE SOFTWARE.
21+
#
22+
23+
Naming/FileName:
24+
Exclude:
25+
- 'lib/influxdb-client.rb'
26+
- 'apis/lib/influxdb-client-apis.rb'
27+
Metrics/LineLength:
28+
Max: 120
29+
Metrics/MethodLength:
30+
Max: 50
31+
Metrics/ClassLength:
32+
Max: 300
33+
Metrics/AbcSize:
34+
Max: 50
35+
Metrics/CyclomaticComplexity:
36+
Max: 15
37+
Metrics/PerceivedComplexity:
38+
Max: 15
39+
Metrics/ParameterLists:
40+
Max: 10

.rubocop.yml

+3-17
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,6 @@ AllCops:
2424
Exclude:
2525
- 'lib/influxdb2/client/models/**/*'
2626
- 'vendor/**/*'
27-
Naming/FileName:
28-
Exclude:
29-
- 'lib/influxdb-client.rb'
30-
Metrics/LineLength:
31-
Max: 120
32-
Metrics/MethodLength:
33-
Max: 50
34-
Metrics/ClassLength:
35-
Max: 300
36-
Metrics/AbcSize:
37-
Max: 50
38-
Metrics/CyclomaticComplexity:
39-
Max: 15
40-
Metrics/PerceivedComplexity:
41-
Max: 15
42-
Metrics/ParameterLists:
43-
Max: 10
27+
- 'apis/**/*'
28+
- 'bin/**/*'
29+
inherit_from: ./.rubocop-cops.yml

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 1.12.0 [unreleased]
22

33
### Features
4+
1. [#69](https://github.com/influxdata/influxdb-client-ruby/pull/69): Created `influxdb-client-apis` package for Management API
45
1. [#71](https://github.com/influxdata/influxdb-client-ruby/pull/71): Added possibility to specify the certification verification behaviour
56

67
## 1.11.0 [2021-01-29]

0 commit comments

Comments
 (0)