dkron-rb 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +65 -0
  4. data/LICENSE +201 -0
  5. data/README.md +98 -0
  6. data/Rakefile +6 -0
  7. data/bin/console +14 -0
  8. data/bin/setup +8 -0
  9. data/config.json +5 -0
  10. data/dkron-rb-0.0.1.gem +0 -0
  11. data/dkron-rb-0.0.2.gem +0 -0
  12. data/dkron-rb.gemspec +55 -0
  13. data/docs/Agent.md +7 -0
  14. data/docs/DefaultApi.md +131 -0
  15. data/docs/Execution.md +13 -0
  16. data/docs/ExecutionsApi.md +55 -0
  17. data/docs/InlineResponse200.md +10 -0
  18. data/docs/Job.md +24 -0
  19. data/docs/JobsApi.md +237 -0
  20. data/docs/MainApi.md +90 -0
  21. data/docs/Member.md +18 -0
  22. data/docs/MembersApi.md +49 -0
  23. data/docs/Serf.md +7 -0
  24. data/docs/Status.md +7 -0
  25. data/docs/Tags.md +7 -0
  26. data/git_push.sh +67 -0
  27. data/lib/dkron-rb.rb +47 -0
  28. data/lib/dkron-rb/api/default_api.rb +193 -0
  29. data/lib/dkron-rb/api/executions_api.rb +91 -0
  30. data/lib/dkron-rb/api/jobs_api.rb +315 -0
  31. data/lib/dkron-rb/api/members_api.rb +87 -0
  32. data/lib/dkron-rb/api_client.rb +378 -0
  33. data/lib/dkron-rb/api_error.rb +47 -0
  34. data/lib/dkron-rb/configuration.rb +207 -0
  35. data/lib/dkron-rb/cron.rb +152 -0
  36. data/lib/dkron-rb/models/agent.rb +152 -0
  37. data/lib/dkron-rb/models/execution.rb +250 -0
  38. data/lib/dkron-rb/models/inline_response_200.rb +181 -0
  39. data/lib/dkron-rb/models/job.rb +369 -0
  40. data/lib/dkron-rb/models/member.rb +301 -0
  41. data/lib/dkron-rb/models/serf.rb +152 -0
  42. data/lib/dkron-rb/models/status.rb +190 -0
  43. data/lib/dkron-rb/models/tags.rb +152 -0
  44. data/lib/dkron-rb/numeric_seconds.rb +48 -0
  45. data/lib/dkron-rb/version.rb +26 -0
  46. data/lib/dkron.rb +9 -0
  47. data/pkg/dkron-rb-0.9.2.gem +0 -0
  48. data/seeds.rb +18 -0
  49. data/spec/api/default_api_spec.rb +80 -0
  50. data/spec/api/executions_api_spec.rb +51 -0
  51. data/spec/api/jobs_api_spec.rb +114 -0
  52. data/spec/api/main_api_spec.rb +65 -0
  53. data/spec/api/members_api_spec.rb +50 -0
  54. data/spec/api_client_spec.rb +237 -0
  55. data/spec/configuration_spec.rb +53 -0
  56. data/spec/models/agent_spec.rb +36 -0
  57. data/spec/models/execution_spec.rb +96 -0
  58. data/spec/models/inline_response_200_spec.rb +66 -0
  59. data/spec/models/job_spec.rb +186 -0
  60. data/spec/models/member_spec.rb +146 -0
  61. data/spec/models/serf_spec.rb +36 -0
  62. data/spec/models/status_spec.rb +36 -0
  63. data/spec/models/tags_spec.rb +36 -0
  64. data/spec/spec_helper.rb +122 -0
  65. metadata +309 -0
