worker_ruby 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +118 -0
  4. data/VERSION +1 -0
  5. data/VERSION.txt +1 -0
  6. data/docs/Complete.md +10 -0
  7. data/docs/CoreApi.md +200 -0
  8. data/docs/Error.md +8 -0
  9. data/docs/ErrorBody.md +9 -0
  10. data/docs/Group.md +12 -0
  11. data/docs/GroupWrapper.md +8 -0
  12. data/docs/GroupsApi.md +197 -0
  13. data/docs/GroupsWrapper.md +8 -0
  14. data/docs/IdStatus.md +9 -0
  15. data/docs/Image.md +10 -0
  16. data/docs/ImageWrapper.md +8 -0
  17. data/docs/ImagesApi.md +98 -0
  18. data/docs/ImagesWrapper.md +8 -0
  19. data/docs/Job.md +25 -0
  20. data/docs/JobWrapper.md +8 -0
  21. data/docs/JobsApi.md +684 -0
  22. data/docs/JobsWrapper.md +10 -0
  23. data/docs/Log.md +8 -0
  24. data/docs/NewJob.md +14 -0
  25. data/docs/NewJobWithImage.md +15 -0
  26. data/docs/NewJobsWrapper.md +8 -0
  27. data/docs/NewTask.md +14 -0
  28. data/docs/NewTasksWrapper.md +8 -0
  29. data/docs/Reason.md +7 -0
  30. data/docs/RunnerApi.md +170 -0
  31. data/docs/Start.md +8 -0
  32. data/docs/Task.md +25 -0
  33. data/docs/TaskWrapper.md +8 -0
  34. data/docs/TasksApi.md +684 -0
  35. data/docs/TasksWrapper.md +10 -0
  36. data/git_push.sh +67 -0
  37. data/iron_ruby.gemspec +55 -0
  38. data/iron_titan.gemspec +32 -0
  39. data/lib/iron_ruby.rb +66 -0
  40. data/lib/iron_ruby/api/groups_api.rb +262 -0
  41. data/lib/iron_ruby/api/runner_api.rb +229 -0
  42. data/lib/iron_ruby/api/tasks_api.rb +842 -0
  43. data/lib/iron_ruby/api_client.rb +378 -0
  44. data/lib/iron_ruby/api_error.rb +47 -0
  45. data/lib/iron_ruby/configuration.rb +207 -0
  46. data/lib/iron_ruby/models/complete.rb +220 -0
  47. data/lib/iron_ruby/models/error.rb +199 -0
  48. data/lib/iron_ruby/models/error_body.rb +208 -0
  49. data/lib/iron_ruby/models/group.rb +242 -0
  50. data/lib/iron_ruby/models/group_wrapper.rb +200 -0
  51. data/lib/iron_ruby/models/groups_wrapper.rb +202 -0
  52. data/lib/iron_ruby/models/id_status.rb +243 -0
  53. data/lib/iron_ruby/models/new_task.rb +270 -0
  54. data/lib/iron_ruby/models/new_tasks_wrapper.rb +202 -0
  55. data/lib/iron_ruby/models/start.rb +200 -0
  56. data/lib/iron_ruby/models/task.rb +427 -0
  57. data/lib/iron_ruby/models/task_wrapper.rb +200 -0
  58. data/lib/iron_ruby/models/tasks_wrapper.rb +221 -0
  59. data/lib/iron_ruby/version.rb +26 -0
  60. data/lib/iron_titan.rb +66 -0
  61. data/lib/iron_titan/api/core_api.rb +260 -0
  62. data/lib/iron_titan/api/groups_api.rb +262 -0
  63. data/lib/iron_titan/api/images_api.rb +138 -0
  64. data/lib/iron_titan/api/jobs_api.rb +842 -0
  65. data/lib/iron_titan/api/runner_api.rb +229 -0
  66. data/lib/iron_titan/api_client.rb +372 -0
  67. data/lib/iron_titan/api_error.rb +47 -0
  68. data/lib/iron_titan/configuration.rb +186 -0
  69. data/lib/iron_titan/models/complete.rb +220 -0
  70. data/lib/iron_titan/models/error.rb +199 -0
  71. data/lib/iron_titan/models/error_body.rb +208 -0
  72. data/lib/iron_titan/models/group.rb +242 -0
  73. data/lib/iron_titan/models/group_wrapper.rb +200 -0
  74. data/lib/iron_titan/models/groups_wrapper.rb +202 -0
  75. data/lib/iron_titan/models/id_status.rb +243 -0
  76. data/lib/iron_titan/models/image.rb +184 -0
  77. data/lib/iron_titan/models/image_wrapper.rb +161 -0
  78. data/lib/iron_titan/models/images_wrapper.rb +163 -0
  79. data/lib/iron_titan/models/job.rb +427 -0
  80. data/lib/iron_titan/models/job_array.rb +160 -0
  81. data/lib/iron_titan/models/job_wrapper.rb +200 -0
  82. data/lib/iron_titan/models/jobs_wrapper.rb +221 -0
  83. data/lib/iron_titan/models/log.rb +161 -0
  84. data/lib/iron_titan/models/new_job.rb +270 -0
  85. data/lib/iron_titan/models/new_job_array.rb +160 -0
  86. data/lib/iron_titan/models/new_job_with_image.rb +249 -0
  87. data/lib/iron_titan/models/new_jobs_wrapper.rb +202 -0
  88. data/lib/iron_titan/models/reason.rb +164 -0
  89. data/lib/iron_titan/models/start.rb +200 -0
  90. data/lib/iron_titan/version.rb +26 -0
  91. data/lib/worker_ruby.rb +66 -0
  92. data/lib/worker_ruby/api/groups_api.rb +262 -0
  93. data/lib/worker_ruby/api/runner_api.rb +229 -0
  94. data/lib/worker_ruby/api/tasks_api.rb +842 -0
  95. data/lib/worker_ruby/api_client.rb +378 -0
  96. data/lib/worker_ruby/api_error.rb +47 -0
  97. data/lib/worker_ruby/configuration.rb +207 -0
  98. data/lib/worker_ruby/models/complete.rb +220 -0
  99. data/lib/worker_ruby/models/error.rb +199 -0
  100. data/lib/worker_ruby/models/error_body.rb +208 -0
  101. data/lib/worker_ruby/models/group.rb +242 -0
  102. data/lib/worker_ruby/models/group_wrapper.rb +200 -0
  103. data/lib/worker_ruby/models/groups_wrapper.rb +202 -0
  104. data/lib/worker_ruby/models/id_status.rb +243 -0
  105. data/lib/worker_ruby/models/new_task.rb +270 -0
  106. data/lib/worker_ruby/models/new_tasks_wrapper.rb +202 -0
  107. data/lib/worker_ruby/models/start.rb +200 -0
  108. data/lib/worker_ruby/models/task.rb +427 -0
  109. data/lib/worker_ruby/models/task_wrapper.rb +200 -0
  110. data/lib/worker_ruby/models/tasks_wrapper.rb +221 -0
  111. data/lib/worker_ruby/version.rb +26 -0
  112. data/spec/api/CoreApi_spec.rb +99 -0
  113. data/spec/api/JobsApi_spec.rb +131 -0
  114. data/spec/api/core_api_spec.rb +99 -0
  115. data/spec/api/groups_api_spec.rb +94 -0
  116. data/spec/api/images_api_spec.rb +66 -0
  117. data/spec/api/jobs_api_spec.rb +220 -0
  118. data/spec/api/runner_api_spec.rb +88 -0
  119. data/spec/api/tasks_api_spec.rb +220 -0
  120. data/spec/api_client_spec.rb +237 -0
  121. data/spec/configuration_spec.rb +53 -0
  122. data/spec/models/ErrorBody_spec.rb +56 -0
  123. data/spec/models/JobArray_spec.rb +46 -0
  124. data/spec/models/JobWrapper_spec.rb +46 -0
  125. data/spec/models/NewJobArray_spec.rb +46 -0
  126. data/spec/models/NewJob_spec.rb +96 -0
  127. data/spec/models/complete_spec.rb +65 -0
  128. data/spec/models/error_body_spec.rb +59 -0
  129. data/spec/models/error_spec.rb +53 -0
  130. data/spec/models/group_spec.rb +77 -0
  131. data/spec/models/group_wrapper_spec.rb +53 -0
  132. data/spec/models/groups_wrapper_spec.rb +53 -0
  133. data/spec/models/id_status_spec.rb +63 -0
  134. data/spec/models/image_spec.rb +66 -0
  135. data/spec/models/image_wrapper_spec.rb +46 -0
  136. data/spec/models/images_wrapper_spec.rb +46 -0
  137. data/spec/models/job_array_spec.rb +46 -0
  138. data/spec/models/job_spec.rb +161 -0
  139. data/spec/models/job_wrapper_spec.rb +53 -0
  140. data/spec/models/jobs_wrapper_spec.rb +65 -0
  141. data/spec/models/log_spec.rb +46 -0
  142. data/spec/models/new_job_array_spec.rb +46 -0
  143. data/spec/models/new_job_spec.rb +89 -0
  144. data/spec/models/new_job_with_image_spec.rb +116 -0
  145. data/spec/models/new_jobs_wrapper_spec.rb +53 -0
  146. data/spec/models/new_task_spec.rb +89 -0
  147. data/spec/models/new_tasks_wrapper_spec.rb +53 -0
  148. data/spec/models/reason_spec.rb +36 -0
  149. data/spec/models/start_spec.rb +53 -0
  150. data/spec/models/task_spec.rb +163 -0
  151. data/spec/models/task_wrapper_spec.rb +53 -0
  152. data/spec/models/tasks_wrapper_spec.rb +65 -0
  153. data/spec/spec_helper.rb +122 -0
  154. data/worker_ruby-0.5.5.gem +0 -0
  155. data/worker_ruby.gemspec +55 -0
  156. metadata +420 -0
