Class: IronTitan::JobsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/iron_titan/api/jobs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ JobsApi

Returns a new instance of JobsApi.



30
31
32
# File 'lib/iron_titan/api/jobs_api.rb', line 30

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



28
29
30
# File 'lib/iron_titan/api/jobs_api.rb', line 28

def api_client
  @api_client
end

Instance Method Details

#groups_name_jobs_get(name, opts = {}) ⇒ JobsWrapper

Get job list by group name. This will list jobs for a particular group.

Parameters:

  • name

    Name of group for this set of jobs.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :created_after (DateTime)

    Will return jobs created after this time. In RFC3339 format.

  • :n (Integer)

    Number of jobs to return per page. Default is 50. Max is 1000.

  • :cursor (String)

    Pass this in from a previous query to paginate results.

Returns:



42
43
44
45
# File 'lib/iron_titan/api/jobs_api.rb', line 42

def groups_name_jobs_get(name, opts = {})
  data, _status_code, _headers = groups_name_jobs_get_with_http_info(name, opts)
  return data
end

#groups_name_jobs_get_with_http_info(name, opts = {}) ⇒ Array<(JobsWrapper, Fixnum, Hash)>

Get job list by group name. This will list jobs for a particular group.

Parameters:

  • name

    Name of group for this set of jobs.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :created_after (DateTime)

    Will return jobs created after this time. In RFC3339 format.

  • :n (Integer)

    Number of jobs to return per page. Default is 50. Max is 1000.

  • :cursor (String)

    Pass this in from a previous query to paginate results.

Returns:

  • (Array<(JobsWrapper, Fixnum, Hash)>)

    JobsWrapper data, response status code and response headers



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/iron_titan/api/jobs_api.rb', line 55

def groups_name_jobs_get_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_get ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_get" if name.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}
  query_params[:'created_after'] = opts[:'created_after'] if opts[:'created_after']
  query_params[:'n'] = opts[:'n'] if opts[:'n']
  query_params[:'cursor'] = opts[:'cursor'] if opts[:'cursor']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobsWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_cancel_post(name, id, opts = {}) ⇒ JobWrapper

Cancel a job. Cancels a job in delayed, queued or running status. The worker may continue to run a running job. reason is set to ‘client_request`. The job’s completed_at field is set to the current time on the jobserver.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



106
107
108
109
# File 'lib/iron_titan/api/jobs_api.rb', line 106

def groups_name_jobs_id_cancel_post(name, id, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_cancel_post_with_http_info(name, id, opts)
  return data
end

#groups_name_jobs_id_cancel_post_with_http_info(name, id, opts = {}) ⇒ Array<(JobWrapper, Fixnum, Hash)>

Cancel a job. Cancels a job in delayed, queued or running status. The worker may continue to run a running job. reason is set to &#x60;client_request&#x60;. The job&#39;s completed_at field is set to the current time on the jobserver.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobWrapper, Fixnum, Hash)>)

    JobWrapper data, response status code and response headers



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/iron_titan/api/jobs_api.rb', line 117

def groups_name_jobs_id_cancel_post_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_cancel_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_cancel_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_cancel_post" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/cancel".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_cancel_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_delete(name, id, opts = {}) ⇒ nil

Delete the job. Delete only succeeds if job status is one of ‘succeeded | failed | cancelled`. Cancel a job if it is another state and needs to be deleted. All information about the job, including the log, is irretrievably lost when this is invoked.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


167
168
169
170
# File 'lib/iron_titan/api/jobs_api.rb', line 167

def groups_name_jobs_id_delete(name, id, opts = {})
  groups_name_jobs_id_delete_with_http_info(name, id, opts)
  return nil
end

#groups_name_jobs_id_delete_with_http_info(name, id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the job. Delete only succeeds if job status is one of &#x60;succeeded | failed | cancelled&#x60;. Cancel a job if it is another state and needs to be deleted. All information about the job, including the log, is irretrievably lost when this is invoked.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/iron_titan/api/jobs_api.rb', line 178

def groups_name_jobs_id_delete_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_delete ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_delete" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_delete" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_error_post(name, id, body, opts = {}) ⇒ JobWrapper

