dkron-ruby 1.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/DEVELOP.md +599 -596
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -2
- data/README.md +8 -4
- data/dkron-ruby.gemspec +1 -0
- data/docs/DefaultApi.md +81 -0
- data/docs/Job.md +1 -1
- data/docs/JobsApi.md +49 -2
- data/docs/Restore.md +7 -0
- data/lib/dkron-ruby.rb +4 -3
- data/lib/dkron-ruby/api/default_api.rb +94 -3
- data/lib/dkron-ruby/api/executions_api.rb +3 -3
- data/lib/dkron-ruby/api/jobs_api.rb +58 -5
- data/lib/dkron-ruby/api/members_api.rb +3 -3
- data/lib/dkron-ruby/api_client.rb +6 -6
- data/lib/dkron-ruby/api_error.rb +3 -3
- data/lib/dkron-ruby/configuration.rb +5 -5
- data/lib/dkron-ruby/models/execution.rb +3 -3
- data/lib/dkron-ruby/models/job.rb +4 -4
- data/lib/dkron-ruby/models/member.rb +3 -3
- data/lib/dkron-ruby/models/processors.rb +3 -3
- data/lib/dkron-ruby/models/restore.rb +176 -0
- data/lib/dkron-ruby/models/status.rb +3 -3
- data/lib/dkron-ruby/version.rb +4 -4
- data/spec/api/default_api_spec.rb +23 -3
- data/spec/api/executions_api_spec.rb +3 -3
- data/spec/api/jobs_api_spec.rb +15 -4
- data/spec/api/members_api_spec.rb +3 -3
- data/spec/api_client_spec.rb +3 -3
- data/spec/configuration_spec.rb +3 -3
- data/spec/models/execution_spec.rb +3 -3
- data/spec/models/job_spec.rb +3 -3
- data/spec/models/member_spec.rb +3 -3
- data/spec/models/processors_spec.rb +3 -3
- data/spec/models/restore_spec.rb +35 -0
- data/spec/models/status_spec.rb +3 -3
- data/spec/spec_helper.rb +3 -3
- data/swagger.json +656 -0
- metadata +27 -2
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
hashdiff (1.0.1)
|
27
27
|
json (2.3.0)
|
28
28
|
public_suffix (4.0.4)
|
29
|
-
rake (
|
29
|
+
rake (13.0.1)
|
30
30
|
rspec (3.9.0)
|
31
31
|
rspec-core (~> 3.9.0)
|
32
32
|
rspec-expectations (~> 3.9.0)
|
@@ -60,7 +60,7 @@ DEPENDENCIES
|
|
60
60
|
autotest-growl (~> 0.2, >= 0.2.16)
|
61
61
|
autotest-rails-pure (~> 4.1, >= 4.1.2)
|
62
62
|
dkron-ruby!
|
63
|
-
rake (
|
63
|
+
rake (>= 12.3.3)
|
64
64
|
rspec (~> 3.6, >= 3.6.0)
|
65
65
|
vcr (~> 3.0, >= 3.0.1)
|
66
66
|
webmock (~> 1.24, >= 1.24.3)
|
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Dkron - the Ruby gem for the Dkron REST API
|
4
4
|
|
5
|
-
You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`.
|
5
|
+
You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`. Dkron implements a RESTful JSON API over HTTP to communicate with software clients. Dkron listens in port `8080` by default. All examples in this section assume that you're using the default port. Default API responses are unformatted JSON add the `pretty=true` param to format the response.
|
6
6
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
8
|
|
9
|
-
- API version:
|
9
|
+
- API version: 3.0
|
10
10
|
- Package version: 1.0.0
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
12
|
|
@@ -57,10 +57,10 @@ require 'dkron-ruby'
|
|
57
57
|
api_instance = Dkron::DefaultApi.new
|
58
58
|
|
59
59
|
begin
|
60
|
-
result = api_instance.
|
60
|
+
result = api_instance.busy
|
61
61
|
p result
|
62
62
|
rescue Dkron::ApiError => e
|
63
|
-
puts "Exception when calling DefaultApi->
|
63
|
+
puts "Exception when calling DefaultApi->busy: #{e}"
|
64
64
|
end
|
65
65
|
|
66
66
|
```
|
@@ -71,6 +71,8 @@ All URIs are relative to *http://localhost:8080/v1*
|
|
71
71
|
|
72
72
|
Class | Method | HTTP request | Description
|
73
73
|
------------ | ------------- | ------------- | -------------
|
74
|
+
*Dkron::DefaultApi* | [**busy**](docs/DefaultApi.md#busy) | **GET** /busy |
|
75
|
+
*Dkron::DefaultApi* | [**get_is_leader**](docs/DefaultApi.md#get_is_leader) | **GET** /isleader |
|
74
76
|
*Dkron::DefaultApi* | [**get_leader**](docs/DefaultApi.md#get_leader) | **GET** /leader |
|
75
77
|
*Dkron::DefaultApi* | [**leave**](docs/DefaultApi.md#leave) | **POST** /leave |
|
76
78
|
*Dkron::DefaultApi* | [**status**](docs/DefaultApi.md#status) | **GET** / |
|
@@ -78,6 +80,7 @@ Class | Method | HTTP request | Description
|
|
78
80
|
*Dkron::JobsApi* | [**create_or_update_job**](docs/JobsApi.md#create_or_update_job) | **POST** /jobs |
|
79
81
|
*Dkron::JobsApi* | [**delete_job**](docs/JobsApi.md#delete_job) | **DELETE** /jobs/{job_name} |
|
80
82
|
*Dkron::JobsApi* | [**get_jobs**](docs/JobsApi.md#get_jobs) | **GET** /jobs |
|
83
|
+
*Dkron::JobsApi* | [**restore**](docs/JobsApi.md#restore) | **POST** /restore |
|
81
84
|
*Dkron::JobsApi* | [**run_job**](docs/JobsApi.md#run_job) | **POST** /jobs/{job_name} |
|
82
85
|
*Dkron::JobsApi* | [**show_job_by_name**](docs/JobsApi.md#show_job_by_name) | **GET** /jobs/{job_name} |
|
83
86
|
*Dkron::JobsApi* | [**toggle_job**](docs/JobsApi.md#toggle_job) | **POST** /jobs/{job_name}/toggle |
|
@@ -90,6 +93,7 @@ Class | Method | HTTP request | Description
|
|
90
93
|
- [Dkron::Job](docs/Job.md)
|
91
94
|
- [Dkron::Member](docs/Member.md)
|
92
95
|
- [Dkron::Processors](docs/Processors.md)
|
96
|
+
- [Dkron::Restore](docs/Restore.md)
|
93
97
|
- [Dkron::Status](docs/Status.md)
|
94
98
|
|
95
99
|
|
data/dkron-ruby.gemspec
CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
|
30
30
|
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
31
|
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
|
+
s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0'
|
32
33
|
|
33
34
|
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
35
|
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
data/docs/DefaultApi.md
CHANGED
@@ -4,11 +4,92 @@ All URIs are relative to *http://localhost:8080/v1*
|
|
4
4
|
|
5
5
|
Method | HTTP request | Description
|
6
6
|
------------- | ------------- | -------------
|
7
|
+
[**busy**](DefaultApi.md#busy) | **GET** /busy |
|
8
|
+
[**get_is_leader**](DefaultApi.md#get_is_leader) | **GET** /isleader |
|
7
9
|
[**get_leader**](DefaultApi.md#get_leader) | **GET** /leader |
|
8
10
|
[**leave**](DefaultApi.md#leave) | **POST** /leave |
|
9
11
|
[**status**](DefaultApi.md#status) | **GET** / |
|
10
12
|
|
11
13
|
|
14
|
+
# **busy**
|
15
|
+
> Array<Execution> busy
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
Returns the running executions.
|
20
|
+
|
21
|
+
### Example
|
22
|
+
```ruby
|
23
|
+
# load the gem
|
24
|
+
require 'dkron-ruby'
|
25
|
+
|
26
|
+
api_instance = Dkron::DefaultApi.new
|
27
|
+
|
28
|
+
begin
|
29
|
+
result = api_instance.busy
|
30
|
+
p result
|
31
|
+
rescue Dkron::ApiError => e
|
32
|
+
puts "Exception when calling DefaultApi->busy: #{e}"
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
### Parameters
|
37
|
+
This endpoint does not need any parameter.
|
38
|
+
|
39
|
+
### Return type
|
40
|
+
|
41
|
+
[**Array<Execution>**](Execution.md)
|
42
|
+
|
43
|
+
### Authorization
|
44
|
+
|
45
|
+
No authorization required
|
46
|
+
|
47
|
+
### HTTP request headers
|
48
|
+
|
49
|
+
- **Content-Type**: application/json
|
50
|
+
- **Accept**: application/json
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
# **get_is_leader**
|
55
|
+
> get_is_leader
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
Check if node is a leader or follower.
|
60
|
+
|
61
|
+
### Example
|
62
|
+
```ruby
|
63
|
+
# load the gem
|
64
|
+
require 'dkron-ruby'
|
65
|
+
|
66
|
+
api_instance = Dkron::DefaultApi.new
|
67
|
+
|
68
|
+
begin
|
69
|
+
api_instance.get_is_leader
|
70
|
+
rescue Dkron::ApiError => e
|
71
|
+
puts "Exception when calling DefaultApi->get_is_leader: #{e}"
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
### Parameters
|
76
|
+
This endpoint does not need any parameter.
|
77
|
+
|
78
|
+
### Return type
|
79
|
+
|
80
|
+
nil (empty response body)
|
81
|
+
|
82
|
+
### Authorization
|
83
|
+
|
84
|
+
No authorization required
|
85
|
+
|
86
|
+
### HTTP request headers
|
87
|
+
|
88
|
+
- **Content-Type**: application/json
|
89
|
+
- **Accept**: application/json
|
90
|
+
|
91
|
+
|
92
|
+
|
12
93
|
# **get_leader**
|
13
94
|
> Member get_leader
|
14
95
|
|
data/docs/Job.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
|
-
**name** | **String** | Name for the job. |
|
6
|
+
**name** | **String** | Name for the job. Use only lower case letters (unicode), digits, underscore and dash. |
|
7
7
|
**displayname** | **String** | Nice name for the job. Optional. | [optional]
|
8
8
|
**schedule** | **String** | Cron expression for the job. |
|
9
9
|
**timezone** | **String** | Timezone where the job will be executed. By default and when field is set to empty string, the job will run in local time. | [optional]
|
data/docs/JobsApi.md
CHANGED
@@ -7,6 +7,7 @@ Method | HTTP request | Description
|
|
7
7
|
[**create_or_update_job**](JobsApi.md#create_or_update_job) | **POST** /jobs |
|
8
8
|
[**delete_job**](JobsApi.md#delete_job) | **DELETE** /jobs/{job_name} |
|
9
9
|
[**get_jobs**](JobsApi.md#get_jobs) | **GET** /jobs |
|
10
|
+
[**restore**](JobsApi.md#restore) | **POST** /restore |
|
10
11
|
[**run_job**](JobsApi.md#run_job) | **POST** /jobs/{job_name} |
|
11
12
|
[**show_job_by_name**](JobsApi.md#show_job_by_name) | **GET** /jobs/{job_name} |
|
12
13
|
[**toggle_job**](JobsApi.md#toggle_job) | **POST** /jobs/{job_name}/toggle |
|
@@ -29,7 +30,7 @@ api_instance = Dkron::JobsApi.new
|
|
29
30
|
body = Dkron::Job.new # Job | Updated job object
|
30
31
|
|
31
32
|
opts = {
|
32
|
-
runoncreate:
|
33
|
+
runoncreate: true # BOOLEAN | If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated.
|
33
34
|
}
|
34
35
|
|
35
36
|
begin
|
@@ -45,7 +46,7 @@ end
|
|
45
46
|
Name | Type | Description | Notes
|
46
47
|
------------- | ------------- | ------------- | -------------
|
47
48
|
**body** | [**Job**](Job.md)| Updated job object |
|
48
|
-
**runoncreate** |
|
49
|
+
**runoncreate** | **BOOLEAN**| If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated. | [optional]
|
49
50
|
|
50
51
|
### Return type
|
51
52
|
|
@@ -155,6 +156,52 @@ No authorization required
|
|
155
156
|
|
156
157
|
|
157
158
|
|
159
|
+
# **restore**
|
160
|
+
> Array<Restore> restore(file)
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
Restore jobs from json file.
|
165
|
+
|
166
|
+
### Example
|
167
|
+
```ruby
|
168
|
+
# load the gem
|
169
|
+
require 'dkron-ruby'
|
170
|
+
|
171
|
+
api_instance = Dkron::JobsApi.new
|
172
|
+
|
173
|
+
file = File.new('/path/to/file.txt') # File | Json file that needs to be restored.
|
174
|
+
|
175
|
+
|
176
|
+
begin
|
177
|
+
result = api_instance.restore(file)
|
178
|
+
p result
|
179
|
+
rescue Dkron::ApiError => e
|
180
|
+
puts "Exception when calling JobsApi->restore: #{e}"
|
181
|
+
end
|
182
|
+
```
|
183
|
+
|
184
|
+
### Parameters
|
185
|
+
|
186
|
+
Name | Type | Description | Notes
|
187
|
+
------------- | ------------- | ------------- | -------------
|
188
|
+
**file** | **File**| Json file that needs to be restored. |
|
189
|
+
|
190
|
+
### Return type
|
191
|
+
|
192
|
+
[**Array<Restore>**](Restore.md)
|
193
|
+
|
194
|
+
### Authorization
|
195
|
+
|
196
|
+
No authorization required
|
197
|
+
|
198
|
+
### HTTP request headers
|
199
|
+
|
200
|
+
- **Content-Type**: application/json
|
201
|
+
- **Accept**: application/json
|
202
|
+
|
203
|
+
|
204
|
+
|
158
205
|
# **run_job**
|
159
206
|
> Job run_job(job_name)
|
160
207
|
|
data/docs/Restore.md
ADDED
data/lib/dkron-ruby.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dkron REST API
|
3
3
|
|
4
|
-
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`.
|
4
|
+
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`. Dkron implements a RESTful JSON API over HTTP to communicate with software clients. Dkron listens in port `8080` by default. All examples in this section assume that you're using the default port. Default API responses are unformatted JSON add the `pretty=true` param to format the response.
|
5
5
|
|
6
|
-
OpenAPI spec version:
|
6
|
+
OpenAPI spec version: 1.0
|
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.17
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -21,6 +21,7 @@ require 'dkron-ruby/models/execution'
|
|
21
21
|
require 'dkron-ruby/models/job'
|
22
22
|
require 'dkron-ruby/models/member'
|
23
23
|
require 'dkron-ruby/models/processors'
|
24
|
+
require 'dkron-ruby/models/restore'
|
24
25
|
require 'dkron-ruby/models/status'
|
25
26
|
|
26
27
|
# APIs
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dkron REST API
|
3
3
|
|
4
|
-
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`.
|
4
|
+
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`. Dkron implements a RESTful JSON API over HTTP to communicate with software clients. Dkron listens in port `8080` by default. All examples in this section assume that you're using the default port. Default API responses are unformatted JSON add the `pretty=true` param to format the response.
|
5
5
|
|
6
|
-
OpenAPI spec version:
|
6
|
+
OpenAPI spec version: 1.0
|
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.17
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -19,6 +19,97 @@ module Dkron
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
+
# Returns the running executions.
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [Array<Execution>]
|
25
|
+
def busy(opts = {})
|
26
|
+
data, _status_code, _headers = busy_with_http_info(opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns the running executions.
|
31
|
+
# @param [Hash] opts the optional parameters
|
32
|
+
# @return [Array<(Array<Execution>, Fixnum, Hash)>] Array<Execution> data, response status code and response headers
|
33
|
+
def busy_with_http_info(opts = {})
|
34
|
+
if @api_client.config.debugging
|
35
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.busy ...'
|
36
|
+
end
|
37
|
+
# resource path
|
38
|
+
local_var_path = '/busy'
|
39
|
+
|
40
|
+
# query parameters
|
41
|
+
query_params = {}
|
42
|
+
|
43
|
+
# header parameters
|
44
|
+
header_params = {}
|
45
|
+
# HTTP header 'Accept' (if needed)
|
46
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
47
|
+
# HTTP header 'Content-Type'
|
48
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
49
|
+
|
50
|
+
# form parameters
|
51
|
+
form_params = {}
|
52
|
+
|
53
|
+
# http body (model)
|
54
|
+
post_body = nil
|
55
|
+
auth_names = []
|
56
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
57
|
+
:header_params => header_params,
|
58
|
+
:query_params => query_params,
|
59
|
+
:form_params => form_params,
|
60
|
+
:body => post_body,
|
61
|
+
:auth_names => auth_names,
|
62
|
+
:return_type => 'Array<Execution>')
|
63
|
+
if @api_client.config.debugging
|
64
|
+
@api_client.config.logger.debug "API called: DefaultApi#busy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
65
|
+
end
|
66
|
+
return data, status_code, headers
|
67
|
+
end
|
68
|
+
# Check if node is a leader or follower.
|
69
|
+
# @param [Hash] opts the optional parameters
|
70
|
+
# @return [nil]
|
71
|
+
def get_is_leader(opts = {})
|
72
|
+
get_is_leader_with_http_info(opts)
|
73
|
+
nil
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check if node is a leader or follower.
|
77
|
+
# @param [Hash] opts the optional parameters
|
78
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
79
|
+
def get_is_leader_with_http_info(opts = {})
|
80
|
+
if @api_client.config.debugging
|
81
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.get_is_leader ...'
|
82
|
+
end
|
83
|
+
# resource path
|
84
|
+
local_var_path = '/isleader'
|
85
|
+
|
86
|
+
# query parameters
|
87
|
+
query_params = {}
|
88
|
+
|
89
|
+
# header parameters
|
90
|
+
header_params = {}
|
91
|
+
# HTTP header 'Accept' (if needed)
|
92
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
93
|
+
# HTTP header 'Content-Type'
|
94
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
95
|
+
|
96
|
+
# form parameters
|
97
|
+
form_params = {}
|
98
|
+
|
99
|
+
# http body (model)
|
100
|
+
post_body = nil
|
101
|
+
auth_names = []
|
102
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
103
|
+
:header_params => header_params,
|
104
|
+
:query_params => query_params,
|
105
|
+
:form_params => form_params,
|
106
|
+
:body => post_body,
|
107
|
+
:auth_names => auth_names)
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug "API called: DefaultApi#get_is_leader\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
110
|
+
end
|
111
|
+
return data, status_code, headers
|
112
|
+
end
|
22
113
|
# List leader of cluster.
|
23
114
|
# @param [Hash] opts the optional parameters
|
24
115
|
# @return [Member]
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dkron REST API
|
3
3
|
|
4
|
-
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`.
|
4
|
+
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`. Dkron implements a RESTful JSON API over HTTP to communicate with software clients. Dkron listens in port `8080` by default. All examples in this section assume that you're using the default port. Default API responses are unformatted JSON add the `pretty=true` param to format the response.
|
5
5
|
|
6
|
-
OpenAPI spec version:
|
6
|
+
OpenAPI spec version: 1.0
|
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.17
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Dkron REST API
|
3
3
|
|
4
|
-
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`.
|
4
|
+
#You can communicate with Dkron using a RESTful JSON API over HTTP. Dkron nodes usually listen on port `8080` for API requests. All examples in this section assume that you've found a running leader at `localhost:8080`. Dkron implements a RESTful JSON API over HTTP to communicate with software clients. Dkron listens in port `8080` by default. All examples in this section assume that you're using the default port. Default API responses are unformatted JSON add the `pretty=true` param to format the response.
|
5
5
|
|
6
|
-
OpenAPI spec version:
|
6
|
+
OpenAPI spec version: 1.0
|
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.17
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -22,7 +22,7 @@ module Dkron
|
|
22
22
|
# Create or updates a new job.
|
23
23
|
# @param body Updated job object
|
24
24
|
# @param [Hash] opts the optional parameters
|
25
|
-
# @option opts [
|
25
|
+
# @option opts [BOOLEAN] :runoncreate If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated.
|
26
26
|
# @return [Job]
|
27
27
|
def create_or_update_job(body, opts = {})
|
28
28
|
data, _status_code, _headers = create_or_update_job_with_http_info(body, opts)
|
@@ -32,7 +32,7 @@ module Dkron
|
|
32
32
|
# Create or updates a new job.
|
33
33
|
# @param body Updated job object
|
34
34
|
# @param [Hash] opts the optional parameters
|
35
|
-
# @option opts [
|
35
|
+
# @option opts [BOOLEAN] :runoncreate If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated.
|
36
36
|
# @return [Array<(Job, Fixnum, Hash)>] Job data, response status code and response headers
|
37
37
|
def create_or_update_job_with_http_info(body, opts = {})
|
38
38
|
if @api_client.config.debugging
|
@@ -175,6 +175,59 @@ module Dkron
|
|
175
175
|
end
|
176
176
|
return data, status_code, headers
|
177
177
|
end
|
178
|
+
# Restore jobs from json file.
|
179
|
+
# @param file Json file that needs to be restored.
|
180
|
+
# @param [Hash] opts the optional parameters
|
181
|
+
# @return [Array<Restore>]
|
182
|
+
def restore(file, opts = {})
|
183
|
+
data, _status_code, _headers = restore_with_http_info(file, opts)
|
184
|
+
data
|
185
|
+
end
|
186
|
+
|
187
|
+
# Restore jobs from json file.
|
188
|
+
# @param file Json file that needs to be restored.
|
189
|
+
# @param [Hash] opts the optional parameters
|
190
|
+
# @return [Array<(Array<Restore>, Fixnum, Hash)>] Array<Restore> data, response status code and response headers
|
191
|
+
def restore_with_http_info(file, opts = {})
|
192
|
+
if @api_client.config.debugging
|
193
|
+
@api_client.config.logger.debug 'Calling API: JobsApi.restore ...'
|
194
|
+
end
|
195
|
+
# verify the required parameter 'file' is set
|
196
|
+
if @api_client.config.client_side_validation && file.nil?
|
197
|
+
fail ArgumentError, "Missing the required parameter 'file' when calling JobsApi.restore"
|
198
|
+
end
|
199
|
+
# resource path
|
200
|
+
local_var_path = '/restore'
|
201
|
+
|
202
|
+
# query parameters
|
203
|
+
query_params = {}
|
204
|
+
|
205
|
+
# header parameters
|
206
|
+
header_params = {}
|
207
|
+
# HTTP header 'Accept' (if needed)
|
208
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
209
|
+
# HTTP header 'Content-Type'
|
210
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
211
|
+
|
212
|
+
# form parameters
|
213
|
+
form_params = {}
|
214
|
+
form_params['file'] = file
|
215
|
+
|
216
|
+
# http body (model)
|
217
|
+
post_body = nil
|
218
|
+
auth_names = []
|
219
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
220
|
+
:header_params => header_params,
|
221
|
+
:query_params => query_params,
|
222
|
+
:form_params => form_params,
|
223
|
+
:body => post_body,
|
224
|
+
:auth_names => auth_names,
|
225
|
+
:return_type => 'Array<Restore>')
|
226
|
+
if @api_client.config.debugging
|
227
|
+
@api_client.config.logger.debug "API called: JobsApi#restore\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
228
|
+
end
|
229
|
+
return data, status_code, headers
|
230
|
+
end
|
178
231
|
# Executes a job.
|
179
232
|
# @param job_name The job that needs to be run.
|
180
233
|
# @param [Hash] opts the optional parameters
|