worker_ruby 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/README.md +118 -0
- data/VERSION +1 -0
- data/VERSION.txt +1 -0
- data/docs/Complete.md +10 -0
- data/docs/CoreApi.md +200 -0
- data/docs/Error.md +8 -0
- data/docs/ErrorBody.md +9 -0
- data/docs/Group.md +12 -0
- data/docs/GroupWrapper.md +8 -0
- data/docs/GroupsApi.md +197 -0
- data/docs/GroupsWrapper.md +8 -0
- data/docs/IdStatus.md +9 -0
- data/docs/Image.md +10 -0
- data/docs/ImageWrapper.md +8 -0
- data/docs/ImagesApi.md +98 -0
- data/docs/ImagesWrapper.md +8 -0
- data/docs/Job.md +25 -0
- data/docs/JobWrapper.md +8 -0
- data/docs/JobsApi.md +684 -0
- data/docs/JobsWrapper.md +10 -0
- data/docs/Log.md +8 -0
- data/docs/NewJob.md +14 -0
- data/docs/NewJobWithImage.md +15 -0
- data/docs/NewJobsWrapper.md +8 -0
- data/docs/NewTask.md +14 -0
- data/docs/NewTasksWrapper.md +8 -0
- data/docs/Reason.md +7 -0
- data/docs/RunnerApi.md +170 -0
- data/docs/Start.md +8 -0
- data/docs/Task.md +25 -0
- data/docs/TaskWrapper.md +8 -0
- data/docs/TasksApi.md +684 -0
- data/docs/TasksWrapper.md +10 -0
- data/git_push.sh +67 -0
- data/iron_ruby.gemspec +55 -0
- data/iron_titan.gemspec +32 -0
- data/lib/iron_ruby.rb +66 -0
- data/lib/iron_ruby/api/groups_api.rb +262 -0
- data/lib/iron_ruby/api/runner_api.rb +229 -0
- data/lib/iron_ruby/api/tasks_api.rb +842 -0
- data/lib/iron_ruby/api_client.rb +378 -0
- data/lib/iron_ruby/api_error.rb +47 -0
- data/lib/iron_ruby/configuration.rb +207 -0
- data/lib/iron_ruby/models/complete.rb +220 -0
- data/lib/iron_ruby/models/error.rb +199 -0
- data/lib/iron_ruby/models/error_body.rb +208 -0
- data/lib/iron_ruby/models/group.rb +242 -0
- data/lib/iron_ruby/models/group_wrapper.rb +200 -0
- data/lib/iron_ruby/models/groups_wrapper.rb +202 -0
- data/lib/iron_ruby/models/id_status.rb +243 -0
- data/lib/iron_ruby/models/new_task.rb +270 -0
- data/lib/iron_ruby/models/new_tasks_wrapper.rb +202 -0
- data/lib/iron_ruby/models/start.rb +200 -0
- data/lib/iron_ruby/models/task.rb +427 -0
- data/lib/iron_ruby/models/task_wrapper.rb +200 -0
- data/lib/iron_ruby/models/tasks_wrapper.rb +221 -0
- data/lib/iron_ruby/version.rb +26 -0
- data/lib/iron_titan.rb +66 -0
- data/lib/iron_titan/api/core_api.rb +260 -0
- data/lib/iron_titan/api/groups_api.rb +262 -0
- data/lib/iron_titan/api/images_api.rb +138 -0
- data/lib/iron_titan/api/jobs_api.rb +842 -0
- data/lib/iron_titan/api/runner_api.rb +229 -0
- data/lib/iron_titan/api_client.rb +372 -0
- data/lib/iron_titan/api_error.rb +47 -0
- data/lib/iron_titan/configuration.rb +186 -0
- data/lib/iron_titan/models/complete.rb +220 -0
- data/lib/iron_titan/models/error.rb +199 -0
- data/lib/iron_titan/models/error_body.rb +208 -0
- data/lib/iron_titan/models/group.rb +242 -0
- data/lib/iron_titan/models/group_wrapper.rb +200 -0
- data/lib/iron_titan/models/groups_wrapper.rb +202 -0
- data/lib/iron_titan/models/id_status.rb +243 -0
- data/lib/iron_titan/models/image.rb +184 -0
- data/lib/iron_titan/models/image_wrapper.rb +161 -0
- data/lib/iron_titan/models/images_wrapper.rb +163 -0
- data/lib/iron_titan/models/job.rb +427 -0
- data/lib/iron_titan/models/job_array.rb +160 -0
- data/lib/iron_titan/models/job_wrapper.rb +200 -0
- data/lib/iron_titan/models/jobs_wrapper.rb +221 -0
- data/lib/iron_titan/models/log.rb +161 -0
- data/lib/iron_titan/models/new_job.rb +270 -0
- data/lib/iron_titan/models/new_job_array.rb +160 -0
- data/lib/iron_titan/models/new_job_with_image.rb +249 -0
- data/lib/iron_titan/models/new_jobs_wrapper.rb +202 -0
- data/lib/iron_titan/models/reason.rb +164 -0
- data/lib/iron_titan/models/start.rb +200 -0
- data/lib/iron_titan/version.rb +26 -0
- data/lib/worker_ruby.rb +66 -0
- data/lib/worker_ruby/api/groups_api.rb +262 -0
- data/lib/worker_ruby/api/runner_api.rb +229 -0
- data/lib/worker_ruby/api/tasks_api.rb +842 -0
- data/lib/worker_ruby/api_client.rb +378 -0
- data/lib/worker_ruby/api_error.rb +47 -0
- data/lib/worker_ruby/configuration.rb +207 -0
- data/lib/worker_ruby/models/complete.rb +220 -0
- data/lib/worker_ruby/models/error.rb +199 -0
- data/lib/worker_ruby/models/error_body.rb +208 -0
- data/lib/worker_ruby/models/group.rb +242 -0
- data/lib/worker_ruby/models/group_wrapper.rb +200 -0
- data/lib/worker_ruby/models/groups_wrapper.rb +202 -0
- data/lib/worker_ruby/models/id_status.rb +243 -0
- data/lib/worker_ruby/models/new_task.rb +270 -0
- data/lib/worker_ruby/models/new_tasks_wrapper.rb +202 -0
- data/lib/worker_ruby/models/start.rb +200 -0
- data/lib/worker_ruby/models/task.rb +427 -0
- data/lib/worker_ruby/models/task_wrapper.rb +200 -0
- data/lib/worker_ruby/models/tasks_wrapper.rb +221 -0
- data/lib/worker_ruby/version.rb +26 -0
- data/spec/api/CoreApi_spec.rb +99 -0
- data/spec/api/JobsApi_spec.rb +131 -0
- data/spec/api/core_api_spec.rb +99 -0
- data/spec/api/groups_api_spec.rb +94 -0
- data/spec/api/images_api_spec.rb +66 -0
- data/spec/api/jobs_api_spec.rb +220 -0
- data/spec/api/runner_api_spec.rb +88 -0
- data/spec/api/tasks_api_spec.rb +220 -0
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/models/ErrorBody_spec.rb +56 -0
- data/spec/models/JobArray_spec.rb +46 -0
- data/spec/models/JobWrapper_spec.rb +46 -0
- data/spec/models/NewJobArray_spec.rb +46 -0
- data/spec/models/NewJob_spec.rb +96 -0
- data/spec/models/complete_spec.rb +65 -0
- data/spec/models/error_body_spec.rb +59 -0
- data/spec/models/error_spec.rb +53 -0
- data/spec/models/group_spec.rb +77 -0
- data/spec/models/group_wrapper_spec.rb +53 -0
- data/spec/models/groups_wrapper_spec.rb +53 -0
- data/spec/models/id_status_spec.rb +63 -0
- data/spec/models/image_spec.rb +66 -0
- data/spec/models/image_wrapper_spec.rb +46 -0
- data/spec/models/images_wrapper_spec.rb +46 -0
- data/spec/models/job_array_spec.rb +46 -0
- data/spec/models/job_spec.rb +161 -0
- data/spec/models/job_wrapper_spec.rb +53 -0
- data/spec/models/jobs_wrapper_spec.rb +65 -0
- data/spec/models/log_spec.rb +46 -0
- data/spec/models/new_job_array_spec.rb +46 -0
- data/spec/models/new_job_spec.rb +89 -0
- data/spec/models/new_job_with_image_spec.rb +116 -0
- data/spec/models/new_jobs_wrapper_spec.rb +53 -0
- data/spec/models/new_task_spec.rb +89 -0
- data/spec/models/new_tasks_wrapper_spec.rb +53 -0
- data/spec/models/reason_spec.rb +36 -0
- data/spec/models/start_spec.rb +53 -0
- data/spec/models/task_spec.rb +163 -0
- data/spec/models/task_wrapper_spec.rb +53 -0
- data/spec/models/tasks_wrapper_spec.rb +65 -0
- data/spec/spec_helper.rb +122 -0
- data/worker_ruby-0.5.5.gem +0 -0
- data/worker_ruby.gemspec +55 -0
- metadata +420 -0
data/docs/Error.md
ADDED
data/docs/ErrorBody.md
ADDED
data/docs/Group.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# IronWorker::Group
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**name** | **String** | Name of this group. Must be different than the image name. Can ony contain alphanumeric, -, and _. | [optional]
|
7
|
+
**created_at** | **DateTime** | Time when image first used/created. | [optional]
|
8
|
+
**image** | **String** | Name of Docker image to use in this group. You should include the image tag, which should be a version number, to be more accurate. Can be overridden on a per task basis with task.image. | [optional]
|
9
|
+
**env_vars** | **Hash<String, String>** | User defined environment variables that will be passed in to each task in this group. | [optional]
|
10
|
+
**max_concurrency** | **Integer** | The maximum number of tasks that will run at the exact same time in this group. | [optional]
|
11
|
+
|
12
|
+
|
data/docs/GroupsApi.md
ADDED
@@ -0,0 +1,197 @@
|
|
1
|
+
# IronWorker::GroupsApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://localhost:8080/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**groups_get**](GroupsApi.md#groups_get) | **GET** /groups | Get all group names.
|
8
|
+
[**groups_name_get**](GroupsApi.md#groups_name_get) | **GET** /groups/{name} | Get information for a group.
|
9
|
+
[**groups_name_put**](GroupsApi.md#groups_name_put) | **PUT** /groups/{name} | Create/update a task group.
|
10
|
+
[**groups_post**](GroupsApi.md#groups_post) | **POST** /groups | Post new group
|
11
|
+
|
12
|
+
|
13
|
+
# **groups_get**
|
14
|
+
> GroupsWrapper groups_get
|
15
|
+
|
16
|
+
Get all group names.
|
17
|
+
|
18
|
+
Get a list of all the groups in the system.
|
19
|
+
|
20
|
+
### Example
|
21
|
+
```ruby
|
22
|
+
# load the gem
|
23
|
+
require 'worker_ruby'
|
24
|
+
|
25
|
+
api_instance = IronWorker::GroupsApi.new
|
26
|
+
|
27
|
+
begin
|
28
|
+
#Get all group names.
|
29
|
+
result = api_instance.groups_get
|
30
|
+
p result
|
31
|
+
rescue IronWorker::ApiError => e
|
32
|
+
puts "Exception when calling GroupsApi->groups_get: #{e}"
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
### Parameters
|
37
|
+
This endpoint does not need any parameter.
|
38
|
+
|
39
|
+
### Return type
|
40
|
+
|
41
|
+
[**GroupsWrapper**](GroupsWrapper.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
|
+
# **groups_name_get**
|
55
|
+
> GroupWrapper groups_name_get(name)
|
56
|
+
|
57
|
+
Get information for a group.
|
58
|
+
|
59
|
+
This gives more details about a task group, such as statistics.
|
60
|
+
|
61
|
+
### Example
|
62
|
+
```ruby
|
63
|
+
# load the gem
|
64
|
+
require 'worker_ruby'
|
65
|
+
|
66
|
+
api_instance = IronWorker::GroupsApi.new
|
67
|
+
|
68
|
+
name = "name_example" # String | name of the group.
|
69
|
+
|
70
|
+
|
71
|
+
begin
|
72
|
+
#Get information for a group.
|
73
|
+
result = api_instance.groups_name_get(name)
|
74
|
+
p result
|
75
|
+
rescue IronWorker::ApiError => e
|
76
|
+
puts "Exception when calling GroupsApi->groups_name_get: #{e}"
|
77
|
+
end
|
78
|
+
```
|
79
|
+
|
80
|
+
### Parameters
|
81
|
+
|
82
|
+
Name | Type | Description | Notes
|
83
|
+
------------- | ------------- | ------------- | -------------
|
84
|
+
**name** | **String**| name of the group. |
|
85
|
+
|
86
|
+
### Return type
|
87
|
+
|
88
|
+
[**GroupWrapper**](GroupWrapper.md)
|
89
|
+
|
90
|
+
### Authorization
|
91
|
+
|
92
|
+
No authorization required
|
93
|
+
|
94
|
+
### HTTP request headers
|
95
|
+
|
96
|
+
- **Content-Type**: application/json
|
97
|
+
- **Accept**: application/json
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
# **groups_name_put**
|
102
|
+
> GroupWrapper groups_name_put(name, body)
|
103
|
+
|
104
|
+
Create/update a task group.
|
105
|
+
|
106
|
+
You can set group level settings here.
|
107
|
+
|
108
|
+
### Example
|
109
|
+
```ruby
|
110
|
+
# load the gem
|
111
|
+
require 'worker_ruby'
|
112
|
+
|
113
|
+
api_instance = IronWorker::GroupsApi.new
|
114
|
+
|
115
|
+
name = "name_example" # String | name of the group.
|
116
|
+
|
117
|
+
body = IronWorker::GroupWrapper.new # GroupWrapper | Group to post.
|
118
|
+
|
119
|
+
|
120
|
+
begin
|
121
|
+
#Create/update a task group.
|
122
|
+
result = api_instance.groups_name_put(name, body)
|
123
|
+
p result
|
124
|
+
rescue IronWorker::ApiError => e
|
125
|
+
puts "Exception when calling GroupsApi->groups_name_put: #{e}"
|
126
|
+
end
|
127
|
+
```
|
128
|
+
|
129
|
+
### Parameters
|
130
|
+
|
131
|
+
Name | Type | Description | Notes
|
132
|
+
------------- | ------------- | ------------- | -------------
|
133
|
+
**name** | **String**| name of the group. |
|
134
|
+
**body** | [**GroupWrapper**](GroupWrapper.md)| Group to post. |
|
135
|
+
|
136
|
+
### Return type
|
137
|
+
|
138
|
+
[**GroupWrapper**](GroupWrapper.md)
|
139
|
+
|
140
|
+
### Authorization
|
141
|
+
|
142
|
+
No authorization required
|
143
|
+
|
144
|
+
### HTTP request headers
|
145
|
+
|
146
|
+
- **Content-Type**: application/json
|
147
|
+
- **Accept**: application/json
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
# **groups_post**
|
152
|
+
> GroupWrapper groups_post(body)
|
153
|
+
|
154
|
+
Post new group
|
155
|
+
|
156
|
+
Insert a new task group
|
157
|
+
|
158
|
+
### Example
|
159
|
+
```ruby
|
160
|
+
# load the gem
|
161
|
+
require 'worker_ruby'
|
162
|
+
|
163
|
+
api_instance = IronWorker::GroupsApi.new
|
164
|
+
|
165
|
+
body = IronWorker::GroupWrapper.new # GroupWrapper | Group to post.
|
166
|
+
|
167
|
+
|
168
|
+
begin
|
169
|
+
#Post new group
|
170
|
+
result = api_instance.groups_post(body)
|
171
|
+
p result
|
172
|
+
rescue IronWorker::ApiError => e
|
173
|
+
puts "Exception when calling GroupsApi->groups_post: #{e}"
|
174
|
+
end
|
175
|
+
```
|
176
|
+
|
177
|
+
### Parameters
|
178
|
+
|
179
|
+
Name | Type | Description | Notes
|
180
|
+
------------- | ------------- | ------------- | -------------
|
181
|
+
**body** | [**GroupWrapper**](GroupWrapper.md)| Group to post. |
|
182
|
+
|
183
|
+
### Return type
|
184
|
+
|
185
|
+
[**GroupWrapper**](GroupWrapper.md)
|
186
|
+
|
187
|
+
### Authorization
|
188
|
+
|
189
|
+
No authorization required
|
190
|
+
|
191
|
+
### HTTP request headers
|
192
|
+
|
193
|
+
- **Content-Type**: application/json
|
194
|
+
- **Accept**: application/json
|
195
|
+
|
196
|
+
|
197
|
+
|
data/docs/IdStatus.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# IronWorker::IdStatus
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**id** | **String** | Unique identifier representing a specific task. | [optional]
|
7
|
+
**status** | **String** | States and valid transitions. +---------+ +---------> delayed <----------------+ +----+----+ | | | | | +----v----+ | +---------> queued <----------------+ +----+----+ * | * | retry * creates new task +----v----+ * | running | * +--+-+-+--+ | +---------|-|-|-----+-------------+ +---|---------+ | +-----|---------+ | | | | | | | +-----v---^-+ +--v-------^+ +--v---^-+ | success | | cancelled | | error | +-----------+ +-----------+ +--------+ * delayed - has a delay. * queued - Ready to be consumed when it's turn comes. * running - Currently consumed by a runner which will attempt to process it. * success - (or complete? success/error is common javascript terminology) * error - Something went wrong. In this case more information can be obtained by inspecting the \"reason\" field. - timeout - killed - forcibly killed by worker due to resource restrictions or access violations. - bad_exit - exited with non-zero status due to program termination/crash. * cancelled - cancelled via API. More information in the reason field. - client_request - Request was cancelled by a client. | [optional]
|
8
|
+
|
9
|
+
|
data/docs/Image.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# IronTitan::Image
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**name** | **String** | Name of this image/package/code. Can and should be different than the image name (shoudn't include tag). TODO: Should we strip tag automatically if only image is passed in? | [optional]
|
7
|
+
**image** | **String** | Docker image to use for job, including the tag. |
|
8
|
+
**created_at** | **DateTime** | Time when image first used/created. | [optional]
|
9
|
+
|
10
|
+
|
data/docs/ImagesApi.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
# IronTitan::ImagesApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://localhost:8080/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**image_id_get**](ImagesApi.md#image_id_get) | **GET** /image/{id} | Get information for image id.
|
8
|
+
[**images_get**](ImagesApi.md#images_get) | **GET** /images | Get all image names.
|
9
|
+
|
10
|
+
|
11
|
+
# **image_id_get**
|
12
|
+
> ImageWrapper image_id_get(id)
|
13
|
+
|
14
|
+
Get information for image id.
|
15
|
+
|
16
|
+
This gives more details about on image, such as the image name and other statistics.
|
17
|
+
|
18
|
+
### Example
|
19
|
+
```ruby
|
20
|
+
# load the gem
|
21
|
+
require 'iron_titan'
|
22
|
+
|
23
|
+
api_instance = IronTitan::ImagesApi.new
|
24
|
+
|
25
|
+
id = "id_example" # String | ID of the image.
|
26
|
+
|
27
|
+
|
28
|
+
begin
|
29
|
+
#Get information for image id.
|
30
|
+
result = api_instance.image_id_get(id)
|
31
|
+
p result
|
32
|
+
rescue IronTitan::ApiError => e
|
33
|
+
puts "Exception when calling ImagesApi->image_id_get: #{e}"
|
34
|
+
end
|
35
|
+
```
|
36
|
+
|
37
|
+
### Parameters
|
38
|
+
|
39
|
+
Name | Type | Description | Notes
|
40
|
+
------------- | ------------- | ------------- | -------------
|
41
|
+
**id** | **String**| ID of the image. |
|
42
|
+
|
43
|
+
### Return type
|
44
|
+
|
45
|
+
[**ImageWrapper**](ImageWrapper.md)
|
46
|
+
|
47
|
+
### Authorization
|
48
|
+
|
49
|
+
No authorization required
|
50
|
+
|
51
|
+
### HTTP reuqest headers
|
52
|
+
|
53
|
+
- **Content-Type**: application/json
|
54
|
+
- **Accept**: application/json
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
# **images_get**
|
59
|
+
> ImagesWrapper images_get
|
60
|
+
|
61
|
+
Get all image names.
|
62
|
+
|
63
|
+
TODO: Using images for lack of a better term. See https://github.com/iron-io/titan/issues/43 for discussion.
|
64
|
+
|
65
|
+
### Example
|
66
|
+
```ruby
|
67
|
+
# load the gem
|
68
|
+
require 'iron_titan'
|
69
|
+
|
70
|
+
api_instance = IronTitan::ImagesApi.new
|
71
|
+
|
72
|
+
begin
|
73
|
+
#Get all image names.
|
74
|
+
result = api_instance.images_get
|
75
|
+
p result
|
76
|
+
rescue IronTitan::ApiError => e
|
77
|
+
puts "Exception when calling ImagesApi->images_get: #{e}"
|
78
|
+
end
|
79
|
+
```
|
80
|
+
|
81
|
+
### Parameters
|
82
|
+
This endpoint does not need any parameter.
|
83
|
+
|
84
|
+
### Return type
|
85
|
+
|
86
|
+
[**ImagesWrapper**](ImagesWrapper.md)
|
87
|
+
|
88
|
+
### Authorization
|
89
|
+
|
90
|
+
No authorization required
|
91
|
+
|
92
|
+
### HTTP reuqest headers
|
93
|
+
|
94
|
+
- **Content-Type**: application/json
|
95
|
+
- **Accept**: application/json
|
96
|
+
|
97
|
+
|
98
|
+
|
data/docs/Job.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# IronTitan::Job
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**image** | **String** | Name of Docker image to use. This is optional and can be used to override the image defined at the group level. |
|
7
|
+
**payload** | **String** | Payload for the job. This is what you pass into each job to make it do something. | [optional]
|
8
|
+
**delay** | **Integer** | Number of seconds to wait before queueing the job for consumption for the first time. Must be a positive integer. Jobs with a delay start in state \"delayed\" and transition to \"running\" after delay seconds. | [optional] [default to 0]
|
9
|
+
**timeout** | **Integer** | Maximum runtime in seconds. If a consumer retrieves the job, but does not change it's status within timeout seconds, the job is considered failed, with reason timeout (Titan may allow a small grace period). The consumer should also kill the job after timeout seconds. If a consumer tries to change status after Titan has already timed out the job, the consumer will be ignored. | [optional] [default to 60]
|
10
|
+
**priority** | **Integer** | Priority of the job. Higher has more priority. 3 levels from 0-2. Jobs at same priority are processed in FIFO order. |
|
11
|
+
**max_retries** | **Integer** | \"Number of automatic retries this job is allowed. A retry will be attempted if a task fails. Max 25. Automatic retries are performed by titan when a task reaches a failed state and has `max_retries` > 0. A retry is performed by queueing a new job with the same image id and payload. The new job's max_retries is one less than the original. The new job's `retry_of` field is set to the original Job ID. Titan will delay the new job for retries_delay seconds before queueing it. Cancelled or successful tasks are never automatically retried.\" | [optional] [default to 0]
|
12
|
+
**retries_delay** | **Integer** | Time in seconds to wait before retrying the job. Must be a non-negative integer. | [optional] [default to 60]
|
13
|
+
**id** | **String** | Unique identifier representing a specific job. | [optional]
|
14
|
+
**status** | **String** | States and valid transitions. +---------+ +---------> delayed <----------------+ +----+----+ | | | | | +----v----+ | +---------> queued <----------------+ +----+----+ * | * | retry * creates new job +----v----+ * | running | * +--+-+-+--+ | +---------|-|-|-----+-------------+ +---|---------+ | +-----|---------+ | | | | | | | +-----v---^-+ +--v-------^+ +--v---^-+ | success | | cancelled | | error | +-----------+ +-----------+ +--------+ * delayed - has a delay. * queued - Ready to be consumed when it's turn comes. * running - Currently consumed by a runner which will attempt to process it. * success - (or complete? success/error is common javascript terminology) * error - Something went wrong. In this case more information can be obtained by inspecting the \"reason\" field. - timeout - killed - forcibly killed by worker due to resource restrictions or access violations. - bad_exit - exited with non-zero status due to program termination/crash. * cancelled - cancelled via API. More information in the reason field. - client_request - Request was cancelled by a client. | [optional]
|
15
|
+
**group_name** | **String** | Group this job belongs to. | [optional]
|
16
|
+
**error** | **String** | The error message, if status is 'error'. This is errors due to things outside the job itself. Errors from user code will be found in the log. | [optional]
|
17
|
+
**reason** | **String** | Machine usable reason for job being in this state. Valid values for error status are `timeout | killed | bad_exit`. Valid values for cancelled status are `client_request`. For everything else, this is undefined. | [optional]
|
18
|
+
**created_at** | **DateTime** | Time when job was submitted. Always in UTC. | [optional]
|
19
|
+
**started_at** | **DateTime** | Time when job started execution. Always in UTC. | [optional]
|
20
|
+
**completed_at** | **DateTime** | Time when job completed, whether it was successul or failed. Always in UTC. | [optional]
|
21
|
+
**retry_of** | **String** | If this field is set, then this job is a retry of the ID in this field. | [optional]
|
22
|
+
**retry_at** | **String** | If this field is set, then this job was retried by the job referenced in this field. | [optional]
|
23
|
+
**env_vars** | **Hash<String, String>** | Env vars for the task. Comes from the ones set on the Group. | [optional]
|
24
|
+
|
25
|
+
|
data/docs/JobWrapper.md
ADDED
data/docs/JobsApi.md
ADDED
@@ -0,0 +1,684 @@
|
|
1
|
+
# IronTitan::JobsApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://localhost:8080/v1*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**groups_name_jobs_get**](JobsApi.md#groups_name_jobs_get) | **GET** /groups/{name}/jobs | Get job list by group name.
|
8
|
+
[**groups_name_jobs_id_cancel_post**](JobsApi.md#groups_name_jobs_id_cancel_post) | **POST** /groups/{name}/jobs/{id}/cancel | Cancel a job.
|
9
|
+
[**groups_name_jobs_id_delete**](JobsApi.md#groups_name_jobs_id_delete) | **DELETE** /groups/{name}/jobs/{id} | Delete the job.
|
10
|
+
[**groups_name_jobs_id_error_post**](JobsApi.md#groups_name_jobs_id_error_post) | **POST** /groups/{name}/jobs/{id}/error | Mark job as failed.
|
11
|
+
[**groups_name_jobs_id_get**](JobsApi.md#groups_name_jobs_id_get) | **GET** /groups/{name}/jobs/{id} | Gets job by id
|
12
|
+
[**groups_name_jobs_id_log_get**](JobsApi.md#groups_name_jobs_id_log_get) | **GET** /groups/{name}/jobs/{id}/log | Get the log of a completed job.
|
13
|
+
[**groups_name_jobs_id_log_post**](JobsApi.md#groups_name_jobs_id_log_post) | **POST** /groups/{name}/jobs/{id}/log | Send in a log for storage.
|
14
|
+
[**groups_name_jobs_id_retry_post**](JobsApi.md#groups_name_jobs_id_retry_post) | **POST** /groups/{name}/jobs/{id}/retry | Retry a job.
|
15
|
+
[**groups_name_jobs_id_start_post**](JobsApi.md#groups_name_jobs_id_start_post) | **POST** /groups/{name}/jobs/{id}/start | Mark job as started, ie: status = 'running'
|
16
|
+
[**groups_name_jobs_id_success_post**](JobsApi.md#groups_name_jobs_id_success_post) | **POST** /groups/{name}/jobs/{id}/success | Mark job as succeeded.
|
17
|
+
[**groups_name_jobs_id_touch_post**](JobsApi.md#groups_name_jobs_id_touch_post) | **POST** /groups/{name}/jobs/{id}/touch | Extend job timeout.
|
18
|
+
[**groups_name_jobs_post**](JobsApi.md#groups_name_jobs_post) | **POST** /groups/{name}/jobs | Enqueue Job
|
19
|
+
[**jobs_get**](JobsApi.md#jobs_get) | **GET** /jobs | Get next job.
|
20
|
+
|
21
|
+
|
22
|
+
# **groups_name_jobs_get**
|
23
|
+
> JobsWrapper groups_name_jobs_get(name, opts)
|
24
|
+
|
25
|
+
Get job list by group name.
|
26
|
+
|
27
|
+
This will list jobs for a particular group.
|
28
|
+
|
29
|
+
### Example
|
30
|
+
```ruby
|
31
|
+
# load the gem
|
32
|
+
require 'iron_titan'
|
33
|
+
|
34
|
+
api_instance = IronTitan::JobsApi.new
|
35
|
+
|
36
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
37
|
+
|
38
|
+
opts = {
|
39
|
+
created_after: DateTime.parse("2013-10-20T19:20:30+01:00"), # DateTime | Will return jobs created after this time. In RFC3339 format.
|
40
|
+
n: 56, # Integer | Number of jobs to return per page. Default is 50. Max is 1000.
|
41
|
+
cursor: "cursor_example" # String | Pass this in from a previous query to paginate results.
|
42
|
+
}
|
43
|
+
|
44
|
+
begin
|
45
|
+
#Get job list by group name.
|
46
|
+
result = api_instance.groups_name_jobs_get(name, opts)
|
47
|
+
p result
|
48
|
+
rescue IronTitan::ApiError => e
|
49
|
+
puts "Exception when calling JobsApi->groups_name_jobs_get: #{e}"
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
### Parameters
|
54
|
+
|
55
|
+
Name | Type | Description | Notes
|
56
|
+
------------- | ------------- | ------------- | -------------
|
57
|
+
**name** | **String**| Name of group for this set of jobs. |
|
58
|
+
**created_after** | **DateTime**| Will return jobs created after this time. In RFC3339 format. | [optional]
|
59
|
+
**n** | **Integer**| Number of jobs to return per page. Default is 50. Max is 1000. | [optional]
|
60
|
+
**cursor** | **String**| Pass this in from a previous query to paginate results. | [optional]
|
61
|
+
|
62
|
+
### Return type
|
63
|
+
|
64
|
+
[**JobsWrapper**](JobsWrapper.md)
|
65
|
+
|
66
|
+
### Authorization
|
67
|
+
|
68
|
+
No authorization required
|
69
|
+
|
70
|
+
### HTTP request headers
|
71
|
+
|
72
|
+
- **Content-Type**: application/json
|
73
|
+
- **Accept**: application/json
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
# **groups_name_jobs_id_cancel_post**
|
78
|
+
> JobWrapper groups_name_jobs_id_cancel_post(name, id)
|
79
|
+
|
80
|
+
Cancel a job.
|
81
|
+
|
82
|
+
Cancels a job in delayed, queued or running status. The worker may continue to run a running job. reason is set to `client_request`. The job's completed_at field is set to the current time on the jobserver.
|
83
|
+
|
84
|
+
### Example
|
85
|
+
```ruby
|
86
|
+
# load the gem
|
87
|
+
require 'iron_titan'
|
88
|
+
|
89
|
+
api_instance = IronTitan::JobsApi.new
|
90
|
+
|
91
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
92
|
+
|
93
|
+
id = "id_example" # String | Job id
|
94
|
+
|
95
|
+
|
96
|
+
begin
|
97
|
+
#Cancel a job.
|
98
|
+
result = api_instance.groups_name_jobs_id_cancel_post(name, id)
|
99
|
+
p result
|
100
|
+
rescue IronTitan::ApiError => e
|
101
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_cancel_post: #{e}"
|
102
|
+
end
|
103
|
+
```
|
104
|
+
|
105
|
+
### Parameters
|
106
|
+
|
107
|
+
Name | Type | Description | Notes
|
108
|
+
------------- | ------------- | ------------- | -------------
|
109
|
+
**name** | **String**| Name of group for this set of jobs. |
|
110
|
+
**id** | **String**| Job id |
|
111
|
+
|
112
|
+
### Return type
|
113
|
+
|
114
|
+
[**JobWrapper**](JobWrapper.md)
|
115
|
+
|
116
|
+
### Authorization
|
117
|
+
|
118
|
+
No authorization required
|
119
|
+
|
120
|
+
### HTTP request headers
|
121
|
+
|
122
|
+
- **Content-Type**: application/json
|
123
|
+
- **Accept**: application/json
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
# **groups_name_jobs_id_delete**
|
128
|
+
> groups_name_jobs_id_delete(name, id)
|
129
|
+
|
130
|
+
Delete the job.
|
131
|
+
|
132
|
+
Delete only succeeds if job status is one of `succeeded | failed | cancelled`. Cancel a job if it is another state and needs to be deleted. All information about the job, including the log, is irretrievably lost when this is invoked.
|
133
|
+
|
134
|
+
### Example
|
135
|
+
```ruby
|
136
|
+
# load the gem
|
137
|
+
require 'iron_titan'
|
138
|
+
|
139
|
+
api_instance = IronTitan::JobsApi.new
|
140
|
+
|
141
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
142
|
+
|
143
|
+
id = "id_example" # String | Job id
|
144
|
+
|
145
|
+
|
146
|
+
begin
|
147
|
+
#Delete the job.
|
148
|
+
api_instance.groups_name_jobs_id_delete(name, id)
|
149
|
+
rescue IronTitan::ApiError => e
|
150
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_delete: #{e}"
|
151
|
+
end
|
152
|
+
```
|
153
|
+
|
154
|
+
### Parameters
|
155
|
+
|
156
|
+
Name | Type | Description | Notes
|
157
|
+
------------- | ------------- | ------------- | -------------
|
158
|
+
**name** | **String**| Name of group for this set of jobs. |
|
159
|
+
**id** | **String**| Job id |
|
160
|
+
|
161
|
+
### Return type
|
162
|
+
|
163
|
+
nil (empty response body)
|
164
|
+
|
165
|
+
### Authorization
|
166
|
+
|
167
|
+
No authorization required
|
168
|
+
|
169
|
+
### HTTP request headers
|
170
|
+
|
171
|
+
- **Content-Type**: application/json
|
172
|
+
- **Accept**: application/json
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
# **groups_name_jobs_id_error_post**
|
177
|
+
> JobWrapper groups_name_jobs_id_error_post(name, id, body)
|
178
|
+
|
179
|
+
Mark job as failed.
|
180
|
+
|
181
|
+
Job is marked as failed if it was in a valid state. Job's `finished_at` time is initialized.
|
182
|
+
|
183
|
+
### Example
|
184
|
+
```ruby
|
185
|
+
# load the gem
|
186
|
+
require 'iron_titan'
|
187
|
+
|
188
|
+
api_instance = IronTitan::JobsApi.new
|
189
|
+
|
190
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
191
|
+
|
192
|
+
id = "id_example" # String | Job id
|
193
|
+
|
194
|
+
body = IronTitan::Complete.new # Complete |
|
195
|
+
|
196
|
+
|
197
|
+
begin
|
198
|
+
#Mark job as failed.
|
199
|
+
result = api_instance.groups_name_jobs_id_error_post(name, id, body)
|
200
|
+
p result
|
201
|
+
rescue IronTitan::ApiError => e
|
202
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_error_post: #{e}"
|
203
|
+
end
|
204
|
+
```
|
205
|
+
|
206
|
+
### Parameters
|
207
|
+
|
208
|
+
Name | Type | Description | Notes
|
209
|
+
------------- | ------------- | ------------- | -------------
|
210
|
+
**name** | **String**| Name of group for this set of jobs. |
|
211
|
+
**id** | **String**| Job id |
|
212
|
+
**body** | [**Complete**](Complete.md)| |
|
213
|
+
|
214
|
+
### Return type
|
215
|
+
|
216
|
+
[**JobWrapper**](JobWrapper.md)
|
217
|
+
|
218
|
+
### Authorization
|
219
|
+
|
220
|
+
No authorization required
|
221
|
+
|
222
|
+
### HTTP request headers
|
223
|
+
|
224
|
+
- **Content-Type**: application/json
|
225
|
+
- **Accept**: application/json
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
# **groups_name_jobs_id_get**
|
230
|
+
> JobWrapper groups_name_jobs_id_get(name, id)
|
231
|
+
|
232
|
+
Gets job by id
|
233
|
+
|
234
|
+
Gets a job by id.
|
235
|
+
|
236
|
+
### Example
|
237
|
+
```ruby
|
238
|
+
# load the gem
|
239
|
+
require 'iron_titan'
|
240
|
+
|
241
|
+
api_instance = IronTitan::JobsApi.new
|
242
|
+
|
243
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
244
|
+
|
245
|
+
id = "id_example" # String | Job id
|
246
|
+
|
247
|
+
|
248
|
+
begin
|
249
|
+
#Gets job by id
|
250
|
+
result = api_instance.groups_name_jobs_id_get(name, id)
|
251
|
+
p result
|
252
|
+
rescue IronTitan::ApiError => e
|
253
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_get: #{e}"
|
254
|
+
end
|
255
|
+
```
|
256
|
+
|
257
|
+
### Parameters
|
258
|
+
|
259
|
+
Name | Type | Description | Notes
|
260
|
+
------------- | ------------- | ------------- | -------------
|
261
|
+
**name** | **String**| Name of group for this set of jobs. |
|
262
|
+
**id** | **String**| Job id |
|
263
|
+
|
264
|
+
### Return type
|
265
|
+
|
266
|
+
[**JobWrapper**](JobWrapper.md)
|
267
|
+
|
268
|
+
### Authorization
|
269
|
+
|
270
|
+
No authorization required
|
271
|
+
|
272
|
+
### HTTP request headers
|
273
|
+
|
274
|
+
- **Content-Type**: application/json
|
275
|
+
- **Accept**: application/json
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
# **groups_name_jobs_id_log_get**
|
280
|
+
> String groups_name_jobs_id_log_get(name, id)
|
281
|
+
|
282
|
+
Get the log of a completed job.
|
283
|
+
|
284
|
+
Retrieves the log from log storage.
|
285
|
+
|
286
|
+
### Example
|
287
|
+
```ruby
|
288
|
+
# load the gem
|
289
|
+
require 'iron_titan'
|
290
|
+
|
291
|
+
api_instance = IronTitan::JobsApi.new
|
292
|
+
|
293
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
294
|
+
|
295
|
+
id = "id_example" # String | Job id
|
296
|
+
|
297
|
+
|
298
|
+
begin
|
299
|
+
#Get the log of a completed job.
|
300
|
+
result = api_instance.groups_name_jobs_id_log_get(name, id)
|
301
|
+
p result
|
302
|
+
rescue IronTitan::ApiError => e
|
303
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_log_get: #{e}"
|
304
|
+
end
|
305
|
+
```
|
306
|
+
|
307
|
+
### Parameters
|
308
|
+
|
309
|
+
Name | Type | Description | Notes
|
310
|
+
------------- | ------------- | ------------- | -------------
|
311
|
+
**name** | **String**| Name of group for this set of jobs. |
|
312
|
+
**id** | **String**| Job id |
|
313
|
+
|
314
|
+
### Return type
|
315
|
+
|
316
|
+
**String**
|
317
|
+
|
318
|
+
### Authorization
|
319
|
+
|
320
|
+
No authorization required
|
321
|
+
|
322
|
+
### HTTP request headers
|
323
|
+
|
324
|
+
- **Content-Type**: application/json
|
325
|
+
- **Accept**: text/plain
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
# **groups_name_jobs_id_log_post**
|
330
|
+
> JobWrapper groups_name_jobs_id_log_post(name, id, log)
|
331
|
+
|
332
|
+
Send in a log for storage.
|
333
|
+
|
334
|
+
Logs are sent after a job completes since they may be very large and the runner can process the next job.
|
335
|
+
|
336
|
+
### Example
|
337
|
+
```ruby
|
338
|
+
# load the gem
|
339
|
+
require 'iron_titan'
|
340
|
+
|
341
|
+
api_instance = IronTitan::JobsApi.new
|
342
|
+
|
343
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
344
|
+
|
345
|
+
id = "id_example" # String | Job id
|
346
|
+
|
347
|
+
log = File.new("/path/to/file.txt") # File | Output log for the job. Content-Type must be \"text/plain; charset=utf-8\".
|
348
|
+
|
349
|
+
|
350
|
+
begin
|
351
|
+
#Send in a log for storage.
|
352
|
+
result = api_instance.groups_name_jobs_id_log_post(name, id, log)
|
353
|
+
p result
|
354
|
+
rescue IronTitan::ApiError => e
|
355
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_log_post: #{e}"
|
356
|
+
end
|
357
|
+
```
|
358
|
+
|
359
|
+
### Parameters
|
360
|
+
|
361
|
+
Name | Type | Description | Notes
|
362
|
+
------------- | ------------- | ------------- | -------------
|
363
|
+
**name** | **String**| Name of group for this set of jobs. |
|
364
|
+
**id** | **String**| Job id |
|
365
|
+
**log** | **File**| Output log for the job. Content-Type must be \"text/plain; charset=utf-8\". |
|
366
|
+
|
367
|
+
### Return type
|
368
|
+
|
369
|
+
[**JobWrapper**](JobWrapper.md)
|
370
|
+
|
371
|
+
### Authorization
|
372
|
+
|
373
|
+
No authorization required
|
374
|
+
|
375
|
+
### HTTP request headers
|
376
|
+
|
377
|
+
- **Content-Type**: multipart/form-data
|
378
|
+
- **Accept**: application/json
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
# **groups_name_jobs_id_retry_post**
|
383
|
+
> JobWrapper groups_name_jobs_id_retry_post(name, id)
|
384
|
+
|
385
|
+
Retry a job.
|
386
|
+
|
387
|
+
\"The /retry endpoint can be used to force a retry of jobs with status succeeded or cancelled. It can also be used to retry jobs that in the failed state, but whose max_retries field is 0. The retried job will continue to have max_retries = 0.\"
|
388
|
+
|
389
|
+
### Example
|
390
|
+
```ruby
|
391
|
+
# load the gem
|
392
|
+
require 'iron_titan'
|
393
|
+
|
394
|
+
api_instance = IronTitan::JobsApi.new
|
395
|
+
|
396
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
397
|
+
|
398
|
+
id = "id_example" # String | Job id
|
399
|
+
|
400
|
+
|
401
|
+
begin
|
402
|
+
#Retry a job.
|
403
|
+
result = api_instance.groups_name_jobs_id_retry_post(name, id)
|
404
|
+
p result
|
405
|
+
rescue IronTitan::ApiError => e
|
406
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_retry_post: #{e}"
|
407
|
+
end
|
408
|
+
```
|
409
|
+
|
410
|
+
### Parameters
|
411
|
+
|
412
|
+
Name | Type | Description | Notes
|
413
|
+
------------- | ------------- | ------------- | -------------
|
414
|
+
**name** | **String**| Name of group for this set of jobs. |
|
415
|
+
**id** | **String**| Job id |
|
416
|
+
|
417
|
+
### Return type
|
418
|
+
|
419
|
+
[**JobWrapper**](JobWrapper.md)
|
420
|
+
|
421
|
+
### Authorization
|
422
|
+
|
423
|
+
No authorization required
|
424
|
+
|
425
|
+
### HTTP request headers
|
426
|
+
|
427
|
+
- **Content-Type**: application/json
|
428
|
+
- **Accept**: application/json
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
# **groups_name_jobs_id_start_post**
|
433
|
+
> JobWrapper groups_name_jobs_id_start_post(name, id, body)
|
434
|
+
|
435
|
+
Mark job as started, ie: status = 'running'
|
436
|
+
|
437
|
+
Job status is changed to 'running' if it was in a valid state before. Job's `started_at` time is initialized.
|
438
|
+
|
439
|
+
### Example
|
440
|
+
```ruby
|
441
|
+
# load the gem
|
442
|
+
require 'iron_titan'
|
443
|
+
|
444
|
+
api_instance = IronTitan::JobsApi.new
|
445
|
+
|
446
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
447
|
+
|
448
|
+
id = "id_example" # String | Job id
|
449
|
+
|
450
|
+
body = IronTitan::Start.new # Start |
|
451
|
+
|
452
|
+
|
453
|
+
begin
|
454
|
+
#Mark job as started, ie: status = 'running'
|
455
|
+
result = api_instance.groups_name_jobs_id_start_post(name, id, body)
|
456
|
+
p result
|
457
|
+
rescue IronTitan::ApiError => e
|
458
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_start_post: #{e}"
|
459
|
+
end
|
460
|
+
```
|
461
|
+
|
462
|
+
### Parameters
|
463
|
+
|
464
|
+
Name | Type | Description | Notes
|
465
|
+
------------- | ------------- | ------------- | -------------
|
466
|
+
**name** | **String**| Name of group for this set of jobs. |
|
467
|
+
**id** | **String**| Job id |
|
468
|
+
**body** | [**Start**](Start.md)| |
|
469
|
+
|
470
|
+
### Return type
|
471
|
+
|
472
|
+
[**JobWrapper**](JobWrapper.md)
|
473
|
+
|
474
|
+
### Authorization
|
475
|
+
|
476
|
+
No authorization required
|
477
|
+
|
478
|
+
### HTTP request headers
|
479
|
+
|
480
|
+
- **Content-Type**: application/json
|
481
|
+
- **Accept**: application/json
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
# **groups_name_jobs_id_success_post**
|
486
|
+
> JobWrapper groups_name_jobs_id_success_post(name, id, body)
|
487
|
+
|
488
|
+
Mark job as succeeded.
|
489
|
+
|
490
|
+
Job status is changed to succeeded if it was in a valid state before. Job's `completed_at` time is initialized.
|
491
|
+
|
492
|
+
### Example
|
493
|
+
```ruby
|
494
|
+
# load the gem
|
495
|
+
require 'iron_titan'
|
496
|
+
|
497
|
+
api_instance = IronTitan::JobsApi.new
|
498
|
+
|
499
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
500
|
+
|
501
|
+
id = "id_example" # String | Job id
|
502
|
+
|
503
|
+
body = IronTitan::Complete.new # Complete |
|
504
|
+
|
505
|
+
|
506
|
+
begin
|
507
|
+
#Mark job as succeeded.
|
508
|
+
result = api_instance.groups_name_jobs_id_success_post(name, id, body)
|
509
|
+
p result
|
510
|
+
rescue IronTitan::ApiError => e
|
511
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_success_post: #{e}"
|
512
|
+
end
|
513
|
+
```
|
514
|
+
|
515
|
+
### Parameters
|
516
|
+
|
517
|
+
Name | Type | Description | Notes
|
518
|
+
------------- | ------------- | ------------- | -------------
|
519
|
+
**name** | **String**| Name of group for this set of jobs. |
|
520
|
+
**id** | **String**| Job id |
|
521
|
+
**body** | [**Complete**](Complete.md)| |
|
522
|
+
|
523
|
+
### Return type
|
524
|
+
|
525
|
+
[**JobWrapper**](JobWrapper.md)
|
526
|
+
|
527
|
+
### Authorization
|
528
|
+
|
529
|
+
No authorization required
|
530
|
+
|
531
|
+
### HTTP request headers
|
532
|
+
|
533
|
+
- **Content-Type**: application/json
|
534
|
+
- **Accept**: application/json
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
# **groups_name_jobs_id_touch_post**
|
539
|
+
> groups_name_jobs_id_touch_post(name, id)
|
540
|
+
|
541
|
+
Extend job timeout.
|
542
|
+
|
543
|
+
Consumers can sometimes take a while to run the task after accepting it. An example is when the runner does not have the docker image locally, it can spend a significant time downloading the image. If the timeout is small, the job may never get to run, or run but not be accepted by Titan. Consumers can touch the job before it times out. Titan will reset the timeout, giving the consumer another timeout seconds to run the job. Touch is only valid while the job is in a running state. If touch fails, the runner may stop running the job.
|
544
|
+
|
545
|
+
### Example
|
546
|
+
```ruby
|
547
|
+
# load the gem
|
548
|
+
require 'iron_titan'
|
549
|
+
|
550
|
+
api_instance = IronTitan::JobsApi.new
|
551
|
+
|
552
|
+
name = "name_example" # String | Name of group for this set of jobs.
|
553
|
+
|
554
|
+
id = "id_example" # String | Job id
|
555
|
+
|
556
|
+
|
557
|
+
begin
|
558
|
+
#Extend job timeout.
|
559
|
+
api_instance.groups_name_jobs_id_touch_post(name, id)
|
560
|
+
rescue IronTitan::ApiError => e
|
561
|
+
puts "Exception when calling JobsApi->groups_name_jobs_id_touch_post: #{e}"
|
562
|
+
end
|
563
|
+
```
|
564
|
+
|
565
|
+
### Parameters
|
566
|
+
|
567
|
+
Name | Type | Description | Notes
|
568
|
+
------------- | ------------- | ------------- | -------------
|
569
|
+
**name** | **String**| Name of group for this set of jobs. |
|
570
|
+
**id** | **String**| Job id |
|
571
|
+
|
572
|
+
### Return type
|
573
|
+
|
574
|
+
nil (empty response body)
|
575
|
+
|
576
|
+
### Authorization
|
577
|
+
|
578
|
+
No authorization required
|
579
|
+
|
580
|
+
### HTTP request headers
|
581
|
+
|
582
|
+
- **Content-Type**: application/json
|
583
|
+
- **Accept**: application/json
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
# **groups_name_jobs_post**
|
588
|
+
> JobsWrapper groups_name_jobs_post(name, body)
|
589
|
+
|
590
|
+
Enqueue Job
|
591
|
+
|
592
|
+
Enqueues job(s). If any of the jobs is invalid, none of the jobs are enqueued.
|
593
|
+
|
594
|
+
### Example
|
595
|
+
```ruby
|
596
|
+
# load the gem
|
597
|
+
require 'iron_titan'
|
598
|
+
|
599
|
+
api_instance = IronTitan::JobsApi.new
|
600
|
+
|
601
|
+
name = "name_example" # String | name of the group.
|
602
|
+
|
603
|
+
body = IronTitan::NewJobsWrapper.new # NewJobsWrapper | Array of jobs to post.
|
604
|
+
|
605
|
+
|
606
|
+
begin
|
607
|
+
#Enqueue Job
|
608
|
+
result = api_instance.groups_name_jobs_post(name, body)
|
609
|
+
p result
|
610
|
+
rescue IronTitan::ApiError => e
|
611
|
+
puts "Exception when calling JobsApi->groups_name_jobs_post: #{e}"
|
612
|
+
end
|
613
|
+
```
|
614
|
+
|
615
|
+
### Parameters
|
616
|
+
|
617
|
+
Name | Type | Description | Notes
|
618
|
+
------------- | ------------- | ------------- | -------------
|
619
|
+
**name** | **String**| name of the group. |
|
620
|
+
**body** | [**NewJobsWrapper**](NewJobsWrapper.md)| Array of jobs to post. |
|
621
|
+
|
622
|
+
### Return type
|
623
|
+
|
624
|
+
[**JobsWrapper**](JobsWrapper.md)
|
625
|
+
|
626
|
+
### Authorization
|
627
|
+
|
628
|
+
No authorization required
|
629
|
+
|
630
|
+
### HTTP request headers
|
631
|
+
|
632
|
+
- **Content-Type**: application/json
|
633
|
+
- **Accept**: application/json
|
634
|
+
|
635
|
+
|
636
|
+
|
637
|
+
# **jobs_get**
|
638
|
+
> JobsWrapper jobs_get(opts)
|
639
|
+
|
640
|
+
Get next job.
|
641
|
+
|
642
|
+
Gets the next job in the queue, ready for processing. Titan may return <=n jobs. Consumers should start processing jobs in order. Each returned job is set to `status` \"running\" and `started_at` is set to the current time. No other consumer can retrieve this job.
|
643
|
+
|
644
|
+
### Example
|
645
|
+
```ruby
|
646
|
+
# load the gem
|
647
|
+
require 'iron_titan'
|
648
|
+
|
649
|
+
api_instance = IronTitan::JobsApi.new
|
650
|
+
|
651
|
+
opts = {
|
652
|
+
n: 1 # Integer | Number of jobs to return.
|
653
|
+
}
|
654
|
+
|
655
|
+
begin
|
656
|
+
#Get next job.
|
657
|
+
result = api_instance.jobs_get(opts)
|
658
|
+
p result
|
659
|
+
rescue IronTitan::ApiError => e
|
660
|
+
puts "Exception when calling JobsApi->jobs_get: #{e}"
|
661
|
+
end
|
662
|
+
```
|
663
|
+
|
664
|
+
### Parameters
|
665
|
+
|
666
|
+
Name | Type | Description | Notes
|
667
|
+
------------- | ------------- | ------------- | -------------
|
668
|
+
**n** | **Integer**| Number of jobs to return. | [optional] [default to 1]
|
669
|
+
|
670
|
+
### Return type
|
671
|
+
|
672
|
+
[**JobsWrapper**](JobsWrapper.md)
|
673
|
+
|
674
|
+
### Authorization
|
675
|
+
|
676
|
+
No authorization required
|
677
|
+
|
678
|
+
### HTTP request headers
|
679
|
+
|
680
|
+
- **Content-Type**: application/json
|
681
|
+
- **Accept**: application/json
|
682
|
+
|
683
|
+
|
684
|
+
|