Mark job as failed. Job is marked as failed if it was in a valid state. Job’s ‘finished_at` time is initialized.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



228
229
230
231
# File 'lib/iron_titan/api/jobs_api.rb', line 228

def groups_name_jobs_id_error_post(name, id, body, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_error_post_with_http_info(name, id, body, opts)
  return data
end

#groups_name_jobs_id_error_post_with_http_info(name, id, body, opts = {}) ⇒ Array<(JobWrapper, Fixnum, Hash)>

Mark job as failed. Job is marked as failed if it was in a valid state. Job&#39;s &#x60;finished_at&#x60; time is initialized.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobWrapper, Fixnum, Hash)>)

    JobWrapper data, response status code and response headers



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/iron_titan/api/jobs_api.rb', line 240

def groups_name_jobs_id_error_post_with_http_info(name, id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_error_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_error_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_error_post" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_id_error_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/error".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_error_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_get(name, id, opts = {}) ⇒ JobWrapper

Gets job by id Gets a job by id.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



292
293
294
295
# File 'lib/iron_titan/api/jobs_api.rb', line 292

def groups_name_jobs_id_get(name, id, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_get_with_http_info(name, id, opts)
  return data
end

#groups_name_jobs_id_get_with_http_info(name, id, opts = {}) ⇒ Array<(JobWrapper, Fixnum, Hash)>

Gets job by id Gets a job by id.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobWrapper, Fixnum, Hash)>)

    JobWrapper data, response status code and response headers



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/iron_titan/api/jobs_api.rb', line 303

def groups_name_jobs_id_get_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_get ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_get" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_get" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_log_get(name, id, opts = {}) ⇒ String

Get the log of a completed job. Retrieves the log from log storage.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


353
354
355
356
# File 'lib/iron_titan/api/jobs_api.rb', line 353

def groups_name_jobs_id_log_get(name, id, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_log_get_with_http_info(name, id, opts)
  return data
end

#groups_name_jobs_id_log_get_with_http_info(name, id, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get the log of a completed job. Retrieves the log from log storage.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/iron_titan/api/jobs_api.rb', line 364

def groups_name_jobs_id_log_get_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_log_get ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_log_get" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_log_get" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/log".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['text/plain']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_log_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_log_post(name, id, log, opts = {}) ⇒ JobWrapper

Send in a log for storage. Logs are sent after a job completes since they may be very large and the runner can process the next job.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • log

    Output log for the job. Content-Type must be &quot;text/plain; charset&#x3D;utf-8&quot;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



415
416
417
418
# File 'lib/iron_titan/api/jobs_api.rb', line 415

def groups_name_jobs_id_log_post(name, id, log, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_log_post_with_http_info(name, id, log, opts)
  return data
end

#groups_name_jobs_id_log_post_with_http_info(name, id, log, opts = {}) ⇒ Array<(JobWrapper, Fixnum, Hash)>

Send in a log for storage. Logs are sent after a job completes since they may be very large and the runner can process the next job.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • log

    Output log for the job. Content-Type must be &quot;text/plain; charset&#x3D;utf-8&quot;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobWrapper, Fixnum, Hash)>)

    JobWrapper data, response status code and response headers



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/iron_titan/api/jobs_api.rb', line 427

def groups_name_jobs_id_log_post_with_http_info(name, id, log, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_log_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_log_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_log_post" if id.nil?
  # verify the required parameter 'log' is set
  fail ArgumentError, "Missing the required parameter 'log' when calling JobsApi.groups_name_jobs_id_log_post" if log.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/log".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['multipart/form-data']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}
  form_params["log"] = log

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_log_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_retry_post(name, id, opts = {}) ⇒ JobWrapper

Retry a job. "The /retry endpoint can be used to force a retry of jobs with status succeeded or cancelled. It can also be used to retry jobs that in the failed state, but whose max_retries field is 0. The retried job will continue to have max_retries = 0."

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



480
481
482
483
# File 'lib/iron_titan/api/jobs_api.rb', line 480

def groups_name_jobs_id_retry_post(name, id, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_retry_post_with_http_info(name, id, opts)
  return data
end

#groups_name_jobs_id_retry_post_with_http_info(name, id, opts = {}) ⇒ Array<(JobWrapper, Fixnum, Hash)>

Retry a job. &quot;The /retry endpoint can be used to force a retry of jobs with status succeeded or cancelled. It can also be used to retry jobs that in the failed state, but whose max_retries field is 0. The retried job will continue to have max_retries &#x3D; 0.&quot;

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobWrapper, Fixnum, Hash)>)

    JobWrapper data, response status code and response headers



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/iron_titan/api/jobs_api.rb', line 491

def groups_name_jobs_id_retry_post_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_retry_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_retry_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_retry_post" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/retry".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_retry_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_start_post(name, id, body, opts = {}) ⇒ JobWrapper

Mark job as started, ie: status = ‘running’ Job status is changed to ‘running’ if it was in a valid state before. Job’s ‘started_at` time is initialized.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



542
543
544
545
# File 'lib/iron_titan/api/jobs_api.rb', line 542

