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,842 @@
1
+ =begin
2
+ #IronWorker CE API
3
+
4
+ #The ultimate, language agnostic, container based task processing framework.
5
+
6
+ OpenAPI spec version: 0.5.7
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ Licensed under the Apache License, Version 2.0 (the "License");
11
+ you may not use this file except in compliance with the License.
12
+ You may obtain a copy of the License at
13
+
14
+ http://www.apache.org/licenses/LICENSE-2.0
15
+
16
+ Unless required by applicable law or agreed to in writing, software
17
+ distributed under the License is distributed on an "AS IS" BASIS,
18
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ See the License for the specific language governing permissions and
20
+ limitations under the License.
21
+
22
+ =end
23
+
24
+ require "uri"
25
+
26
+ module IronWorker
27
+ class TasksApi
28
+ attr_accessor :api_client
29
+
30
+ def initialize(api_client = ApiClient.default)
31
+ @api_client = api_client
32
+ end
33
+
34
+ # Get task list by group name.
35
+ # This will list tasks for a particular group.
36
+ # @param name Name of group for this set of tasks.
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [DateTime] :created_after Will return tasks created after this time. In RFC3339 format.
39
+ # @option opts [Integer] :n Number of tasks to return per page. Default is 50. Max is 1000.
40
+ # @option opts [String] :cursor Pass this in from a previous query to paginate results.
41
+ # @return [TasksWrapper]
42
+ def groups_name_tasks_get(name, opts = {})
43
+ data, _status_code, _headers = groups_name_tasks_get_with_http_info(name, opts)
44
+ return data
45
+ end
46
+
47
+ # Get task list by group name.
48
+ # This will list tasks for a particular group.
49
+ # @param name Name of group for this set of tasks.
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [DateTime] :created_after Will return tasks created after this time. In RFC3339 format.
52
+ # @option opts [Integer] :n Number of tasks to return per page. Default is 50. Max is 1000.
53
+ # @option opts [String] :cursor Pass this in from a previous query to paginate results.
54
+ # @return [Array<(TasksWrapper, Fixnum, Hash)>] TasksWrapper data, response status code and response headers
55
+ def groups_name_tasks_get_with_http_info(name, opts = {})
56
+ if @api_client.config.debugging
57
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_get ..."
58
+ end
59
+ # verify the required parameter 'name' is set
60
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_get" if name.nil?
61
+ # resource path
62
+ local_var_path = "/groups/{name}/tasks".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
63
+
64
+ # query parameters
65
+ query_params = {}
66
+ query_params[:'created_after'] = opts[:'created_after'] if !opts[:'created_after'].nil?
67
+ query_params[:'n'] = opts[:'n'] if !opts[:'n'].nil?
68
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
69
+
70
+ # header parameters
71
+ header_params = {}
72
+
73
+ # HTTP header 'Accept' (if needed)
74
+ local_header_accept = ['application/json']
75
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
76
+
77
+ # HTTP header 'Content-Type'
78
+ local_header_content_type = ['application/json']
79
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
80
+
81
+ # form parameters
82
+ form_params = {}
83
+
84
+ # http body (model)
85
+ post_body = nil
86
+ auth_names = []
87
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
88
+ :header_params => header_params,
89
+ :query_params => query_params,
90
+ :form_params => form_params,
91
+ :body => post_body,
92
+ :auth_names => auth_names,
93
+ :return_type => 'TasksWrapper')
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
100
+ # Cancel a task.
101
+ # 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.
102
+ # @param name Name of group for this set of tasks.
103
+ # @param id Task id
104
+ # @param [Hash] opts the optional parameters
105
+ # @return [TaskWrapper]
106
+ def groups_name_tasks_id_cancel_post(name, id, opts = {})
107
+ data, _status_code, _headers = groups_name_tasks_id_cancel_post_with_http_info(name, id, opts)
108
+ return data
109
+ end
110
+
111
+ # Cancel a task.
112
+ # Cancels a task in delayed, queued or running status. The worker may continue to run a running task. reason is set to &#x60;client_request&#x60;. The task&#39;s completed_at field is set to the current time on the taskserver.
113
+ # @param name Name of group for this set of tasks.
114
+ # @param id Task id
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers
117
+ def groups_name_tasks_id_cancel_post_with_http_info(name, id, opts = {})
118
+ if @api_client.config.debugging
119
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_cancel_post ..."
120
+ end
121
+ # verify the required parameter 'name' is set
122
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_cancel_post" if name.nil?
123
+ # verify the required parameter 'id' is set
124
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_cancel_post" if id.nil?
125
+ # resource path
126
+ local_var_path = "/groups/{name}/tasks/{id}/cancel".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
127
+
128
+ # query parameters
129
+ query_params = {}
130
+
131
+ # header parameters
132
+ header_params = {}
133
+
134
+ # HTTP header 'Accept' (if needed)
135
+ local_header_accept = ['application/json']
136
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
137
+
138
+ # HTTP header 'Content-Type'
139
+ local_header_content_type = ['application/json']
140
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
141
+
142
+ # form parameters
143
+ form_params = {}
144
+
145
+ # http body (model)
146
+ post_body = nil
147
+ auth_names = []
148
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
149
+ :header_params => header_params,
150
+ :query_params => query_params,
151
+ :form_params => form_params,
152
+ :body => post_body,
153
+ :auth_names => auth_names,
154
+ :return_type => 'TaskWrapper')
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_cancel_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+
161
+ # Delete the task.
162
+ # 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.
163
+ # @param name Name of group for this set of tasks.
164
+ # @param id Task id
165
+ # @param [Hash] opts the optional parameters
166
+ # @return [nil]
167
+ def groups_name_tasks_id_delete(name, id, opts = {})
168
+ groups_name_tasks_id_delete_with_http_info(name, id, opts)
169
+ return nil
170
+ end
171
+
172
+ # Delete the task.
173
+ # Delete only succeeds if task status is one of &#x60;succeeded | failed | cancelled&#x60;. 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.
174
+ # @param name Name of group for this set of tasks.
175
+ # @param id Task id
176
+ # @param [Hash] opts the optional parameters
177
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
178
+ def groups_name_tasks_id_delete_with_http_info(name, id, opts = {})
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_delete ..."
181
+ end
182
+ # verify the required parameter 'name' is set
183
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_delete" if name.nil?
184
+ # verify the required parameter 'id' is set
185
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_delete" if id.nil?
186
+ # resource path
187
+ local_var_path = "/groups/{name}/tasks/{id}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
188
+
189
+ # query parameters
190
+ query_params = {}
191
+
192
+ # header parameters
193
+ header_params = {}
194
+
195
+ # HTTP header 'Accept' (if needed)
196
+ local_header_accept = ['application/json']
197
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
198
+
199
+ # HTTP header 'Content-Type'
200
+ local_header_content_type = ['application/json']
201
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
202
+
203
+ # form parameters
204
+ form_params = {}
205
+
206
+ # http body (model)
207
+ post_body = nil
208
+ auth_names = []
209
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
210
+ :header_params => header_params,
211
+ :query_params => query_params,
212
+ :form_params => form_params,
213
+ :body => post_body,
214
+ :auth_names => auth_names)
215
+ if @api_client.config.debugging
216
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
217
+ end
218
+ return data, status_code, headers
219
+ end
220
+
221
+ # Mark task as failed.
222
+ # Task is marked as failed if it was in a valid state. Task's `finished_at` time is initialized.
223
+ # @param name Name of group for this set of tasks.
224
+ # @param id Task id
225
+ # @param body
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [TaskWrapper]
228
+ def groups_name_tasks_id_error_post(name, id, body, opts = {})
229
+ data, _status_code, _headers = groups_name_tasks_id_error_post_with_http_info(name, id, body, opts)
230
+ return data
231
+ end
232
+
233
+ # Mark task as failed.
234
+ # Task is marked as failed if it was in a valid state. Task&#39;s &#x60;finished_at&#x60; time is initialized.
235
+ # @param name Name of group for this set of tasks.
236
+ # @param id Task id
237
+ # @param body
238
+ # @param [Hash] opts the optional parameters
239
+ # @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers
240
+ def groups_name_tasks_id_error_post_with_http_info(name, id, body, opts = {})
241
+ if @api_client.config.debugging
242
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_error_post ..."
243
+ end
244
+ # verify the required parameter 'name' is set
245
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_error_post" if name.nil?
246
+ # verify the required parameter 'id' is set
247
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_error_post" if id.nil?
248
+ # verify the required parameter 'body' is set
249
+ fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_id_error_post" if body.nil?
250
+ # resource path
251
+ local_var_path = "/groups/{name}/tasks/{id}/error".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
252
+
253
+ # query parameters
254
+ query_params = {}
255
+
256
+ # header parameters
257
+ header_params = {}
258
+
259
+ # HTTP header 'Accept' (if needed)
260
+ local_header_accept = ['application/json']
261
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
262
+
263
+ # HTTP header 'Content-Type'
264
+ local_header_content_type = ['application/json']
265
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
266
+
267
+ # form parameters
268
+ form_params = {}
269
+
270
+ # http body (model)
271
+ post_body = @api_client.object_to_http_body(body)
272
+ auth_names = []
273
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => 'TaskWrapper')
280
+ if @api_client.config.debugging
281
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_error_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
282
+ end
283
+ return data, status_code, headers
284
+ end
285
+
286
+ # Gets task by id
287
+ # Gets a task by id.
288
+ # @param name Name of group for this set of tasks.
289
+ # @param id task id
290
+ # @param [Hash] opts the optional parameters
291
+ # @return [TaskWrapper]
292
+ def groups_name_tasks_id_get(name, id, opts = {})
293
+ data, _status_code, _headers = groups_name_tasks_id_get_with_http_info(name, id, opts)
294
+ return data
295
+ end
296
+
297
+ # Gets task by id
298
+ # Gets a task by id.
299
+ # @param name Name of group for this set of tasks.
300
+ # @param id task id
301
+ # @param [Hash] opts the optional parameters
302
+ # @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers
303
+ def groups_name_tasks_id_get_with_http_info(name, id, opts = {})
304
+ if @api_client.config.debugging
305
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_get ..."
306
+ end
307
+ # verify the required parameter 'name' is set
308
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_get" if name.nil?
309
+ # verify the required parameter 'id' is set
310
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_get" if id.nil?
311
+ # resource path
312
+ local_var_path = "/groups/{name}/tasks/{id}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
313
+
314
+ # query parameters
315
+ query_params = {}
316
+
317
+ # header parameters
318
+ header_params = {}
319
+
320
+ # HTTP header 'Accept' (if needed)
321
+ local_header_accept = ['application/json']
322
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
323
+
324
+ # HTTP header 'Content-Type'
325
+ local_header_content_type = ['application/json']
326
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
327
+
328
+ # form parameters
329
+ form_params = {}
330
+
331
+ # http body (model)
332
+ post_body = nil
333
+ auth_names = []
334
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
335
+ :header_params => header_params,
336
+ :query_params => query_params,
337
+ :form_params => form_params,
338
+ :body => post_body,
339
+ :auth_names => auth_names,
340
+ :return_type => 'TaskWrapper')
341
+ if @api_client.config.debugging
342
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
343
+ end
344
+ return data, status_code, headers
345
+ end
346
+
347
+ # Get the log of a completed task.
348
+ # Retrieves the log from log storage.
349
+ # @param name Name of group for this set of tasks.
350
+ # @param id Task id
351
+ # @param [Hash] opts the optional parameters
352
+ # @return [String]
353
+ def groups_name_tasks_id_log_get(name, id, opts = {})
354
+ data, _status_code, _headers = groups_name_tasks_id_log_get_with_http_info(name, id, opts)
355
+ return data
356
+ end
357
+
358
+ # Get the log of a completed task.
359
+ # Retrieves the log from log storage.
360
+ # @param name Name of group for this set of tasks.
361
+ # @param id Task id
362
+ # @param [Hash] opts the optional parameters
363
+ # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
364
+ def groups_name_tasks_id_log_get_with_http_info(name, id, opts = {})
365
+ if @api_client.config.debugging
366
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_log_get ..."
367
+ end
368
+ # verify the required parameter 'name' is set
369
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_log_get" if name.nil?
370
+ # verify the required parameter 'id' is set
371
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_log_get" if id.nil?
372
+ # resource path
373
+ local_var_path = "/groups/{name}/tasks/{id}/log".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
374
+
375
+ # query parameters
376
+ query_params = {}
377
+
378
+ # header parameters
379
+ header_params = {}
380
+
381
+ # HTTP header 'Accept' (if needed)
382
+ local_header_accept = ['text/plain']
383
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
384
+
385
+ # HTTP header 'Content-Type'
386
+ local_header_content_type = ['application/json']
387
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
388
+
389
+ # form parameters
390
+ form_params = {}
391
+
392
+ # http body (model)
393
+ post_body = nil
394
+ auth_names = []
395
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
396
+ :header_params => header_params,
397
+ :query_params => query_params,
398
+ :form_params => form_params,
399
+ :body => post_body,
400
+ :auth_names => auth_names,
401
+ :return_type => 'String')
402
+ if @api_client.config.debugging
403
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_log_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
404
+ end
405
+ return data, status_code, headers
406
+ end
407
+
408
+ # Send in a log for storage.
409
+ # Logs are sent after a task completes since they may be very large and the runner can process the next task.
410
+ # @param name Name of group for this set of tasks.
411
+ # @param id Task id
412
+ # @param log Output log for the task. Content-Type must be \&quot;text/plain; charset&#x3D;utf-8\&quot;.
413
+ # @param [Hash] opts the optional parameters
414
+ # @return [TaskWrapper]
415
+ def groups_name_tasks_id_log_post(name, id, log, opts = {})
416
+ data, _status_code, _headers = groups_name_tasks_id_log_post_with_http_info(name, id, log, opts)
417
+ return data
418
+ end
419
+
420
+ # Send in a log for storage.
421
+ # Logs are sent after a task completes since they may be very large and the runner can process the next task.
422
+ # @param name Name of group for this set of tasks.
423
+ # @param id Task id
424
+ # @param log Output log for the task. Content-Type must be \&quot;text/plain; charset&#x3D;utf-8\&quot;.
425
+ # @param [Hash] opts the optional parameters
426
+ # @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers
427
+ def groups_name_tasks_id_log_post_with_http_info(name, id, log, opts = {})
428
+ if @api_client.config.debugging
429
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_log_post ..."
430
+ end
431
+ # verify the required parameter 'name' is set
432
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_log_post" if name.nil?
433
+ # verify the required parameter 'id' is set
434
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_log_post" if id.nil?
435
+ # verify the required parameter 'log' is set
436
+ fail ArgumentError, "Missing the required parameter 'log' when calling TasksApi.groups_name_tasks_id_log_post" if log.nil?
437
+ # resource path
438
+ local_var_path = "/groups/{name}/tasks/{id}/log".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
439
+
440
+ # query parameters
441
+ query_params = {}
442
+
443
+ # header parameters
444
+ header_params = {}
445
+
446
+ # HTTP header 'Accept' (if needed)
447
+ local_header_accept = ['application/json']
448
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
449
+
450
+ # HTTP header 'Content-Type'
451
+ local_header_content_type = ['multipart/form-data']
452
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
453
+
454
+ # form parameters
455
+ form_params = {}
456
+ form_params["log"] = log
457
+
458
+ # http body (model)
459
+ post_body = nil
460
+ auth_names = []
461
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
462
+ :header_params => header_params,
463
+ :query_params => query_params,
464
+ :form_params => form_params,
465
+ :body => post_body,
466
+ :auth_names => auth_names,
467
+ :return_type => 'TaskWrapper')
468
+ if @api_client.config.debugging
469
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_log_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
470
+ end
471
+ return data, status_code, headers
472
+ end
473
+
474
+ # Retry a task.
475
+ # \"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.\"
476
+ # @param name Name of group for this set of tasks.
477
+ # @param id Task id
478
+ # @param [Hash] opts the optional parameters
479
+ # @return [TaskWrapper]
480
+ def groups_name_tasks_id_retry_post(name, id, opts = {})
481
+ data, _status_code, _headers = groups_name_tasks_id_retry_post_with_http_info(name, id, opts)
482
+ return data
483
+ end
484
+
485
+ # Retry a task.
486
+ # \&quot;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.\&quot;
487
+ # @param name Name of group for this set of tasks.
488
+ # @param id Task id
489
+ # @param [Hash] opts the optional parameters
490
+ # @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers
491
+ def groups_name_tasks_id_retry_post_with_http_info(name, id, opts = {})
492
+ if @api_client.config.debugging
493
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_retry_post ..."
494
+ end
495
+ # verify the required parameter 'name' is set
496
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_retry_post" if name.nil?
497
+ # verify the required parameter 'id' is set
498
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_retry_post" if id.nil?
499
+ # resource path
500
+ local_var_path = "/groups/{name}/tasks/{id}/retry".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
501
+
502
+ # query parameters
503
+ query_params = {}
504
+
505
+ # header parameters
506
+ header_params = {}
507
+
508
+ # HTTP header 'Accept' (if needed)
509
+ local_header_accept = ['application/json']
510
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
511
+
512
+ # HTTP header 'Content-Type'
513
+ local_header_content_type = ['application/json']
514
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
515
+
516
+ # form parameters
517
+ form_params = {}
518
+
519
+ # http body (model)
520
+ post_body = nil
521
+ auth_names = []
522
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
523
+ :header_params => header_params,
524
+ :query_params => query_params,
525
+ :form_params => form_params,
526
+ :body => post_body,
527
+ :auth_names => auth_names,
528
+ :return_type => 'TaskWrapper')
529
+ if @api_client.config.debugging
530
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_retry_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
531
+ end
532
+ return data, status_code, headers
533
+ end
534
+
535
+ # Mark task as started, ie: status = 'running'
536
+ # Task status is changed to 'running' if it was in a valid state before. Task's `started_at` time is initialized.
537
+ # @param name Name of group for this set of tasks.
538
+ # @param id Task id
539
+ # @param body
540
+ # @param [Hash] opts the optional parameters
541
+ # @return [TaskWrapper]
542
+ def groups_name_tasks_id_start_post(name, id, body, opts = {})
543
+ data, _status_code, _headers = groups_name_tasks_id_start_post_with_http_info(name, id, body, opts)
544
+ return data
545
+ end
546
+
547
+ # Mark task as started, ie: status &#x3D; &#39;running&#39;
548
+ # Task status is changed to &#39;running&#39; if it was in a valid state before. Task&#39;s &#x60;started_at&#x60; time is initialized.
549
+ # @param name Name of group for this set of tasks.
550
+ # @param id Task id
551
+ # @param body
552
+ # @param [Hash] opts the optional parameters
553
+ # @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers
554
+ def groups_name_tasks_id_start_post_with_http_info(name, id, body, opts = {})
555
+ if @api_client.config.debugging
556
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_start_post ..."
557
+ end
558
+ # verify the required parameter 'name' is set
559
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_start_post" if name.nil?
560
+ # verify the required parameter 'id' is set
561
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_start_post" if id.nil?
562
+ # verify the required parameter 'body' is set
563
+ fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_id_start_post" if body.nil?
564
+ # resource path
565
+ local_var_path = "/groups/{name}/tasks/{id}/start".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
566
+
567
+ # query parameters
568
+ query_params = {}
569
+
570
+ # header parameters
571
+ header_params = {}
572
+
573
+ # HTTP header 'Accept' (if needed)
574
+ local_header_accept = ['application/json']
575
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
576
+
577
+ # HTTP header 'Content-Type'
578
+ local_header_content_type = ['application/json']
579
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
580
+
581
+ # form parameters
582
+ form_params = {}
583
+
584
+ # http body (model)
585
+ post_body = @api_client.object_to_http_body(body)
586
+ auth_names = []
587
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
588
+ :header_params => header_params,
589
+ :query_params => query_params,
590
+ :form_params => form_params,
591
+ :body => post_body,
592
+ :auth_names => auth_names,
593
+ :return_type => 'TaskWrapper')
594
+ if @api_client.config.debugging
595
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_start_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
596
+ end
597
+ return data, status_code, headers
598
+ end
599
+
600
+ # Mark task as succeeded.
601
+ # Task status is changed to succeeded if it was in a valid state before. Task's `completed_at` time is initialized.
602
+ # @param name Name of group for this set of tasks.
603
+ # @param id Task id
604
+ # @param body
605
+ # @param [Hash] opts the optional parameters
606
+ # @return [TaskWrapper]
607
+ def groups_name_tasks_id_success_post(name, id, body, opts = {})
608
+ data, _status_code, _headers = groups_name_tasks_id_success_post_with_http_info(name, id, body, opts)
609
+ return data
610
+ end
611
+
612
+ # Mark task as succeeded.
613
+ # Task status is changed to succeeded if it was in a valid state before. Task&#39;s &#x60;completed_at&#x60; time is initialized.
614
+ # @param name Name of group for this set of tasks.
615
+ # @param id Task id
616
+ # @param body
617
+ # @param [Hash] opts the optional parameters
618
+ # @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers
619
+ def groups_name_tasks_id_success_post_with_http_info(name, id, body, opts = {})
620
+ if @api_client.config.debugging
621
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_success_post ..."
622
+ end
623
+ # verify the required parameter 'name' is set
624
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_success_post" if name.nil?
625
+ # verify the required parameter 'id' is set
626
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_success_post" if id.nil?
627
+ # verify the required parameter 'body' is set
628
+ fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_id_success_post" if body.nil?
629
+ # resource path
630
+ local_var_path = "/groups/{name}/tasks/{id}/success".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
631
+
632
+ # query parameters
633
+ query_params = {}
634
+
635
+ # header parameters
636
+ header_params = {}
637
+
638
+ # HTTP header 'Accept' (if needed)
639
+ local_header_accept = ['application/json']
640
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
641
+
642
+ # HTTP header 'Content-Type'
643
+ local_header_content_type = ['application/json']
644
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
645
+
646
+ # form parameters
647
+ form_params = {}
648
+
649
+ # http body (model)
650
+ post_body = @api_client.object_to_http_body(body)
651
+ auth_names = []
652
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
653
+ :header_params => header_params,
654
+ :query_params => query_params,
655
+ :form_params => form_params,
656
+ :body => post_body,
657
+ :auth_names => auth_names,
658
+ :return_type => 'TaskWrapper')
659
+ if @api_client.config.debugging
660
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_success_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
661
+ end
662
+ return data, status_code, headers
663
+ end
664
+
665
+ # Extend task timeout.
666
+ # 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.
667
+ # @param name Name of group for this set of tasks.
668
+ # @param id Task id
669
+ # @param [Hash] opts the optional parameters
670
+ # @return [nil]
671
+ def groups_name_tasks_id_touch_post(name, id, opts = {})
672
+ groups_name_tasks_id_touch_post_with_http_info(name, id, opts)
673
+ return nil
674
+ end
675
+
676
+ # Extend task timeout.
677
+ # 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.
678
+ # @param name Name of group for this set of tasks.
679
+ # @param id Task id
680
+ # @param [Hash] opts the optional parameters
681
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
682
+ def groups_name_tasks_id_touch_post_with_http_info(name, id, opts = {})
683
+ if @api_client.config.debugging
684
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_touch_post ..."
685
+ end
686
+ # verify the required parameter 'name' is set
687
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_touch_post" if name.nil?
688
+ # verify the required parameter 'id' is set
689
+ fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_touch_post" if id.nil?
690
+ # resource path
691
+ local_var_path = "/groups/{name}/tasks/{id}/touch".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)
692
+
693
+ # query parameters
694
+ query_params = {}
695
+
696
+ # header parameters
697
+ header_params = {}
698
+
699
+ # HTTP header 'Accept' (if needed)
700
+ local_header_accept = ['application/json']
701
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
702
+
703
+ # HTTP header 'Content-Type'
704
+ local_header_content_type = ['application/json']
705
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
706
+
707
+ # form parameters
708
+ form_params = {}
709
+
710
+ # http body (model)
711
+ post_body = nil
712
+ auth_names = []
713
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
714
+ :header_params => header_params,
715
+ :query_params => query_params,
716
+ :form_params => form_params,
717
+ :body => post_body,
718
+ :auth_names => auth_names)
719
+ if @api_client.config.debugging
720
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_touch_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
721
+ end
722
+ return data, status_code, headers
723
+ end
724
+
725
+ # Enqueue task
726
+ # Enqueues task(s). If any of the tasks is invalid, none of the tasks are enqueued.
727
+ # @param name name of the group.
728
+ # @param body Array of tasks to post.
729
+ # @param [Hash] opts the optional parameters
730
+ # @return [TasksWrapper]
731
+ def groups_name_tasks_post(name, body, opts = {})
732
+ data, _status_code, _headers = groups_name_tasks_post_with_http_info(name, body, opts)
733
+ return data
734
+ end
735
+
736
+ # Enqueue task
737
+ # Enqueues task(s). If any of the tasks is invalid, none of the tasks are enqueued.
738
+ # @param name name of the group.
739
+ # @param body Array of tasks to post.
740
+ # @param [Hash] opts the optional parameters
741
+ # @return [Array<(TasksWrapper, Fixnum, Hash)>] TasksWrapper data, response status code and response headers
742
+ def groups_name_tasks_post_with_http_info(name, body, opts = {})
743
+ if @api_client.config.debugging
744
+ @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_post ..."
745
+ end
746
+ # verify the required parameter 'name' is set
747
+ fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_post" if name.nil?
748
+ # verify the required parameter 'body' is set
749
+ fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_post" if body.nil?
750
+ # resource path
751
+ local_var_path = "/groups/{name}/tasks".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)
752
+
753
+ # query parameters
754
+ query_params = {}
755
+
756
+ # header parameters
757
+ header_params = {}
758
+
759
+ # HTTP header 'Accept' (if needed)
760
+ local_header_accept = ['application/json']
761
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
762
+
763
+ # HTTP header 'Content-Type'
764
+ local_header_content_type = ['application/json']
765
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
766
+
767
+ # form parameters
768
+ form_params = {}
769
+
770
+ # http body (model)
771
+ post_body = @api_client.object_to_http_body(body)
772
+ auth_names = []
773
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
774
+ :header_params => header_params,
775
+ :query_params => query_params,
776
+ :form_params => form_params,
777
+ :body => post_body,
778
+ :auth_names => auth_names,
779
+ :return_type => 'TasksWrapper')
780
+ if @api_client.config.debugging
781
+ @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
782
+ end
783
+ return data, status_code, headers
784
+ end
785
+
786
+ # Get next task.
787
+ # 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.
788
+ # @param [Hash] opts the optional parameters
789
+ # @option opts [Integer] :n Number of tasks to return. (default to 1)
790
+ # @return [TasksWrapper]
791
+ def tasks_get(opts = {})
792
+ data, _status_code, _headers = tasks_get_with_http_info(opts)
793
+ return data
794
+ end
795
+
796
+ # Get next task.
797
+ # Gets the next task in the queue, ready for processing. Titan may return &lt;&#x3D;n tasks. Consumers should start processing tasks in order. Each returned task is set to &#x60;status&#x60; \&quot;running\&quot; and &#x60;started_at&#x60; is set to the current time. No other consumer can retrieve this task.
798
+ # @param [Hash] opts the optional parameters
799
+ # @option opts [Integer] :n Number of tasks to return.
800
+ # @return [Array<(TasksWrapper, Fixnum, Hash)>] TasksWrapper data, response status code and response headers
801
+ def tasks_get_with_http_info(opts = {})
802
+ if @api_client.config.debugging
803
+ @api_client.config.logger.debug "Calling API: TasksApi.tasks_get ..."
804
+ end
805
+ # resource path
806
+ local_var_path = "/tasks".sub('{format}','json')
807
+
808
+ # query parameters
809
+ query_params = {}
810
+ query_params[:'n'] = opts[:'n'] if !opts[:'n'].nil?
811
+
812
+ # header parameters
813
+ header_params = {}
814
+
815
+ # HTTP header 'Accept' (if needed)
816
+ local_header_accept = ['application/json']
817
+ local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
818
+
819
+ # HTTP header 'Content-Type'
820
+ local_header_content_type = ['application/json']
821
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
822
+
823
+ # form parameters
824
+ form_params = {}
825
+
826
+ # http body (model)
827
+ post_body = nil
828
+ auth_names = []
829
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
830
+ :header_params => header_params,
831
+ :query_params => query_params,
832
+ :form_params => form_params,
833
+ :body => post_body,
834
+ :auth_names => auth_names,
835
+ :return_type => 'TasksWrapper')
836
+ if @api_client.config.debugging
837
+ @api_client.config.logger.debug "API called: TasksApi#tasks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
838
+ end
839
+ return data, status_code, headers
840
+ end
841
+ end
842
+ end