class IronWorker::TasksApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/iron_ruby/api/tasks_api.rb, line 30
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

groups_name_tasks_get(name, opts = {}) click to toggle source

Get task list by group name. This will list tasks for a particular group. @param name Name of group for this set of tasks. @param [Hash] opts the optional parameters @option opts [DateTime] :created_after Will return tasks created after this time. In RFC3339 format. @option opts [Integer] :n Number of tasks to return per page. Default is 50. Max is 1000. @option opts [String] :cursor Pass this in from a previous query to paginate results. @return [TasksWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 42
def groups_name_tasks_get(name, opts = {})
  data, _status_code, _headers = groups_name_tasks_get_with_http_info(name, opts)
  return data
end
groups_name_tasks_get_with_http_info(name, opts = {}) click to toggle source

Get task list by group name. This will list tasks for a particular group. @param name Name of group for this set of tasks. @param [Hash] opts the optional parameters @option opts [DateTime] :created_after Will return tasks created after this time. In RFC3339 format. @option opts [Integer] :n Number of tasks to return per page. Default is 50. Max is 1000. @option opts [String] :cursor Pass this in from a previous query to paginate results. @return [Array<(TasksWrapper, Fixnum, Hash)>] TasksWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 55
def groups_name_tasks_get_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_get ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_get" if name.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks".sub('{format}','json').sub('{' + 'name' + '}', name.to_s)

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

  # 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 => 'TasksWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_cancel_post(name, id, opts = {}) click to toggle source

Cancel a task. 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. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [TaskWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 106
def groups_name_tasks_id_cancel_post(name, id, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_cancel_post_with_http_info(name, id, opts)
  return data
end
groups_name_tasks_id_cancel_post_with_http_info(name, id, opts = {}) click to toggle source

Cancel a task. 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. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 117
def groups_name_tasks_id_cancel_post_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_cancel_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_cancel_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_cancel_post" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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 => 'TaskWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_cancel_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_delete(name, id, opts = {}) click to toggle source

Delete the task. 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. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [nil]

# File lib/iron_ruby/api/tasks_api.rb, line 167
def groups_name_tasks_id_delete(name, id, opts = {})
  groups_name_tasks_id_delete_with_http_info(name, id, opts)
  return nil
end
groups_name_tasks_id_delete_with_http_info(name, id, opts = {}) click to toggle source

Delete the task. 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. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 178
def groups_name_tasks_id_delete_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_delete ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_delete" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_delete" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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: TasksApi#groups_name_tasks_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_error_post(name, id, body, opts = {}) click to toggle source

Mark task as failed. Task is marked as failed if it was in a valid state. Task's `finished_at` time is initialized. @param name Name of group for this set of tasks. @param id Task id @param body @param [Hash] opts the optional parameters @return [TaskWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 228
def groups_name_tasks_id_error_post(name, id, body, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_error_post_with_http_info(name, id, body, opts)
  return data
end
groups_name_tasks_id_error_post_with_http_info(name, id, body, opts = {}) click to toggle source

Mark task as failed. Task is marked as failed if it was in a valid state. Task&#39;s &#x60;finished_at&#x60; time is initialized. @param name Name of group for this set of tasks. @param id Task id @param body @param [Hash] opts the optional parameters @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 240
def groups_name_tasks_id_error_post_with_http_info(name, id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_error_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_error_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_error_post" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_id_error_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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 => 'TaskWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_error_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_get(name, id, opts = {}) click to toggle source

Gets task by id Gets a task by id. @param name Name of group for this set of tasks. @param id task id @param [Hash] opts the optional parameters @return [TaskWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 292
def groups_name_tasks_id_get(name, id, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_get_with_http_info(name, id, opts)
  return data
end
groups_name_tasks_id_get_with_http_info(name, id, opts = {}) click to toggle source

Gets task by id Gets a task by id. @param name Name of group for this set of tasks. @param id task id @param [Hash] opts the optional parameters @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 303
def groups_name_tasks_id_get_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_get ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_get" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_get" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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 => 'TaskWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_log_get(name, id, opts = {}) click to toggle source

Get the log of a completed task. Retrieves the log from log storage. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [String]

# File lib/iron_ruby/api/tasks_api.rb, line 353
def groups_name_tasks_id_log_get(name, id, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_log_get_with_http_info(name, id, opts)
  return data
end
groups_name_tasks_id_log_get_with_http_info(name, id, opts = {}) click to toggle source

Get the log of a completed task. Retrieves the log from log storage. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 364
def groups_name_tasks_id_log_get_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_log_get ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_log_get" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_log_get" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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: TasksApi#groups_name_tasks_id_log_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_log_post(name, id, log, opts = {}) click to toggle source

Send in a log for storage. Logs are sent after a task completes since they may be very large and the runner can process the next task. @param name Name of group for this set of tasks. @param id Task id @param log Output log for the task. Content-Type must be "text/plain; charset&#x3D;utf-8&quot;. @param [Hash] opts the optional parameters @return [TaskWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 415
def groups_name_tasks_id_log_post(name, id, log, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_log_post_with_http_info(name, id, log, opts)
  return data
end
groups_name_tasks_id_log_post_with_http_info(name, id, log, opts = {}) click to toggle source

Send in a log for storage. Logs are sent after a task completes since they may be very large and the runner can process the next task. @param name Name of group for this set of tasks. @param id Task id @param log Output log for the task. Content-Type must be "text/plain; charset&#x3D;utf-8&quot;. @param [Hash] opts the optional parameters @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 427
def groups_name_tasks_id_log_post_with_http_info(name, id, log, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_log_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_log_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_log_post" if id.nil?
  # verify the required parameter 'log' is set
  fail ArgumentError, "Missing the required parameter 'log' when calling TasksApi.groups_name_tasks_id_log_post" if log.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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 => 'TaskWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_log_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_retry_post(name, id, opts = {}) click to toggle source

Retry a task. "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." @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [TaskWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 480
def groups_name_tasks_id_retry_post(name, id, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_retry_post_with_http_info(name, id, opts)
  return data
end
groups_name_tasks_id_retry_post_with_http_info(name, id, opts = {}) click to toggle source

Retry a task. "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; @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 491
def groups_name_tasks_id_retry_post_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_retry_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_retry_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_retry_post" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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 => 'TaskWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_retry_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_start_post(name, id, body, opts = {}) click to toggle source

Mark task as started, ie: status = 'running' Task status is changed to 'running' if it was in a valid state before. Task's `started_at` time is initialized. @param name Name of group for this set of tasks. @param id Task id @param body @param [Hash] opts the optional parameters @return [TaskWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 542
def groups_name_tasks_id_start_post(name, id, body, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_start_post_with_http_info(name, id, body, opts)
  return data
end
groups_name_tasks_id_start_post_with_http_info(name, id, body, opts = {}) click to toggle source

Mark task as started, ie: status &#x3D; &#39;running&#39; 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. @param name Name of group for this set of tasks. @param id Task id @param body @param [Hash] opts the optional parameters @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 554
def groups_name_tasks_id_start_post_with_http_info(name, id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_start_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_start_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_start_post" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_id_start_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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 => 'TaskWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_start_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_success_post(name, id, body, opts = {}) click to toggle source

Mark task as succeeded. Task status is changed to succeeded if it was in a valid state before. Task's `completed_at` time is initialized. @param name Name of group for this set of tasks. @param id Task id @param body @param [Hash] opts the optional parameters @return [TaskWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 607
def groups_name_tasks_id_success_post(name, id, body, opts = {})
  data, _status_code, _headers = groups_name_tasks_id_success_post_with_http_info(name, id, body, opts)
  return data
end
groups_name_tasks_id_success_post_with_http_info(name, id, body, opts = {}) click to toggle source

Mark task as succeeded. Task status is changed to succeeded if it was in a valid state before. Task&#39;s &#x60;completed_at&#x60; time is initialized. @param name Name of group for this set of tasks. @param id Task id @param body @param [Hash] opts the optional parameters @return [Array<(TaskWrapper, Fixnum, Hash)>] TaskWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 619
def groups_name_tasks_id_success_post_with_http_info(name, id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_success_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_success_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_success_post" if id.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_id_success_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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 => 'TaskWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_id_success_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_id_touch_post(name, id, opts = {}) click to toggle source

Extend task 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 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. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [nil]

# File lib/iron_ruby/api/tasks_api.rb, line 671
def groups_name_tasks_id_touch_post(name, id, opts = {})
  groups_name_tasks_id_touch_post_with_http_info(name, id, opts)
  return nil
end
groups_name_tasks_id_touch_post_with_http_info(name, id, opts = {}) click to toggle source

Extend task 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 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. @param name Name of group for this set of tasks. @param id Task id @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 682
def groups_name_tasks_id_touch_post_with_http_info(name, id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_id_touch_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_id_touch_post" if name.nil?
  # verify the required parameter 'id' is set
  fail ArgumentError, "Missing the required parameter 'id' when calling TasksApi.groups_name_tasks_id_touch_post" if id.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks/{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: TasksApi#groups_name_tasks_id_touch_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
groups_name_tasks_post(name, body, opts = {}) click to toggle source

Enqueue task Enqueues task(s). If any of the tasks is invalid, none of the tasks are enqueued. @param name name of the group. @param body Array of tasks to post. @param [Hash] opts the optional parameters @return [TasksWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 731
def groups_name_tasks_post(name, body, opts = {})
  data, _status_code, _headers = groups_name_tasks_post_with_http_info(name, body, opts)
  return data
end
groups_name_tasks_post_with_http_info(name, body, opts = {}) click to toggle source

Enqueue task Enqueues task(s). If any of the tasks is invalid, none of the tasks are enqueued. @param name name of the group. @param body Array of tasks to post. @param [Hash] opts the optional parameters @return [Array<(TasksWrapper, Fixnum, Hash)>] TasksWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 742
def groups_name_tasks_post_with_http_info(name, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.groups_name_tasks_post ..."
  end
  # verify the required parameter 'name' is set
  fail ArgumentError, "Missing the required parameter 'name' when calling TasksApi.groups_name_tasks_post" if name.nil?
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling TasksApi.groups_name_tasks_post" if body.nil?
  # resource path
  local_var_path = "/groups/{name}/tasks".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 => 'TasksWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#groups_name_tasks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
tasks_get(opts = {}) click to toggle source

Get next task. 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. @param [Hash] opts the optional parameters @option opts [Integer] :n Number of tasks to return. (default to 1) @return [TasksWrapper]

# File lib/iron_ruby/api/tasks_api.rb, line 791
def tasks_get(opts = {})
  data, _status_code, _headers = tasks_get_with_http_info(opts)
  return data
end
tasks_get_with_http_info(opts = {}) click to toggle source

Get next task. 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; "running&quot; and &#x60;started_at&#x60; is set to the current time. No other consumer can retrieve this task. @param [Hash] opts the optional parameters @option opts [Integer] :n Number of tasks to return. @return [Array<(TasksWrapper, Fixnum, Hash)>] TasksWrapper data, response status code and response headers

# File lib/iron_ruby/api/tasks_api.rb, line 801
def tasks_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: TasksApi.tasks_get ..."
  end
  # resource path
  local_var_path = "/tasks".sub('{format}','json')

  # query parameters
  query_params = {}
  query_params[:'n'] = opts[:'n'] if !opts[:'n'].nil?

  # 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 => 'TasksWrapper')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TasksApi#tasks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end