def groups_name_jobs_id_start_post(name, id, body, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_start_post_with_http_info(name, id, body, opts)
  return data
end

#groups_name_jobs_id_start_post_with_http_info(name, id, body, opts = {}) ⇒ Array<(JobWrapper, Fixnum, Hash)>

Mark job as started, ie: status &#x3D; &#39;running&#39; Job status is changed to &#39;running&#39; if it was in a valid state before. Job&#39;s &#x60;started_at&#x60; time is initialized.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobWrapper, Fixnum, Hash)>)

    JobWrapper data, response status code and response headers



554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
# File 'lib/iron_titan/api/jobs_api.rb', line 554

def groups_name_jobs_id_start_post_with_http_info(name, id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_start_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_start_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_start_post" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_id_start_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/start".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_start_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_success_post(name, id, body, opts = {}) ⇒ JobWrapper

Mark job as succeeded. Job status is changed to succeeded if it was in a valid state before. Job’s ‘completed_at` time is initialized.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



607
608
609
610
# File 'lib/iron_titan/api/jobs_api.rb', line 607

def groups_name_jobs_id_success_post(name, id, body, opts = {})
  data, _status_code, _headers = groups_name_jobs_id_success_post_with_http_info(name, id, body, opts)
  return data
end

#groups_name_jobs_id_success_post_with_http_info(name, id, body, opts = {}) ⇒ Array<(JobWrapper, Fixnum, Hash)>

Mark job as succeeded. Job status is changed to succeeded if it was in a valid state before. Job&#39;s &#x60;completed_at&#x60; time is initialized.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobWrapper, Fixnum, Hash)>)

    JobWrapper data, response status code and response headers



619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
# File 'lib/iron_titan/api/jobs_api.rb', line 619

def groups_name_jobs_id_success_post_with_http_info(name, id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_success_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_success_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_success_post" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_id_success_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/success".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_success_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_id_touch_post(name, id, opts = {}) ⇒ nil

Extend job timeout. Consumers can sometimes take a while to run the task after accepting it. An example is when the runner does not have the docker image locally, it can spend a significant time downloading the image. If the timeout is small, the job may never get to run, or run but not be accepted by Titan. Consumers can touch the job before it times out. Titan will reset the timeout, giving the consumer another timeout seconds to run the job. Touch is only valid while the job is in a running state. If touch fails, the runner may stop running the job.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


671
672
673
674
# File 'lib/iron_titan/api/jobs_api.rb', line 671

def groups_name_jobs_id_touch_post(name, id, opts = {})
  groups_name_jobs_id_touch_post_with_http_info(name, id, opts)
  return nil
end

#groups_name_jobs_id_touch_post_with_http_info(name, id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Extend job timeout. Consumers can sometimes take a while to run the task after accepting it. An example is when the runner does not have the docker image locally, it can spend a significant time downloading the image. If the timeout is small, the job may never get to run, or run but not be accepted by Titan. Consumers can touch the job before it times out. Titan will reset the timeout, giving the consumer another timeout seconds to run the job. Touch is only valid while the job is in a running state. If touch fails, the runner may stop running the job.

Parameters:

  • name

    Name of group for this set of jobs.

  • id

    Job id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
# File 'lib/iron_titan/api/jobs_api.rb', line 682

def groups_name_jobs_id_touch_post_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_id_touch_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_id_touch_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling JobsApi.groups_name_jobs_id_touch_post" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs/{id}/touch".sub('{format}','json').sub('{' + 'name' + '}', name.to_s).sub('{' + 'id' + '}', id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_id_touch_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#groups_name_jobs_post(name, body, opts = {}) ⇒ JobsWrapper

Enqueue Job Enqueues job(s). If any of the jobs is invalid, none of the jobs are enqueued.

Parameters:

  • name

    name of the group.

  • body

    Array of jobs to post.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



731
732
733
734
# File 'lib/iron_titan/api/jobs_api.rb', line 731

def groups_name_jobs_post(name, body, opts = {})
  data, _status_code, _headers = groups_name_jobs_post_with_http_info(name, body, opts)
  return data
end

#groups_name_jobs_post_with_http_info(name, body, opts = {}) ⇒ Array<(JobsWrapper, Fixnum, Hash)>

Enqueue Job Enqueues job(s). If any of the jobs is invalid, none of the jobs are enqueued.

Parameters:

  • name

    name of the group.

  • body

    Array of jobs to post.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(JobsWrapper, Fixnum, Hash)>)

    JobsWrapper data, response status code and response headers



742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
# File 'lib/iron_titan/api/jobs_api.rb', line 742

def groups_name_jobs_post_with_http_info(name, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.groups_name_jobs_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling JobsApi.groups_name_jobs_post" if name.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling JobsApi.groups_name_jobs_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/jobs".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobsWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#groups_name_jobs_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#jobs_get(opts = {}) ⇒ JobsWrapper

Get next job. Gets the next job in the queue, ready for processing. Titan may return <=n jobs. Consumers should start processing jobs in order. Each returned job is set to ‘status` "running" and `started_at` is set to the current time. No other consumer can retrieve this job.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :n (Integer)

    Number of jobs to return. (default to 1)

Returns:



791
792
793
794
# File 'lib/iron_titan/api/jobs_api.rb', line 791

def jobs_get(opts = {})
  data, _status_code, _headers = jobs_get_with_http_info(opts)
  return data
end

#jobs_get_with_http_info(opts = {}) ⇒ Array<(JobsWrapper, Fixnum, Hash)>

Get next job. Gets the next job in the queue, ready for processing. Titan may return &lt;&#x3D;n jobs. Consumers should start processing jobs in order. Each returned job 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 job.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :n (Integer)

    Number of jobs to return.

Returns:

  • (Array<(JobsWrapper, Fixnum, Hash)>)

    JobsWrapper data, response status code and response headers



801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
# File 'lib/iron_titan/api/jobs_api.rb', line 801

def jobs_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: JobsApi.jobs_get ..."
  end
  # resource path
  local_var_path = "/jobs".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'n'] = opts[:'n'] if opts[:'n']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
        auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'JobsWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: JobsApi#jobs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end