dkron-rb 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +7 -4
- data/Rakefile +0 -0
- data/dkron-rb.gemspec +2 -1
- data/docs/DefaultApi.md +82 -1
- data/docs/Execution.md +0 -0
- data/docs/ExecutionsApi.md +0 -0
- data/docs/Job.md +5 -2
- data/docs/JobsApi.md +65 -4
- data/docs/Member.md +0 -0
- data/docs/MembersApi.md +0 -0
- data/docs/Processors.md +0 -0
- data/docs/{ExecutorConfig.md → Restore.md} +1 -1
- data/docs/Status.md +3 -3
- data/git_push.sh +0 -0
- data/lib/dkron-rb.rb +2 -2
- data/lib/dkron-rb/api/default_api.rb +93 -2
- data/lib/dkron-rb/api/executions_api.rb +1 -1
- data/lib/dkron-rb/api/jobs_api.rb +75 -4
- data/lib/dkron-rb/api/members_api.rb +1 -1
- data/lib/dkron-rb/api_client.rb +6 -4
- data/lib/dkron-rb/api_error.rb +1 -1
- data/lib/dkron-rb/configuration.rb +3 -3
- data/lib/dkron-rb/models/execution.rb +3 -2
- data/lib/dkron-rb/models/job.rb +44 -8
- data/lib/dkron-rb/models/member.rb +3 -2
- data/lib/dkron-rb/models/processors.rb +3 -2
- data/lib/dkron-rb/models/{executor_config.rb → restore.rb} +5 -4
- data/lib/dkron-rb/models/status.rb +6 -5
- data/lib/dkron-rb/version.rb +2 -2
- data/spec/api/default_api_spec.rb +21 -1
- data/spec/api/executions_api_spec.rb +1 -1
- data/spec/api/jobs_api_spec.rb +19 -2
- data/spec/api/members_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +18 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/models/execution_spec.rb +1 -1
- data/spec/models/job_spec.rb +19 -1
- data/spec/models/member_spec.rb +1 -1
- data/spec/models/processors_spec.rb +1 -1
- data/spec/models/{executor_config_spec.rb → restore_spec.rb} +7 -7
- data/spec/models/status_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +37 -18
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -75,7 +75,7 @@ module Dkron
|
|
75
75
|
return nil unless attributes.is_a?(Hash)
|
76
76
|
self.class.swagger_types.each_pair do |key, type|
|
77
77
|
if type =~ /\AArray<(.*)>/i
|
78
|
-
# check to ensure the input is an array given that the
|
78
|
+
# check to ensure the input is an array given that the attribute
|
79
79
|
# is documented as an array but the input is not
|
80
80
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
81
81
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -171,5 +171,6 @@ module Dkron
|
|
171
171
|
value
|
172
172
|
end
|
173
173
|
end
|
174
|
+
|
174
175
|
end
|
175
176
|
end
|
@@ -6,15 +6,15 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
require 'date'
|
14
14
|
|
15
15
|
module Dkron
|
16
|
-
#
|
17
|
-
class
|
16
|
+
# Each job restore result.
|
17
|
+
class Restore
|
18
18
|
# Attribute mapping from ruby-style variable name to JSON key.
|
19
19
|
def self.attribute_map
|
20
20
|
{
|
@@ -75,7 +75,7 @@ module Dkron
|
|
75
75
|
return nil unless attributes.is_a?(Hash)
|
76
76
|
self.class.swagger_types.each_pair do |key, type|
|
77
77
|
if type =~ /\AArray<(.*)>/i
|
78
|
-
# check to ensure the input is an array given that the
|
78
|
+
# check to ensure the input is an array given that the attribute
|
79
79
|
# is documented as an array but the input is not
|
80
80
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
81
81
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -171,5 +171,6 @@ module Dkron
|
|
171
171
|
value
|
172
172
|
end
|
173
173
|
end
|
174
|
+
|
174
175
|
end
|
175
176
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -36,9 +36,9 @@ module Dkron
|
|
36
36
|
# Attribute type mapping.
|
37
37
|
def self.swagger_types
|
38
38
|
{
|
39
|
-
:'agent' => :'',
|
40
|
-
:'serf' => :'',
|
41
|
-
:'tags' => :''
|
39
|
+
:'agent' => :'Object',
|
40
|
+
:'serf' => :'Object',
|
41
|
+
:'tags' => :'Object'
|
42
42
|
}
|
43
43
|
end
|
44
44
|
|
@@ -105,7 +105,7 @@ module Dkron
|
|
105
105
|
return nil unless attributes.is_a?(Hash)
|
106
106
|
self.class.swagger_types.each_pair do |key, type|
|
107
107
|
if type =~ /\AArray<(.*)>/i
|
108
|
-
# check to ensure the input is an array given that the
|
108
|
+
# check to ensure the input is an array given that the attribute
|
109
109
|
# is documented as an array but the input is not
|
110
110
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
111
111
|
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
@@ -201,5 +201,6 @@ module Dkron
|
|
201
201
|
value
|
202
202
|
end
|
203
203
|
end
|
204
|
+
|
204
205
|
end
|
205
206
|
end
|
data/lib/dkron-rb/version.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -32,6 +32,26 @@ describe 'DefaultApi' do
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
# unit tests for busy
|
36
|
+
# Returns the running executions.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<Execution>]
|
39
|
+
describe 'busy test' do
|
40
|
+
it 'should work' do
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# unit tests for get_is_leader
|
46
|
+
# Check if node is a leader or follower.
|
47
|
+
# @param [Hash] opts the optional parameters
|
48
|
+
# @return [nil]
|
49
|
+
describe 'get_is_leader test' do
|
50
|
+
it 'should work' do
|
51
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
35
55
|
# unit tests for get_leader
|
36
56
|
# List leader of cluster.
|
37
57
|
# @param [Hash] opts the optional parameters
|
data/spec/api/jobs_api_spec.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -36,6 +36,7 @@ describe 'JobsApi' do
|
|
36
36
|
# Create or updates a new job.
|
37
37
|
# @param body Updated job object
|
38
38
|
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [BOOLEAN] :runoncreate If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated.
|
39
40
|
# @return [Job]
|
40
41
|
describe 'create_or_update_job test' do
|
41
42
|
it 'should work' do
|
@@ -57,7 +58,12 @@ describe 'JobsApi' do
|
|
57
58
|
# unit tests for get_jobs
|
58
59
|
# List jobs.
|
59
60
|
# @param [Hash] opts the optional parameters
|
60
|
-
# @option opts [Array<String>] :
|
61
|
+
# @option opts [Array<String>] :metadata Filter jobs by metadata
|
62
|
+
# @option opts [String] :_sort Sorting field
|
63
|
+
# @option opts [String] :_order Sort order (ASC/DESC)
|
64
|
+
# @option opts [String] :q Filter query text
|
65
|
+
# @option opts [Integer] :_start Start index
|
66
|
+
# @option opts [Integer] :_end End index
|
61
67
|
# @return [Array<Job>]
|
62
68
|
describe 'get_jobs test' do
|
63
69
|
it 'should work' do
|
@@ -65,6 +71,17 @@ describe 'JobsApi' do
|
|
65
71
|
end
|
66
72
|
end
|
67
73
|
|
74
|
+
# unit tests for restore
|
75
|
+
# Restore jobs from json file.
|
76
|
+
# @param file Json file that needs to be restored.
|
77
|
+
# @param [Hash] opts the optional parameters
|
78
|
+
# @return [Array<Restore>]
|
79
|
+
describe 'restore test' do
|
80
|
+
it 'should work' do
|
81
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
68
85
|
# unit tests for run_job
|
69
86
|
# Executes a job.
|
70
87
|
# @param job_name The job that needs to be run.
|
data/spec/api_client_spec.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -89,6 +89,23 @@ describe Dkron::ApiClient do
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
describe '#build_request' do
|
93
|
+
let(:config) { Dkron::Configuration.new }
|
94
|
+
let(:api_client) { Dkron::ApiClient.new(config) }
|
95
|
+
|
96
|
+
it 'does not send multipart to request' do
|
97
|
+
expect(Typhoeus::Request).to receive(:new).with(anything, hash_not_including(:multipart))
|
98
|
+
api_client.build_request(:get, '/test')
|
99
|
+
end
|
100
|
+
|
101
|
+
context 'when the content type is multipart' do
|
102
|
+
it 'sends multipart to request' do
|
103
|
+
expect(Typhoeus::Request).to receive(:new).with(anything, hash_including(multipart: true))
|
104
|
+
api_client.build_request(:get, '/test', {header_params: { 'Content-Type' => 'multipart/form-data'}})
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
92
109
|
describe '#deserialize' do
|
93
110
|
it "handles Array<Integer>" do
|
94
111
|
api_client = Dkron::ApiClient.new
|
data/spec/configuration_spec.rb
CHANGED
data/spec/models/job_spec.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -38,6 +38,12 @@ describe 'Job' do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
describe 'test attribute "displayname"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
41
47
|
describe 'test attribute "schedule"' do
|
42
48
|
it 'should work' do
|
43
49
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -98,6 +104,12 @@ describe 'Job' do
|
|
98
104
|
end
|
99
105
|
end
|
100
106
|
|
107
|
+
describe 'test attribute "metadata"' do
|
108
|
+
it 'should work' do
|
109
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
101
113
|
describe 'test attribute "retries"' do
|
102
114
|
it 'should work' do
|
103
115
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
@@ -140,4 +152,10 @@ describe 'Job' do
|
|
140
152
|
end
|
141
153
|
end
|
142
154
|
|
155
|
+
describe 'test attribute "status"' do
|
156
|
+
it 'should work' do
|
157
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
143
161
|
end
|
data/spec/models/member_spec.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
OpenAPI spec version: 1
|
7
7
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
-
Swagger Codegen version: 2.4.
|
9
|
+
Swagger Codegen version: 2.4.18
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,22 +14,22 @@ require 'spec_helper'
|
|
14
14
|
require 'json'
|
15
15
|
require 'date'
|
16
16
|
|
17
|
-
# Unit tests for Dkron::
|
17
|
+
# Unit tests for Dkron::Restore
|
18
18
|
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
19
|
# Please update as you see appropriate
|
20
|
-
describe '
|
20
|
+
describe 'Restore' do
|
21
21
|
before do
|
22
22
|
# run before each test
|
23
|
-
@instance = Dkron::
|
23
|
+
@instance = Dkron::Restore.new
|
24
24
|
end
|
25
25
|
|
26
26
|
after do
|
27
27
|
# run after each test
|
28
28
|
end
|
29
29
|
|
30
|
-
describe 'test an instance of
|
31
|
-
it 'should create an instance of
|
32
|
-
expect(@instance).to be_instance_of(Dkron::
|
30
|
+
describe 'test an instance of Restore' do
|
31
|
+
it 'should create an instance of Restore' do
|
32
|
+
expect(@instance).to be_instance_of(Dkron::Restore)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
data/spec/models/status_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dkron-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Castell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -34,42 +34,62 @@ dependencies:
|
|
34
34
|
name: json
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '2.1'
|
40
37
|
- - ">="
|
41
38
|
- !ruby/object:Gem::Version
|
42
39
|
version: 2.1.0
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '2.1'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 2.1.0
|
47
50
|
- - "~>"
|
48
51
|
- !ruby/object:Gem::Version
|
49
52
|
version: '2.1'
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: addressable
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
50
57
|
- - ">="
|
51
58
|
- !ruby/object:Gem::Version
|
52
|
-
version: 2.
|
59
|
+
version: 2.3.0
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '2.3'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.3.0
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '2.3'
|
53
73
|
- !ruby/object:Gem::Dependency
|
54
74
|
name: rspec
|
55
75
|
requirement: !ruby/object:Gem::Requirement
|
56
76
|
requirements:
|
57
|
-
- - "~>"
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '3.6'
|
60
77
|
- - ">="
|
61
78
|
- !ruby/object:Gem::Version
|
62
79
|
version: 3.6.0
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.6'
|
63
83
|
type: :development
|
64
84
|
prerelease: false
|
65
85
|
version_requirements: !ruby/object:Gem::Requirement
|
66
86
|
requirements:
|
67
|
-
- - "~>"
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '3.6'
|
70
87
|
- - ">="
|
71
88
|
- !ruby/object:Gem::Version
|
72
89
|
version: 3.6.0
|
90
|
+
- - "~>"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '3.6'
|
73
93
|
- !ruby/object:Gem::Dependency
|
74
94
|
name: vcr
|
75
95
|
requirement: !ruby/object:Gem::Requirement
|
@@ -210,12 +230,12 @@ files:
|
|
210
230
|
- docs/DefaultApi.md
|
211
231
|
- docs/Execution.md
|
212
232
|
- docs/ExecutionsApi.md
|
213
|
-
- docs/ExecutorConfig.md
|
214
233
|
- docs/Job.md
|
215
234
|
- docs/JobsApi.md
|
216
235
|
- docs/Member.md
|
217
236
|
- docs/MembersApi.md
|
218
237
|
- docs/Processors.md
|
238
|
+
- docs/Restore.md
|
219
239
|
- docs/Status.md
|
220
240
|
- git_push.sh
|
221
241
|
- lib/dkron-rb.rb
|
@@ -227,10 +247,10 @@ files:
|
|
227
247
|
- lib/dkron-rb/api_error.rb
|
228
248
|
- lib/dkron-rb/configuration.rb
|
229
249
|
- lib/dkron-rb/models/execution.rb
|
230
|
-
- lib/dkron-rb/models/executor_config.rb
|
231
250
|
- lib/dkron-rb/models/job.rb
|
232
251
|
- lib/dkron-rb/models/member.rb
|
233
252
|
- lib/dkron-rb/models/processors.rb
|
253
|
+
- lib/dkron-rb/models/restore.rb
|
234
254
|
- lib/dkron-rb/models/status.rb
|
235
255
|
- lib/dkron-rb/version.rb
|
236
256
|
- spec/api/default_api_spec.rb
|
@@ -240,10 +260,10 @@ files:
|
|
240
260
|
- spec/api_client_spec.rb
|
241
261
|
- spec/configuration_spec.rb
|
242
262
|
- spec/models/execution_spec.rb
|
243
|
-
- spec/models/executor_config_spec.rb
|
244
263
|
- spec/models/job_spec.rb
|
245
264
|
- spec/models/member_spec.rb
|
246
265
|
- spec/models/processors_spec.rb
|
266
|
+
- spec/models/restore_spec.rb
|
247
267
|
- spec/models/status_spec.rb
|
248
268
|
- spec/spec_helper.rb
|
249
269
|
homepage: https://dkron.io
|
@@ -265,8 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
285
|
- !ruby/object:Gem::Version
|
266
286
|
version: '0'
|
267
287
|
requirements: []
|
268
|
-
|
269
|
-
rubygems_version: 2.7.6
|
288
|
+
rubygems_version: 3.0.3
|
270
289
|
signing_key:
|
271
290
|
specification_version: 4
|
272
291
|
summary: Dkron REST API Ruby Gem
|
@@ -277,7 +296,7 @@ test_files:
|
|
277
296
|
- spec/api/executions_api_spec.rb
|
278
297
|
- spec/api_client_spec.rb
|
279
298
|
- spec/configuration_spec.rb
|
280
|
-
- spec/models/
|
299
|
+
- spec/models/restore_spec.rb
|
281
300
|
- spec/models/execution_spec.rb
|
282
301
|
- spec/models/job_spec.rb
|
283
302
|
- spec/models/status_spec.rb
|