@@ -0,0 +1,10 @@
1
+ # IronTitan::JobsWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **jobs** | [**Array<Job>**](Job.md) | |
7
+ **cursor** | **String** | Used to paginate results. If this is returned, pass it into the same query again to get more results. | [optional]
8
+ **error** | [**ErrorBody**](ErrorBody.md) | | [optional]
9
+
10
+
data/docs/Log.md ADDED
@@ -0,0 +1,8 @@
1
+ # IronTitan::Log
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **log** | **String** | |
7
+
8
+
data/docs/NewJob.md ADDED
@@ -0,0 +1,14 @@
1
+ # IronTitan::NewJob
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
+
14
+
@@ -0,0 +1,15 @@
1
+ # IronTitan::NewJobWithImage
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **payload** | **String** | Payload for the job. This is what you pass into each job to make it do something. | [optional]
7
+ **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]
8
+ **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]
9
+ **priority** | **Integer** | Priority of the job. Higher has more priority. 3 levels from 0-2. Jobs at same priority are processed in FIFO order. | [optional] [default to 0]
10
+ **max_retries** | **Integer** | Number of automatic retries this job is allowed. A retry will be attempted if a task fails. Max 25.\nAutomatic 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 3]
11
+ **retries_delay** | **Integer** | Time in seconds to wait before retrying the job. Must be a non-negative integer. | [optional] [default to 60]
12
+ **image** | **String** | Docker image to use for job. |
13
+ **created_at** | **DateTime** | Time when image first used/created. | [optional]
14
+
15
+
@@ -0,0 +1,8 @@
1
+ # IronTitan::NewJobsWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **jobs** | [**Array<NewJob>**](NewJob.md) | |
7
+
8
+
data/docs/NewTask.md ADDED
@@ -0,0 +1,14 @@
1
+ # IronWorker::NewTask
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 task. This is what you pass into each task to make it do something. | [optional]
8
+ **delay** | **Integer** | Number of seconds to wait before queueing the task for consumption for the first time. Must be a positive integer. Tasks 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 task, but does not change it's status within timeout seconds, the task is considered failed, with reason timeout (Titan may allow a small grace period). The consumer should also kill the task after timeout seconds. If a consumer tries to change status after Titan has already timed out the task, the consumer will be ignored. | [optional] [default to 60]
10
+ **priority** | **Integer** | Priority of the task. Higher has more priority. 3 levels from 0-2. Tasks at same priority are processed in FIFO order. |
11
+ **max_retries** | **Integer** | \"Number of automatic retries this task 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 task with the same image id and payload. The new task's max_retries is one less than the original. The new task's `retry_of` field is set to the original Task ID. The old task's `retry_at` field is set to the new Task's ID. Titan will delay the new task 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 task. Must be a non-negative integer. | [optional] [default to 60]
13
+
14
+
@@ -0,0 +1,8 @@
1
+ # IronWorker::NewTasksWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **tasks** | [**Array<NewTask>**](NewTask.md) | |
7
+
8
+
data/docs/Reason.md ADDED
@@ -0,0 +1,7 @@
1
+ # IronTitan::Reason
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+
7
+
data/docs/RunnerApi.md ADDED
@@ -0,0 +1,170 @@
1
+ # IronWorker::RunnerApi
2
+
3
+ All URIs are relative to *https://localhost:8080/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**groups_name_tasks_id_error_post**](RunnerApi.md#groups_name_tasks_id_error_post) | **POST** /groups/{name}/tasks/{id}/error | Mark task as failed.
8
+ [**groups_name_tasks_id_start_post**](RunnerApi.md#groups_name_tasks_id_start_post) | **POST** /groups/{name}/tasks/{id}/start | Mark task as started, ie: status = 'running'
9
+ [**groups_name_tasks_id_success_post**](RunnerApi.md#groups_name_tasks_id_success_post) | **POST** /groups/{name}/tasks/{id}/success | Mark task as succeeded.
10
+
11
+
12
+ # **groups_name_tasks_id_error_post**
13
+ > TaskWrapper groups_name_tasks_id_error_post(name, id, body)
14
+
15
+ Mark task as failed.
16
+
17
+ Task is marked as failed if it was in a valid state. Task's `finished_at` time is initialized.
18
+
19
+ ### Example
20
+ ```ruby
21
+ # load the gem
22
+ require 'worker_ruby'
23
+
24
+ api_instance = IronWorker::RunnerApi.new
25
+
26
+ name = "name_example" # String | Name of group for this set of tasks.
27
+
28
+ id = "id_example" # String | Task id
29
+
30
+ body = IronWorker::Complete.new # Complete |
31
+
32
+
33
+ begin
34
+ #Mark task as failed.
35
+ result = api_instance.groups_name_tasks_id_error_post(name, id, body)
36
+ p result
37
+ rescue IronWorker::ApiError => e
38
+ puts "Exception when calling RunnerApi->groups_name_tasks_id_error_post: #{e}"
39
+ end
40
+ ```
41
+
42
+ ### Parameters
43
+
44
+ Name | Type | Description | Notes
45
+ ------------- | ------------- | ------------- | -------------
46
+ **name** | **String**| Name of group for this set of tasks. |
47
+ **id** | **String**| Task id |
48
+ **body** | [**Complete**](Complete.md)| |
49
+
50
+ ### Return type
51
+
52
+ [**TaskWrapper**](TaskWrapper.md)
53
+
54
+ ### Authorization
55
+
56
+ No authorization required
57
+
58
+ ### HTTP request headers
59
+
60
+ - **Content-Type**: application/json
61
+ - **Accept**: application/json
62
+
63
+
64
+
65
+ # **groups_name_tasks_id_start_post**
66
+ > TaskWrapper groups_name_tasks_id_start_post(name, id, body)
67
+
68
+ Mark task as started, ie: status = 'running'
69
+
70
+ Task status is changed to 'running' if it was in a valid state before. Task's `started_at` time is initialized.
71
+
72
+ ### Example
73
+ ```ruby
74
+ # load the gem
75
+ require 'worker_ruby'
76
+
77
+ api_instance = IronWorker::RunnerApi.new
78
+
79
+ name = "name_example" # String | Name of group for this set of tasks.
80
+
81
+ id = "id_example" # String | Task id
82
+
83
+ body = IronWorker::Start.new # Start |
84
+
85
+
86
+ begin
87
+ #Mark task as started, ie: status = 'running'
88
+ result = api_instance.groups_name_tasks_id_start_post(name, id, body)
89
+ p result
90
+ rescue IronWorker::ApiError => e
91
+ puts "Exception when calling RunnerApi->groups_name_tasks_id_start_post: #{e}"
92
+ end
93
+ ```
94
+
95
+ ### Parameters
96
+
97
+ Name | Type | Description | Notes
98
+ ------------- | ------------- | ------------- | -------------
99
+ **name** | **String**| Name of group for this set of tasks. |
100
+ **id** | **String**| Task id |
101
+ **body** | [**Start**](Start.md)| |
102
+
103
+ ### Return type
104
+
105
+ [**TaskWrapper**](TaskWrapper.md)
106
+
107
+ ### Authorization
108
+
109
+ No authorization required
110
+
111
+ ### HTTP request headers
112
+
113
+ - **Content-Type**: application/json
114
+ - **Accept**: application/json
115
+
116
+
117
+
118
+ # **groups_name_tasks_id_success_post**
119
+ > TaskWrapper groups_name_tasks_id_success_post(name, id, body)
120
+
121
+ Mark task as succeeded.
122
+
123
+ Task status is changed to succeeded if it was in a valid state before. Task's `completed_at` time is initialized.
124
+
125
+ ### Example
126
+ ```ruby
127
+ # load the gem
128
+ require 'worker_ruby'
129
+
130
+ api_instance = IronWorker::RunnerApi.new
131
+
132
+ name = "name_example" # String | Name of group for this set of tasks.
133
+
134
+ id = "id_example" # String | Task id
135
+
136
+ body = IronWorker::Complete.new # Complete |
137
+
138
+
139
+ begin
140
+ #Mark task as succeeded.
141
+ result = api_instance.groups_name_tasks_id_success_post(name, id, body)
142
+ p result
143
+ rescue IronWorker::ApiError => e
144
+ puts "Exception when calling RunnerApi->groups_name_tasks_id_success_post: #{e}"
145
+ end
146
+ ```
147
+
148
+ ### Parameters
149
+
150
+ Name | Type | Description | Notes
151
+ ------------- | ------------- | ------------- | -------------
152
+ **name** | **String**| Name of group for this set of tasks. |
153
+ **id** | **String**| Task id |
154
+ **body** | [**Complete**](Complete.md)| |
155
+
156
+ ### Return type
157
+
158
+ [**TaskWrapper**](TaskWrapper.md)
159
+
160
+ ### Authorization
161
+
162
+ No authorization required
163
+
164
+ ### HTTP request headers
165
+
166
+ - **Content-Type**: application/json
167
+ - **Accept**: application/json
168
+
169
+
170
+
data/docs/Start.md ADDED
@@ -0,0 +1,8 @@
1
+ # IronWorker::Start
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **started_at** | **DateTime** | Time when task started execution. Always in UTC. | [optional]
7
+
8
+
data/docs/Task.md ADDED
@@ -0,0 +1,25 @@
1
+ # IronWorker::Task
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 task. This is what you pass into each task to make it do something. | [optional]
8
+ **delay** | **Integer** | Number of seconds to wait before queueing the task for consumption for the first time. Must be a positive integer. Tasks 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 task, but does not change it's status within timeout seconds, the task is considered failed, with reason timeout (Titan may allow a small grace period). The consumer should also kill the task after timeout seconds. If a consumer tries to change status after Titan has already timed out the task, the consumer will be ignored. | [optional] [default to 60]
10
+ **priority** | **Integer** | Priority of the task. Higher has more priority. 3 levels from 0-2. Tasks at same priority are processed in FIFO order. |
11
+ **max_retries** | **Integer** | \"Number of automatic retries this task 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 task with the same image id and payload. The new task's max_retries is one less than the original. The new task's `retry_of` field is set to the original Task ID. The old task's `retry_at` field is set to the new Task's ID. Titan will delay the new task 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 task. Must be a non-negative integer. | [optional] [default to 60]
13
+ **id** | **String** | Unique identifier representing a specific task. | [optional]
14
+ **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]
15
+ **group_name** | **String** | Group this task belongs to. | [optional]
16
+ **error** | **String** | The error message, if status is 'error'. This is errors due to things outside the task itself. Errors from user code will be found in the log. | [optional]
17
+ **reason** | **String** | Machine usable reason for task 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 task was submitted. Always in UTC. | [optional]
19
+ **started_at** | **DateTime** | Time when task started execution. Always in UTC. | [optional]
20
+ **completed_at** | **DateTime** | Time when task completed, whether it was successul or failed. Always in UTC. | [optional]
21
+ **retry_of** | **String** | If this field is set, then this task is a retry of the ID in this field. | [optional]
22
+ **retry_at** | **String** | If this field is set, then this task was retried by the task 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
+
@@ -0,0 +1,8 @@
1
+ # IronWorker::TaskWrapper
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **task** | [**Task**](Task.md) | |
7
+
8
+
data/docs/TasksApi.md ADDED
@@ -0,0 +1,684 @@
1
+ # IronWorker::TasksApi
2
+
3
+ All URIs are relative to *https://localhost:8080/v1*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**groups_name_tasks_get**](TasksApi.md#groups_name_tasks_get) | **GET** /groups/{name}/tasks | Get task list by group name.
8
+ [**groups_name_tasks_id_cancel_post**](TasksApi.md#groups_name_tasks_id_cancel_post) | **POST** /groups/{name}/tasks/{id}/cancel | Cancel a task.
9
+ [**groups_name_tasks_id_delete**](TasksApi.md#groups_name_tasks_id_delete) | **DELETE** /groups/{name}/tasks/{id} | Delete the task.
10
+ [**groups_name_tasks_id_error_post**](TasksApi.md#groups_name_tasks_id_error_post) | **POST** /groups/{name}/tasks/{id}/error | Mark task as failed.
11
+ [**groups_name_tasks_id_get**](TasksApi.md#groups_name_tasks_id_get) | **GET** /groups/{name}/tasks/{id} | Gets task by id
12
+ [**groups_name_tasks_id_log_get**](TasksApi.md#groups_name_tasks_id_log_get) | **GET** /groups/{name}/tasks/{id}/log | Get the log of a completed task.
13
+ [**groups_name_tasks_id_log_post**](TasksApi.md#groups_name_tasks_id_log_post) | **POST** /groups/{name}/tasks/{id}/log | Send in a log for storage.
14
+ [**groups_name_tasks_id_retry_post**](TasksApi.md#groups_name_tasks_id_retry_post) | **POST** /groups/{name}/tasks/{id}/retry | Retry a task.
15
+ [**groups_name_tasks_id_start_post**](TasksApi.md#groups_name_tasks_id_start_post) | **POST** /groups/{name}/tasks/{id}/start | Mark task as started, ie: status = 'running'
16
+ [**groups_name_tasks_id_success_post**](TasksApi.md#groups_name_tasks_id_success_post) | **POST** /groups/{name}/tasks/{id}/success | Mark task as succeeded.
17
+ [**groups_name_tasks_id_touch_post**](TasksApi.md#groups_name_tasks_id_touch_post) | **POST** /groups/{name}/tasks/{id}/touch | Extend task timeout.
18
+ [**groups_name_tasks_post**](TasksApi.md#groups_name_tasks_post) | **POST** /groups/{name}/tasks | Enqueue task
19
+ [**tasks_get**](TasksApi.md#tasks_get) | **GET** /tasks | Get next task.
20
+
21
+
22
+ # **groups_name_tasks_get**
23
+ > TasksWrapper groups_name_tasks_get(name, opts)
24
+
25
+ Get task list by group name.
26
+
27
+ This will list tasks for a particular group.
28
+
29
+ ### Example
30
+ ```ruby
31
+ # load the gem
32
+ require 'worker_ruby'
33
+
34
+ api_instance = IronWorker::TasksApi.new
35
+
36
+ name = "name_example" # String | Name of group for this set of tasks.
37
+
38
+ opts = {
39
+ created_after: DateTime.parse("2013-10-20T19:20:30+01:00"), # DateTime | Will return tasks created after this time. In RFC3339 format.
40
+ n: 56, # Integer | Number of tasks 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 task list by group name.
46
+ result = api_instance.groups_name_tasks_get(name, opts)
47
+ p result
48
+ rescue IronWorker::ApiError => e
49
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
58
+ **created_after** | **DateTime**| Will return tasks created after this time. In RFC3339 format. | [optional]
59
+ **n** | **Integer**| Number of tasks 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
+ [**TasksWrapper**](TasksWrapper.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_tasks_id_cancel_post**
78
+ > TaskWrapper groups_name_tasks_id_cancel_post(name, id)
79
+
80
+ Cancel a task.
81
+
82
+ Cancels a task in delayed, queued or running status. The worker may continue to run a running task. reason is set to `client_request`. The task's completed_at field is set to the current time on the taskserver.
83
+
84
+ ### Example
85
+ ```ruby
86
+ # load the gem
87
+ require 'worker_ruby'
88
+
89
+ api_instance = IronWorker::TasksApi.new
90
+
91
+ name = "name_example" # String | Name of group for this set of tasks.
92
+
93
+ id = "id_example" # String | Task id
94
+
95
+
96
+ begin
97
+ #Cancel a task.
98
+ result = api_instance.groups_name_tasks_id_cancel_post(name, id)
99
+ p result
100
+ rescue IronWorker::ApiError => e
101
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
110
+ **id** | **String**| Task id |
111
+
112
+ ### Return type
113
+
114
+ [**TaskWrapper**](TaskWrapper.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_tasks_id_delete**
128
+ > groups_name_tasks_id_delete(name, id)
129
+
130
+ Delete the task.
131
+
132
+ Delete only succeeds if task status is one of `succeeded | failed | cancelled`. Cancel a task if it is another state and needs to be deleted. All information about the task, including the log, is irretrievably lost when this is invoked.
133
+
134
+ ### Example
135
+ ```ruby
136
+ # load the gem
137
+ require 'worker_ruby'
138
+
139
+ api_instance = IronWorker::TasksApi.new
140
+
141
+ name = "name_example" # String | Name of group for this set of tasks.
142
+
143
+ id = "id_example" # String | Task id
144
+
145
+
146
+ begin
147
+ #Delete the task.
148
+ api_instance.groups_name_tasks_id_delete(name, id)
149
+ rescue IronWorker::ApiError => e
150
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
159
+ **id** | **String**| Task 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_tasks_id_error_post**
177
+ > TaskWrapper groups_name_tasks_id_error_post(name, id, body)
178
+
179
+ Mark task as failed.
180
+
181
+ Task is marked as failed if it was in a valid state. Task's `finished_at` time is initialized.
182
+
183
+ ### Example
184
+ ```ruby
185
+ # load the gem
186
+ require 'worker_ruby'
187
+
188
+ api_instance = IronWorker::TasksApi.new
189
+
190
+ name = "name_example" # String | Name of group for this set of tasks.
191
+
192
+ id = "id_example" # String | Task id
193
+
194
+ body = IronWorker::Complete.new # Complete |
195
+
196
+
197
+ begin
198
+ #Mark task as failed.
199
+ result = api_instance.groups_name_tasks_id_error_post(name, id, body)
200
+ p result
201
+ rescue IronWorker::ApiError => e
202
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
211
+ **id** | **String**| Task id |
212
+ **body** | [**Complete**](Complete.md)| |
213
+
214
+ ### Return type
215
+
216
+ [**TaskWrapper**](TaskWrapper.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_tasks_id_get**
230
+ > TaskWrapper groups_name_tasks_id_get(name, id)
231
+
232
+ Gets task by id
233
+
234
+ Gets a task by id.
235
+
236
+ ### Example
237
+ ```ruby
238
+ # load the gem
239
+ require 'worker_ruby'
240
+
241
+ api_instance = IronWorker::TasksApi.new
242
+
243
+ name = "name_example" # String | Name of group for this set of tasks.
244
+
245
+ id = "id_example" # String | task id
246
+
247
+
248
+ begin
249
+ #Gets task by id
250
+ result = api_instance.groups_name_tasks_id_get(name, id)
251
+ p result
252
+ rescue IronWorker::ApiError => e
253
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
262
+ **id** | **String**| task id |
263
+
264
+ ### Return type
265
+
266
+ [**TaskWrapper**](TaskWrapper.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_tasks_id_log_get**
280
+ > String groups_name_tasks_id_log_get(name, id)
281
+
282
+ Get the log of a completed task.
283
+
284
+ Retrieves the log from log storage.
285
+
286
+ ### Example
287
+ ```ruby
288
+ # load the gem
289
+ require 'worker_ruby'
290
+
291
+ api_instance = IronWorker::TasksApi.new
292
+
293
+ name = "name_example" # String | Name of group for this set of tasks.
294
+
295
+ id = "id_example" # String | Task id
296
+
297
+
298
+ begin
299
+ #Get the log of a completed task.
300
+ result = api_instance.groups_name_tasks_id_log_get(name, id)
301
+ p result
302
+ rescue IronWorker::ApiError => e
303
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
312
+ **id** | **String**| Task 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_tasks_id_log_post**
330
+ > TaskWrapper groups_name_tasks_id_log_post(name, id, log)
331
+
332
+ Send in a log for storage.
333
+
334
+ Logs are sent after a task completes since they may be very large and the runner can process the next task.
335
+
336
+ ### Example
337
+ ```ruby
338
+ # load the gem
339
+ require 'worker_ruby'
340
+
341
+ api_instance = IronWorker::TasksApi.new
342
+
343
+ name = "name_example" # String | Name of group for this set of tasks.
344
+
345
+ id = "id_example" # String | Task id
346
+
347
+ log = File.new("/path/to/file.txt") # File | Output log for the task. 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_tasks_id_log_post(name, id, log)
353
+ p result
354
+ rescue IronWorker::ApiError => e
355
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
364
+ **id** | **String**| Task id |
365
+ **log** | **File**| Output log for the task. Content-Type must be \"text/plain; charset=utf-8\". |
366
+
367
+ ### Return type
368
+
369
+ [**TaskWrapper**](TaskWrapper.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_tasks_id_retry_post**
383
+ > TaskWrapper groups_name_tasks_id_retry_post(name, id)
384
+
385
+ Retry a task.
386
+
387
+ \"The /retry endpoint can be used to force a retry of tasks with status succeeded, cancelled or failed. The retried task has the same attributes. max_retries is not modified.\"
388
+
389
+ ### Example
390
+ ```ruby
391
+ # load the gem
392
+ require 'worker_ruby'
393
+
394
+ api_instance = IronWorker::TasksApi.new
395
+
396
+ name = "name_example" # String | Name of group for this set of tasks.
397
+
398
+ id = "id_example" # String | Task id
399
+
400
+
401
+ begin
402
+ #Retry a task.
403
+ result = api_instance.groups_name_tasks_id_retry_post(name, id)
404
+ p result
405
+ rescue IronWorker::ApiError => e
406
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
415
+ **id** | **String**| Task id |
416
+
417
+ ### Return type
418
+
419
+ [**TaskWrapper**](TaskWrapper.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_tasks_id_start_post**
433
+ > TaskWrapper groups_name_tasks_id_start_post(name, id, body)
434
+
435
+ Mark task as started, ie: status = 'running'
436
+
437
+ Task status is changed to 'running' if it was in a valid state before. Task's `started_at` time is initialized.
438
+
439
+ ### Example
440
+ ```ruby
441
+ # load the gem
442
+ require 'worker_ruby'
443
+
444
+ api_instance = IronWorker::TasksApi.new
445
+
446
+ name = "name_example" # String | Name of group for this set of tasks.
447
+
448
+ id = "id_example" # String | Task id
449
+
450
+ body = IronWorker::Start.new # Start |
451
+
452
+
453
+ begin
454
+ #Mark task as started, ie: status = 'running'
455
+ result = api_instance.groups_name_tasks_id_start_post(name, id, body)
456
+ p result
457
+ rescue IronWorker::ApiError => e
458
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
467
+ **id** | **String**| Task id |
468
+ **body** | [**Start**](Start.md)| |
469
+
470
+ ### Return type
471
+
472
+ [**TaskWrapper**](TaskWrapper.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_tasks_id_success_post**
486
+ > TaskWrapper groups_name_tasks_id_success_post(name, id, body)
487
+
488
+ Mark task as succeeded.
489
+
490
+ Task status is changed to succeeded if it was in a valid state before. Task's `completed_at` time is initialized.
491
+
492
+ ### Example
493
+ ```ruby
494
+ # load the gem
495
+ require 'worker_ruby'
496
+
497
+ api_instance = IronWorker::TasksApi.new
498
+
499
+ name = "name_example" # String | Name of group for this set of tasks.
500
+
501
+ id = "id_example" # String | Task id
502
+
503
+ body = IronWorker::Complete.new # Complete |
504
+
505
+
506
+ begin
507
+ #Mark task as succeeded.
508
+ result = api_instance.groups_name_tasks_id_success_post(name, id, body)
509
+ p result
510
+ rescue IronWorker::ApiError => e
511
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
520
+ **id** | **String**| Task id |
521
+ **body** | [**Complete**](Complete.md)| |
522
+
523
+ ### Return type
524
+
525
+ [**TaskWrapper**](TaskWrapper.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_tasks_id_touch_post**
539
+ > groups_name_tasks_id_touch_post(name, id)
540
+
541
+ Extend task 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 task may never get to run, or run but not be accepted by Titan. Consumers can touch the task before it times out. Titan will reset the timeout, giving the consumer another timeout seconds to run the task. Touch is only valid while the task is in a running state. If touch fails, the runner may stop running the task.
544
+
545
+ ### Example
546
+ ```ruby
547
+ # load the gem
548
+ require 'worker_ruby'
549
+
550
+ api_instance = IronWorker::TasksApi.new
551
+
552
+ name = "name_example" # String | Name of group for this set of tasks.
553
+
554
+ id = "id_example" # String | Task id
555
+
556
+
557
+ begin
558
+ #Extend task timeout.
559
+ api_instance.groups_name_tasks_id_touch_post(name, id)
560
+ rescue IronWorker::ApiError => e
561
+ puts "Exception when calling TasksApi->groups_name_tasks_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 tasks. |
570
+ **id** | **String**| Task 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_tasks_post**
588
+ > TasksWrapper groups_name_tasks_post(name, body)
589
+
590
+ Enqueue task
591
+
592
+ Enqueues task(s). If any of the tasks is invalid, none of the tasks are enqueued.
593
+
594
+ ### Example
595
+ ```ruby
596
+ # load the gem
597
+ require 'worker_ruby'
598
+
599
+ api_instance = IronWorker::TasksApi.new
600
+
601
+ name = "name_example" # String | name of the group.
602
+
603
+ body = IronWorker::NewTasksWrapper.new # NewTasksWrapper | Array of tasks to post.
604
+
605
+
606
+ begin
607
+ #Enqueue task
608
+ result = api_instance.groups_name_tasks_post(name, body)
609
+ p result
610
+ rescue IronWorker::ApiError => e
611
+ puts "Exception when calling TasksApi->groups_name_tasks_post: #{e}"
612
+ end
613
+ ```
614
+
615
+ ### Parameters
616
+
617
+ Name | Type | Description | Notes
618
+ ------------- | ------------- | ------------- | -------------
619
+ **name** | **String**| name of the group. |
620
+ **body** | [**NewTasksWrapper**](NewTasksWrapper.md)| Array of tasks to post. |
621
+
622
+ ### Return type
623
+
624
+ [**TasksWrapper**](TasksWrapper.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
+ # **tasks_get**
638
+ > TasksWrapper tasks_get(opts)
639
+
640
+ Get next task.
641
+
642
+ Gets the next task in the queue, ready for processing. Titan may return <=n tasks. Consumers should start processing tasks in order. Each returned task is set to `status` \"running\" and `started_at` is set to the current time. No other consumer can retrieve this task.
643
+
644
+ ### Example
645
+ ```ruby
646
+ # load the gem
647
+ require 'worker_ruby'
648
+
649
+ api_instance = IronWorker::TasksApi.new
650
+
651
+ opts = {
652
+ n: 1 # Integer | Number of tasks to return.
653
+ }
654
+
655
+ begin
656
+ #Get next task.
657
+ result = api_instance.tasks_get(opts)
658
+ p result
659
+ rescue IronWorker::ApiError => e
660
+ puts "Exception when calling TasksApi->tasks_get: #{e}"
661
+ end
662
+ ```
663
+
664
+ ### Parameters
665
+
666
+ Name | Type | Description | Notes
667
+ ------------- | ------------- | ------------- | -------------
668
+ **n** | **Integer**| Number of tasks to return. | [optional] [default to 1]
669
+
670
+ ### Return type
671
+
672
+ [**TasksWrapper**](TasksWrapper.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
+