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/spec/api/jobs_api_spec.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
|
|
@@ -36,7 +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 [
|
39
|
+
# @option opts [BOOLEAN] :runoncreate If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated.
|
40
40
|
# @return [Job]
|
41
41
|
describe 'create_or_update_job test' do
|
42
42
|
it 'should work' do
|
@@ -66,6 +66,17 @@ describe 'JobsApi' do
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
# unit tests for restore
|
70
|
+
# Restore jobs from json file.
|
71
|
+
# @param file Json file that needs to be restored.
|
72
|
+
# @param [Hash] opts the optional parameters
|
73
|
+
# @return [Array<Restore>]
|
74
|
+
describe 'restore test' do
|
75
|
+
it 'should work' do
|
76
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
69
80
|
# unit tests for run_job
|
70
81
|
# Executes a job.
|
71
82
|
# @param job_name The job that needs to be run.
|
@@ -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
|
|
data/spec/api_client_spec.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
|
|
data/spec/configuration_spec.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
|
|
@@ -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
|
|
data/spec/models/job_spec.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
|
|
data/spec/models/member_spec.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
|
|
@@ -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
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
=begin
|
2
|
+
#Dkron REST API
|
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`. 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
|
+
|
6
|
+
OpenAPI spec version: 1.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.17
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for Dkron::Restore
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'Restore' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = Dkron::Restore.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
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
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/spec/models/status_spec.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
|
|
data/spec/spec_helper.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
|
|
data/swagger.json
ADDED
@@ -0,0 +1,656 @@
|
|
1
|
+
{
|
2
|
+
"swagger": "2.0",
|
3
|
+
"basePath": "/v1",
|
4
|
+
"host": "localhost:8080",
|
5
|
+
"consumes": [
|
6
|
+
"application/json"
|
7
|
+
],
|
8
|
+
"produces": [
|
9
|
+
"application/json"
|
10
|
+
],
|
11
|
+
"schemes": [
|
12
|
+
"http"
|
13
|
+
],
|
14
|
+
"info": {
|
15
|
+
"version": "3.0",
|
16
|
+
"title": "Dkron REST API",
|
17
|
+
"description": "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`.\nDkron 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.\nDefault API responses are unformatted JSON add the `pretty=true` param to format the response.\n"
|
18
|
+
},
|
19
|
+
"paths": {
|
20
|
+
"/": {
|
21
|
+
"get": {
|
22
|
+
"description": "Gets `Status` object.\n",
|
23
|
+
"operationId": "status",
|
24
|
+
"tags": [
|
25
|
+
"default"
|
26
|
+
],
|
27
|
+
"responses": {
|
28
|
+
"200": {
|
29
|
+
"description": "Successful response",
|
30
|
+
"schema": {
|
31
|
+
"$ref": "#/definitions/status"
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
},
|
37
|
+
"/jobs": {
|
38
|
+
"get": {
|
39
|
+
"description": "List jobs.\n",
|
40
|
+
"parameters": [
|
41
|
+
{
|
42
|
+
"in": "query",
|
43
|
+
"name": "metadata",
|
44
|
+
"type": "array",
|
45
|
+
"collectionFormat": "multi",
|
46
|
+
"items": {
|
47
|
+
"type": "string"
|
48
|
+
},
|
49
|
+
"description": "Filter jobs by metadata"
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"operationId": "getJobs",
|
53
|
+
"tags": [
|
54
|
+
"jobs"
|
55
|
+
],
|
56
|
+
"responses": {
|
57
|
+
"200": {
|
58
|
+
"description": "Successful response",
|
59
|
+
"schema": {
|
60
|
+
"type": "array",
|
61
|
+
"items": {
|
62
|
+
"$ref": "#/definitions/job"
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
},
|
68
|
+
"post": {
|
69
|
+
"description": "Create or updates a new job.\n",
|
70
|
+
"operationId": "createOrUpdateJob",
|
71
|
+
"tags": [
|
72
|
+
"jobs"
|
73
|
+
],
|
74
|
+
"parameters": [
|
75
|
+
{
|
76
|
+
"in": "body",
|
77
|
+
"name": "body",
|
78
|
+
"description": "Updated job object",
|
79
|
+
"required": true,
|
80
|
+
"schema": {
|
81
|
+
"$ref": "#/definitions/job"
|
82
|
+
}
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"in": "query",
|
86
|
+
"name": "runoncreate",
|
87
|
+
"description": "If present, regardless of any value, causes the job to be run immediately after being succesfully created or updated.",
|
88
|
+
"required": false,
|
89
|
+
"type": "boolean",
|
90
|
+
"allowEmptyValue": true
|
91
|
+
}
|
92
|
+
],
|
93
|
+
"responses": {
|
94
|
+
"201": {
|
95
|
+
"description": "Successful response",
|
96
|
+
"schema": {
|
97
|
+
"$ref": "#/definitions/job"
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
},
|
103
|
+
"/jobs/{job_name}": {
|
104
|
+
"get": {
|
105
|
+
"description": "Show a job.\n",
|
106
|
+
"operationId": "showJobByName",
|
107
|
+
"tags": [
|
108
|
+
"jobs"
|
109
|
+
],
|
110
|
+
"parameters": [
|
111
|
+
{
|
112
|
+
"in": "path",
|
113
|
+
"name": "job_name",
|
114
|
+
"description": "The job that needs to be fetched.",
|
115
|
+
"required": true,
|
116
|
+
"type": "string"
|
117
|
+
}
|
118
|
+
],
|
119
|
+
"responses": {
|
120
|
+
"200": {
|
121
|
+
"description": "Successful response",
|
122
|
+
"schema": {
|
123
|
+
"$ref": "#/definitions/job"
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
},
|
128
|
+
"delete": {
|
129
|
+
"description": "Delete a job.\n",
|
130
|
+
"operationId": "deleteJob",
|
131
|
+
"tags": [
|
132
|
+
"jobs"
|
133
|
+
],
|
134
|
+
"parameters": [
|
135
|
+
{
|
136
|
+
"in": "path",
|
137
|
+
"name": "job_name",
|
138
|
+
"description": "The job that needs to be deleted.",
|
139
|
+
"required": true,
|
140
|
+
"type": "string"
|
141
|
+
}
|
142
|
+
],
|
143
|
+
"responses": {
|
144
|
+
"200": {
|
145
|
+
"description": "Successful response",
|
146
|
+
"schema": {
|
147
|
+
"$ref": "#/definitions/job"
|
148
|
+
}
|
149
|
+
}
|
150
|
+
}
|
151
|
+
},
|
152
|
+
"post": {
|
153
|
+
"description": "Executes a job.\n",
|
154
|
+
"operationId": "runJob",
|
155
|
+
"tags": [
|
156
|
+
"jobs"
|
157
|
+
],
|
158
|
+
"parameters": [
|
159
|
+
{
|
160
|
+
"in": "path",
|
161
|
+
"name": "job_name",
|
162
|
+
"description": "The job that needs to be run.",
|
163
|
+
"required": true,
|
164
|
+
"type": "string"
|
165
|
+
}
|
166
|
+
],
|
167
|
+
"responses": {
|
168
|
+
"202": {
|
169
|
+
"description": "Successful response",
|
170
|
+
"schema": {
|
171
|
+
"$ref": "#/definitions/job"
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
175
|
+
}
|
176
|
+
},
|
177
|
+
"/jobs/{job_name}/toggle": {
|
178
|
+
"post": {
|
179
|
+
"description": "Toggle a job.\n",
|
180
|
+
"operationId": "toggleJob",
|
181
|
+
"tags": [
|
182
|
+
"jobs"
|
183
|
+
],
|
184
|
+
"parameters": [
|
185
|
+
{
|
186
|
+
"in": "path",
|
187
|
+
"name": "job_name",
|
188
|
+
"description": "The job that needs to be toggled.",
|
189
|
+
"required": true,
|
190
|
+
"type": "string"
|
191
|
+
}
|
192
|
+
],
|
193
|
+
"responses": {
|
194
|
+
"200": {
|
195
|
+
"description": "Successful response",
|
196
|
+
"schema": {
|
197
|
+
"$ref": "#/definitions/job"
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
},
|
203
|
+
"/restore": {
|
204
|
+
"post": {
|
205
|
+
"description": "Restore jobs from json file.\n",
|
206
|
+
"operationId": "restore",
|
207
|
+
"tags": [
|
208
|
+
"jobs"
|
209
|
+
],
|
210
|
+
"parameters": [
|
211
|
+
{
|
212
|
+
"in": "formData",
|
213
|
+
"name": "file",
|
214
|
+
"description": "Json file that needs to be restored.",
|
215
|
+
"required": true,
|
216
|
+
"type": "file"
|
217
|
+
}
|
218
|
+
],
|
219
|
+
"responses": {
|
220
|
+
"200": {
|
221
|
+
"description": "Successful response",
|
222
|
+
"schema": {
|
223
|
+
"type": "array",
|
224
|
+
"items": {
|
225
|
+
"$ref": "#/definitions/restore"
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
}
|
230
|
+
}
|
231
|
+
},
|
232
|
+
"/members": {
|
233
|
+
"get": {
|
234
|
+
"description": "List members.\n",
|
235
|
+
"operationId": "getMember",
|
236
|
+
"tags": [
|
237
|
+
"members"
|
238
|
+
],
|
239
|
+
"responses": {
|
240
|
+
"200": {
|
241
|
+
"description": "Successful response",
|
242
|
+
"schema": {
|
243
|
+
"type": "array",
|
244
|
+
"items": {
|
245
|
+
"$ref": "#/definitions/member"
|
246
|
+
}
|
247
|
+
}
|
248
|
+
}
|
249
|
+
}
|
250
|
+
}
|
251
|
+
},
|
252
|
+
"/leader": {
|
253
|
+
"get": {
|
254
|
+
"description": "List leader of cluster.\n",
|
255
|
+
"operationId": "getLeader",
|
256
|
+
"tags": [
|
257
|
+
"default"
|
258
|
+
],
|
259
|
+
"responses": {
|
260
|
+
"200": {
|
261
|
+
"description": "Successful response",
|
262
|
+
"schema": {
|
263
|
+
"$ref": "#/definitions/member"
|
264
|
+
}
|
265
|
+
}
|
266
|
+
}
|
267
|
+
}
|
268
|
+
},
|
269
|
+
"/isleader": {
|
270
|
+
"get": {
|
271
|
+
"description": "Check if node is a leader or follower.\n",
|
272
|
+
"operationId": "getIsLeader",
|
273
|
+
"tags": [
|
274
|
+
"default"
|
275
|
+
],
|
276
|
+
"responses": {
|
277
|
+
"200": {
|
278
|
+
"description": "Node is a leader"
|
279
|
+
},
|
280
|
+
"404": {
|
281
|
+
"description": "Node is a follower"
|
282
|
+
}
|
283
|
+
}
|
284
|
+
}
|
285
|
+
},
|
286
|
+
"/leave": {
|
287
|
+
"post": {
|
288
|
+
"description": "Force the node to leave the cluster.\n",
|
289
|
+
"operationId": "leave",
|
290
|
+
"tags": [
|
291
|
+
"default"
|
292
|
+
],
|
293
|
+
"responses": {
|
294
|
+
"200": {
|
295
|
+
"description": "Successful response",
|
296
|
+
"schema": {
|
297
|
+
"type": "array",
|
298
|
+
"items": {
|
299
|
+
"$ref": "#/definitions/member"
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
}
|
304
|
+
}
|
305
|
+
},
|
306
|
+
"/jobs/{job_name}/executions": {
|
307
|
+
"get": {
|
308
|
+
"description": "List executions.\n",
|
309
|
+
"operationId": "listExecutionsByJob",
|
310
|
+
"tags": [
|
311
|
+
"executions"
|
312
|
+
],
|
313
|
+
"parameters": [
|
314
|
+
{
|
315
|
+
"in": "path",
|
316
|
+
"name": "job_name",
|
317
|
+
"description": "The job that owns the executions to be fetched.",
|
318
|
+
"required": true,
|
319
|
+
"type": "string"
|
320
|
+
}
|
321
|
+
],
|
322
|
+
"responses": {
|
323
|
+
"200": {
|
324
|
+
"description": "Successful response",
|
325
|
+
"schema": {
|
326
|
+
"type": "array",
|
327
|
+
"items": {
|
328
|
+
"$ref": "#/definitions/execution"
|
329
|
+
}
|
330
|
+
}
|
331
|
+
}
|
332
|
+
}
|
333
|
+
}
|
334
|
+
},
|
335
|
+
"/busy": {
|
336
|
+
"get": {
|
337
|
+
"description": "Returns the running executions.\n",
|
338
|
+
"operationId": "busy",
|
339
|
+
"tags": [
|
340
|
+
"default"
|
341
|
+
],
|
342
|
+
"responses": {
|
343
|
+
"200": {
|
344
|
+
"description": "Successful response",
|
345
|
+
"schema": {
|
346
|
+
"type": "array",
|
347
|
+
"items": {
|
348
|
+
"$ref": "#/definitions/execution"
|
349
|
+
}
|
350
|
+
}
|
351
|
+
}
|
352
|
+
}
|
353
|
+
}
|
354
|
+
}
|
355
|
+
},
|
356
|
+
"definitions": {
|
357
|
+
"status": {
|
358
|
+
"type": "object",
|
359
|
+
"description": "Status represents details about the node.",
|
360
|
+
"readOnly": true,
|
361
|
+
"properties": {
|
362
|
+
"agent": {
|
363
|
+
"description": "Node basic details",
|
364
|
+
"readOnly": true,
|
365
|
+
"additionalProperties": {
|
366
|
+
"type": "object"
|
367
|
+
}
|
368
|
+
},
|
369
|
+
"serf": {
|
370
|
+
"description": "Serf status",
|
371
|
+
"readOnly": true,
|
372
|
+
"additionalProperties": {
|
373
|
+
"type": "object"
|
374
|
+
}
|
375
|
+
},
|
376
|
+
"tags": {
|
377
|
+
"description": "Tags asociated with this node",
|
378
|
+
"readOnly": true,
|
379
|
+
"additionalProperties": {
|
380
|
+
"type": "string"
|
381
|
+
}
|
382
|
+
}
|
383
|
+
}
|
384
|
+
},
|
385
|
+
"job": {
|
386
|
+
"type": "object",
|
387
|
+
"description": "A Job represents a scheduled task to execute.",
|
388
|
+
"required": [
|
389
|
+
"name",
|
390
|
+
"schedule"
|
391
|
+
],
|
392
|
+
"properties": {
|
393
|
+
"name": {
|
394
|
+
"type": "string",
|
395
|
+
"description": "Name for the job. Use only lower case letters (unicode), digits, underscore and dash.",
|
396
|
+
"readOnly": false,
|
397
|
+
"example": "job1"
|
398
|
+
},
|
399
|
+
"displayname": {
|
400
|
+
"type": "string",
|
401
|
+
"description": "Nice name for the job. Optional.",
|
402
|
+
"readOnly": false
|
403
|
+
},
|
404
|
+
"schedule": {
|
405
|
+
"type": "string",
|
406
|
+
"description": "Cron expression for the job.",
|
407
|
+
"readOnly": false,
|
408
|
+
"example": "@every 10s"
|
409
|
+
},
|
410
|
+
"timezone": {
|
411
|
+
"type": "string",
|
412
|
+
"description": "Timezone where the job will be executed. By default and when field is set to empty string, the job will run in local time.",
|
413
|
+
"readOnly": false,
|
414
|
+
"example": "Europe/Berlin"
|
415
|
+
},
|
416
|
+
"owner": {
|
417
|
+
"type": "string",
|
418
|
+
"description": "Owner of the job",
|
419
|
+
"readOnly": false,
|
420
|
+
"example": "Platform Team"
|
421
|
+
},
|
422
|
+
"owner_email": {
|
423
|
+
"type": "string",
|
424
|
+
"description": "Email of the owner",
|
425
|
+
"readOnly": false,
|
426
|
+
"example": "platform@example.com"
|
427
|
+
},
|
428
|
+
"success_count": {
|
429
|
+
"type": "integer",
|
430
|
+
"description": "Number of successful executions",
|
431
|
+
"readOnly": true
|
432
|
+
},
|
433
|
+
"error_count": {
|
434
|
+
"type": "integer",
|
435
|
+
"description": "Number of failed executions",
|
436
|
+
"readOnly": true
|
437
|
+
},
|
438
|
+
"last_success": {
|
439
|
+
"type": "string",
|
440
|
+
"format": "date-time",
|
441
|
+
"description": "Last time this job executed successfully",
|
442
|
+
"readOnly": true
|
443
|
+
},
|
444
|
+
"last_error": {
|
445
|
+
"type": "string",
|
446
|
+
"format": "date-time",
|
447
|
+
"description": "Last time this job failed",
|
448
|
+
"readOnly": true
|
449
|
+
},
|
450
|
+
"disabled": {
|
451
|
+
"type": "boolean",
|
452
|
+
"description": "Disabled state of the job",
|
453
|
+
"readOnly": false
|
454
|
+
},
|
455
|
+
"tags": {
|
456
|
+
"type": "object",
|
457
|
+
"description": "Target nodes tags of this job",
|
458
|
+
"additionalProperties": {
|
459
|
+
"type": "string"
|
460
|
+
},
|
461
|
+
"readOnly": false,
|
462
|
+
"example": {
|
463
|
+
"server": "true"
|
464
|
+
}
|
465
|
+
},
|
466
|
+
"metadata": {
|
467
|
+
"type": "object",
|
468
|
+
"description": "Extra metadata tags for this job",
|
469
|
+
"additionalProperties": {
|
470
|
+
"type": "string"
|
471
|
+
},
|
472
|
+
"readOnly": false,
|
473
|
+
"example": {
|
474
|
+
"office": "Barcelona"
|
475
|
+
}
|
476
|
+
},
|
477
|
+
"retries": {
|
478
|
+
"type": "integer",
|
479
|
+
"description": "Number of times to retry a failed job execution",
|
480
|
+
"example": 2,
|
481
|
+
"readOnly": false
|
482
|
+
},
|
483
|
+
"parent_job": {
|
484
|
+
"type": "string",
|
485
|
+
"description": "The name/id of the job that will trigger the execution of this job",
|
486
|
+
"example": "parent_job",
|
487
|
+
"readOnly": false
|
488
|
+
},
|
489
|
+
"dependent_jobs": {
|
490
|
+
"type": "array",
|
491
|
+
"items": {
|
492
|
+
"type": "string"
|
493
|
+
},
|
494
|
+
"description": "Array containing the jobs that depends on this one",
|
495
|
+
"example": [
|
496
|
+
"dependent_job"
|
497
|
+
],
|
498
|
+
"readOnly": true
|
499
|
+
},
|
500
|
+
"processors": {
|
501
|
+
"$ref": "#/definitions/processors"
|
502
|
+
},
|
503
|
+
"concurrency": {
|
504
|
+
"type": "string",
|
505
|
+
"description": "Concurrency policy for the job allow/forbid",
|
506
|
+
"example": "allow",
|
507
|
+
"readOnly": false
|
508
|
+
},
|
509
|
+
"executor": {
|
510
|
+
"type": "string",
|
511
|
+
"description": "Executor plugin used to run the job",
|
512
|
+
"readOnly": false,
|
513
|
+
"example": "shell"
|
514
|
+
},
|
515
|
+
"executor_config": {
|
516
|
+
"type": "object",
|
517
|
+
"description": "Executor plugin parameters",
|
518
|
+
"additionalProperties": {
|
519
|
+
"type": "string"
|
520
|
+
},
|
521
|
+
"example": {
|
522
|
+
"command": "echo 'Hello from Dkron'"
|
523
|
+
}
|
524
|
+
},
|
525
|
+
"status": {
|
526
|
+
"type": "string",
|
527
|
+
"readOnly": true,
|
528
|
+
"description": "Status of the job",
|
529
|
+
"example": "success"
|
530
|
+
}
|
531
|
+
}
|
532
|
+
},
|
533
|
+
"member": {
|
534
|
+
"type": "object",
|
535
|
+
"description": "A member represents a cluster member node.",
|
536
|
+
"properties": {
|
537
|
+
"Name": {
|
538
|
+
"type": "string",
|
539
|
+
"description": "Node name",
|
540
|
+
"example": "dkron1"
|
541
|
+
},
|
542
|
+
"Addr": {
|
543
|
+
"type": "string",
|
544
|
+
"description": "IP Address",
|
545
|
+
"example": "192.168.1.137"
|
546
|
+
},
|
547
|
+
"Port": {
|
548
|
+
"type": "integer",
|
549
|
+
"description": "Port number",
|
550
|
+
"example": 8946
|
551
|
+
},
|
552
|
+
"Tags": {
|
553
|
+
"type": "object",
|
554
|
+
"description": "Tags asociated with this node",
|
555
|
+
"additionalProperties": {
|
556
|
+
"type": "string"
|
557
|
+
},
|
558
|
+
"example": {
|
559
|
+
"rpc_addr": "192.168.1.137:6868",
|
560
|
+
"server": "true",
|
561
|
+
"version\"": "1.0.0"
|
562
|
+
}
|
563
|
+
},
|
564
|
+
"Status": {
|
565
|
+
"type": "integer",
|
566
|
+
"description": "The serf status of the node see: https://godoc.org/github.com/hashicorp/serf/serf#MemberStatus",
|
567
|
+
"example": 1
|
568
|
+
},
|
569
|
+
"ProtocolMin": {
|
570
|
+
"type": "integer",
|
571
|
+
"description": "Serf protocol minimum version this node can understand or speak",
|
572
|
+
"example": 5
|
573
|
+
},
|
574
|
+
"ProtocolMax": {
|
575
|
+
"type": "integer",
|
576
|
+
"description": "Serf protocol maximum version this node can understand or speak",
|
577
|
+
"example": 2
|
578
|
+
},
|
579
|
+
"ProtocolCur": {
|
580
|
+
"type": "integer",
|
581
|
+
"description": "Serf protocol current version this node can understand or speak",
|
582
|
+
"example": 2
|
583
|
+
},
|
584
|
+
"DelegateMin": {
|
585
|
+
"type": "integer",
|
586
|
+
"description": "Serf delegate protocol minimum version this node can understand or speak"
|
587
|
+
},
|
588
|
+
"DelegateMax": {
|
589
|
+
"type": "integer",
|
590
|
+
"description": "Serf delegate protocol maximum version this node can understand or speak",
|
591
|
+
"example": 5
|
592
|
+
},
|
593
|
+
"DelegateCur": {
|
594
|
+
"type": "integer",
|
595
|
+
"description": "Serf delegate protocol current version this node can understand or speak",
|
596
|
+
"example": 4
|
597
|
+
}
|
598
|
+
}
|
599
|
+
},
|
600
|
+
"execution": {
|
601
|
+
"type": "object",
|
602
|
+
"description": "An execution represents a timed job run.",
|
603
|
+
"properties": {
|
604
|
+
"job_name": {
|
605
|
+
"type": "string",
|
606
|
+
"description": "job name",
|
607
|
+
"example": "job_1"
|
608
|
+
},
|
609
|
+
"started_at": {
|
610
|
+
"type": "string",
|
611
|
+
"format": "date-time",
|
612
|
+
"description": "start time of the execution"
|
613
|
+
},
|
614
|
+
"finished_at": {
|
615
|
+
"type": "string",
|
616
|
+
"format": "date-time",
|
617
|
+
"description": "when the execution finished running"
|
618
|
+
},
|
619
|
+
"success": {
|
620
|
+
"type": "boolean",
|
621
|
+
"description": "the execution run successfuly"
|
622
|
+
},
|
623
|
+
"output": {
|
624
|
+
"type": "string",
|
625
|
+
"description": "partial output of the command execution",
|
626
|
+
"example": "Hello from Dkron"
|
627
|
+
},
|
628
|
+
"node_name": {
|
629
|
+
"type": "string",
|
630
|
+
"description": "name of the node that executed the command",
|
631
|
+
"example": "dkron1"
|
632
|
+
}
|
633
|
+
}
|
634
|
+
},
|
635
|
+
"processors": {
|
636
|
+
"type": "object",
|
637
|
+
"description": "Processor plugins used to process executions results of this job",
|
638
|
+
"additionalProperties": {
|
639
|
+
"type": "object",
|
640
|
+
"additionalProperties": {
|
641
|
+
"type": "string"
|
642
|
+
}
|
643
|
+
},
|
644
|
+
"example": {
|
645
|
+
"files": {
|
646
|
+
"forward": true
|
647
|
+
}
|
648
|
+
}
|
649
|
+
},
|
650
|
+
"restore": {
|
651
|
+
"type": "string",
|
652
|
+
"description": "Each job restore result.",
|
653
|
+
"example": "success create job_1"
|
654
|
+
}
|
655
|
+
}
|
656
|
+
}
|