@@ -0,0 +1,7 @@
1
+ # Dkron::Agent
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
@@ -0,0 +1,131 @@
1
+ # Dkron::DefaultApi
2
+
3
+ All URIs are relative to *http://localhost:8080/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_leader**](DefaultApi.md#get_leader) | **GET** /leader |
8
+ [**leave**](DefaultApi.md#leave) | **GET** /leave |
9
+ [**status**](DefaultApi.md#status) | **GET** / |
10
+
11
+
12
+ # **get_leader**
13
+ > Member get_leader
14
+
15
+
16
+
17
+ List members.
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'dkron-rb'
23
+
24
+ api_instance = Dkron::DefaultApi.new
25
+
26
+ begin
27
+ result = api_instance.get_leader
28
+ p result
29
+ rescue Dkron::ApiError => e
30
+ puts "Exception when calling DefaultApi->get_leader: #{e}"
31
+ end
32
+ ```
33
+
34
+ ### Parameters
35
+ This endpoint does not need any parameter.
36
+
37
+ ### Return type
38
+
39
+ [**Member**](Member.md)
40
+
41
+ ### Authorization
42
+
43
+ No authorization required
44
+
45
+ ### HTTP request headers
46
+
47
+ - **Content-Type**: application/json
48
+ - **Accept**: application/json
49
+
50
+
51
+
52
+ # **leave**
53
+ > Array<Member> leave
54
+
55
+
56
+
57
+ Force the node to leave the cluster.
58
+
59
+ ### Example
60
+ ```ruby
61
+ # load the gem
62
+ require 'dkron-rb'
63
+
64
+ api_instance = Dkron::DefaultApi.new
65
+
66
+ begin
67
+ result = api_instance.leave
68
+ p result
69
+ rescue Dkron::ApiError => e
70
+ puts "Exception when calling DefaultApi->leave: #{e}"
71
+ end
72
+ ```
73
+
74
+ ### Parameters
75
+ This endpoint does not need any parameter.
76
+
77
+ ### Return type
78
+
79
+ [**Array<Member>**](Member.md)
80
+
81
+ ### Authorization
82
+
83
+ No authorization required
84
+
85
+ ### HTTP request headers
86
+
87
+ - **Content-Type**: application/json
88
+ - **Accept**: application/json
89
+
90
+
91
+
92
+ # **status**
93
+ > Status status
94
+
95
+
96
+
97
+ Gets `Status` object.
98
+
99
+ ### Example
100
+ ```ruby
101
+ # load the gem
102
+ require 'dkron-rb'
103
+
104
+ api_instance = Dkron::DefaultApi.new
105
+
106
+ begin
107
+ result = api_instance.status
108
+ p result
109
+ rescue Dkron::ApiError => e
110
+ puts "Exception when calling DefaultApi->status: #{e}"
111
+ end
112
+ ```
113
+
114
+ ### Parameters
115
+ This endpoint does not need any parameter.
116
+
117
+ ### Return type
118
+
119
+ [**Status**](Status.md)
120
+
121
+ ### Authorization
122
+
123
+ No authorization required
124
+
125
+ ### HTTP request headers
126
+
127
+ - **Content-Type**: application/json
128
+ - **Accept**: application/json
129
+
130
+
131
+
@@ -0,0 +1,13 @@
1
+ # Dkron::Execution
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **job_name** | **String** | job name | [optional]
7
+ **started_at** | **DateTime** | start time of the execution | [optional]
8
+ **finished_at** | **DateTime** | when the execution finished running | [optional]
9
+ **success** | **BOOLEAN** | the execution run successfuly | [optional]
10
+ **output** | **String** | partial output of the command execution | [optional]
11
+ **node_name** | **String** | name of the node that executed the command | [optional]
12
+
13
+
@@ -0,0 +1,55 @@
1
+ # Dkron::ExecutionsApi
2
+
3
+ All URIs are relative to *http://localhost:8080/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**list_executions_by_job**](ExecutionsApi.md#list_executions_by_job) | **GET** /executions/{job_name} |
8
+
9
+
10
+ # **list_executions_by_job**
11
+ > Array<Execution> list_executions_by_job(job_name)
12
+
13
+
14
+
15
+ List executions.
16
+
17
+ ### Example
18
+ ```ruby
19
+ # load the gem
20
+ require 'dkron-rb'
21
+
22
+ api_instance = Dkron::ExecutionsApi.new
23
+
24
+ job_name = "job_name_example" # String | The job that owns the executions to be fetched.
25
+
26
+
27
+ begin
28
+ result = api_instance.list_executions_by_job(job_name)
29
+ p result
30
+ rescue Dkron::ApiError => e
31
+ puts "Exception when calling ExecutionsApi->list_executions_by_job: #{e}"
32
+ end
33
+ ```
34
+
35
+ ### Parameters
36
+
37
+ Name | Type | Description | Notes
38
+ ------------- | ------------- | ------------- | -------------
39
+ **job_name** | **String**| The job that owns the executions to be fetched. |
40
+
41
+ ### Return type
42
+
43
+ [**Array<Execution>**](Execution.md)
44
+
45
+ ### Authorization
46
+
47
+ No authorization required
48
+
49
+ ### HTTP request headers
50
+
51
+ - **Content-Type**: application/json
52
+ - **Accept**: application/json
53
+
54
+
55
+
@@ -0,0 +1,10 @@
1
+ # Dkron::InlineResponse200
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **agent** | [**Agent**](Agent.md) | | [optional]
7
+ **serf** | [**Serf**](Serf.md) | | [optional]
8
+ **tags** | [**Tags**](Tags.md) | | [optional]
9
+
10
+
@@ -0,0 +1,24 @@
1
+ # Dkron::Job
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **name** | **String** | Name for the job. |
7
+ **schedule** | **String** | Cron expression for the job. |
8
+ **command** | **String** | Command to run. |
9
+ **shell** | **BOOLEAN** | Use shell to run the command | [optional]
10
+ **owner** | **String** | Owner of the job | [optional]
11
+ **owner_email** | **String** | Email of the owner | [optional]
12
+ **success_count** | **Integer** | Number of successful executions | [optional]
13
+ **error_count** | **Integer** | Number of failed executions | [optional]
14
+ **last_success** | **DateTime** | Last time this job executed successfully | [optional]
15
+ **last_error** | **DateTime** | Last time this job failed | [optional]
16
+ **disabled** | **BOOLEAN** | Disabled state of the job | [optional]
17
+ **tags** | **Hash<String, String>** | Target nodes tags of this job | [optional]
18
+ **retries** | **Integer** | Number of times to retry a failed job execution | [optional]
19
+ **parent_job** | **String** | The name/id of the job that will trigger the execution of this job | [optional]
20
+ **dependent_jobs** | [**Array<null>**](.md) | Array containing the jobs that depends on this one | [optional]
21
+ **processors** | **Hash<String, String>** | Processor plugins used to process executions results of this job | [optional]
22
+ **concurrency** | **String** | Concurrency policy for the job allow/forbid | [optional]
23
+
24
+
@@ -0,0 +1,237 @@
1
+ # Dkron::JobsApi
2
+
3
+ All URIs are relative to *http://localhost:8080/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**create_or_update_job**](JobsApi.md#create_or_update_job) | **POST** /jobs |
8
+ [**delete_job**](JobsApi.md#delete_job) | **DELETE** /jobs/{job_name} |
9
+ [**get_jobs**](JobsApi.md#get_jobs) | **GET** /jobs |
10
+ [**run_job**](JobsApi.md#run_job) | **POST** /jobs/{job_name} |
11
+ [**show_job_by_name**](JobsApi.md#show_job_by_name) | **GET** /jobs/{job_name} |
12
+
13
+
14
+ # **create_or_update_job**
15
+ > Job create_or_update_job(body)
16
+
17
+
18
+
19
+ Create or updates a new job.
20
+
21
+ ### Example
22
+ ```ruby
23
+ # load the gem
24
+ require 'dkron-rb'
25
+
26
+ api_instance = Dkron::JobsApi.new
27
+
28
+ body = Dkron::Job.new # Job | Updated job object
29
+
30
+
31
+ begin
32
+ result = api_instance.create_or_update_job(body)
33
+ p result
34
+ rescue Dkron::ApiError => e
35
+ puts "Exception when calling JobsApi->create_or_update_job: #{e}"
36
+ end
37
+ ```
38
+
39
+ ### Parameters
40
+
41
+ Name | Type | Description | Notes
42
+ ------------- | ------------- | ------------- | -------------
43
+ **body** | [**Job**](Job.md)| Updated job object |
44
+
45
+ ### Return type
46
+
47
+ [**Job**](Job.md)
48
+
49
+ ### Authorization
50
+
51
+ No authorization required
52
+
53
+ ### HTTP request headers
54
+
55
+ - **Content-Type**: application/json
56
+ - **Accept**: application/json
57
+
58
+
59
+
60
+ # **delete_job**
61
+ > Job delete_job(job_name)
62
+
63
+
64
+
65
+ Delete a job.
66
+
67
+ ### Example
68
+ ```ruby
69
+ # load the gem
70
+ require 'dkron-rb'
71
+
72
+ api_instance = Dkron::JobsApi.new
73
+
74
+ job_name = "job_name_example" # String | The job that needs to be deleted.
75
+
76
+
77
+ begin
78
+ result = api_instance.delete_job(job_name)
79
+ p result
80
+ rescue Dkron::ApiError => e
81
+ puts "Exception when calling JobsApi->delete_job: #{e}"
82
+ end
83
+ ```
84
+
85
+ ### Parameters
86
+
87
+ Name | Type | Description | Notes
88
+ ------------- | ------------- | ------------- | -------------
89
+ **job_name** | **String**| The job that needs to be deleted. |
90
+
91
+ ### Return type
92
+
93
+ [**Job**](Job.md)
94
+
95
+ ### Authorization
96
+
97
+ No authorization required
98
+
99
+ ### HTTP request headers
100
+
101
+ - **Content-Type**: application/json
102
+ - **Accept**: application/json
103
+
104
+
105
+
106
+ # **get_jobs**
107
+ > Array<Job> get_jobs
108
+
109
+
110
+
111
+ List jobs.
112
+
113
+ ### Example
114
+ ```ruby
115
+ # load the gem
116
+ require 'dkron-rb'
117
+
118
+ api_instance = Dkron::JobsApi.new
119
+
120
+ begin
121
+ result = api_instance.get_jobs
122
+ p result
123
+ rescue Dkron::ApiError => e
124
+ puts "Exception when calling JobsApi->get_jobs: #{e}"
125
+ end
126
+ ```
127
+
128
+ ### Parameters
129
+ This endpoint does not need any parameter.
130
+
131
+ ### Return type
132
+
133
+ [**Array<Job>**](Job.md)
134
+
135
+ ### Authorization
136
+
137
+ No authorization required
138
+
139
+ ### HTTP request headers
140
+
141
+ - **Content-Type**: application/json
142
+ - **Accept**: application/json
143
+
144
+
145
+
146
+ # **run_job**
147
+ > Job run_job(job_name)
148
+
149
+
150
+
151
+ Executes a job.
152
+
153
+ ### Example
154
+ ```ruby
155
+ # load the gem
156
+ require 'dkron-rb'
157
+
158
+ api_instance = Dkron::JobsApi.new
159
+
160
+ job_name = "job_name_example" # String | The job that needs to be run.
161
+
162
+
163
+ begin
164
+ result = api_instance.run_job(job_name)
165
+ p result
166
+ rescue Dkron::ApiError => e
167
+ puts "Exception when calling JobsApi->run_job: #{e}"
168
+ end
169
+ ```
170
+
171
+ ### Parameters
172
+
173
+ Name | Type | Description | Notes
174
+ ------------- | ------------- | ------------- | -------------
175
+ **job_name** | **String**| The job that needs to be run. |
176
+
177
+ ### Return type
178
+
179
+ [**Job**](Job.md)
180
+
181
+ ### Authorization
182
+
183
+ No authorization required
184
+
185
+ ### HTTP request headers
186
+
187
+ - **Content-Type**: application/json
188
+ - **Accept**: application/json
189
+
190
+
191
+
192
+ # **show_job_by_name**
193
+ > Job show_job_by_name(job_name)
194
+
195
+
196
+
197
+ Show a job.
198
+
199
+ ### Example
200
+ ```ruby
201
+ # load the gem
202
+ require 'dkron-rb'
203
+
204
+ api_instance = Dkron::JobsApi.new
205
+
206
+ job_name = "job_name_example" # String | The job that needs to be fetched.
207
+
208
+
209
+ begin
210
+ result = api_instance.show_job_by_name(job_name)
211
+ p result
212
+ rescue Dkron::ApiError => e
213
+ puts "Exception when calling JobsApi->show_job_by_name: #{e}"
214
+ end
215
+ ```
216
+
217
+ ### Parameters
218
+
219
+ Name | Type | Description | Notes
220
+ ------------- | ------------- | ------------- | -------------
221
+ **job_name** | **String**| The job that needs to be fetched. |
222
+
223
+ ### Return type
224
+
225
+ [**Job**](Job.md)
226
+
227
+ ### Authorization
228
+
229
+ No authorization required
230
+
231
+ ### HTTP request headers
232
+
233
+ - **Content-Type**: application/json
234
+ - **Accept**: application/json
235
+
236
+
237
+