class Runcible::Resources::TaskGroup

@see docs.pulpproject.org/dev-guide/integration/rest-api/dispatch/index.html

Public Class Methods

path(id = nil) click to toggle source

Generates the API path for Tasks

@param [String] id the id of the task @return [String] the task path, may contain the id if passed

# File lib/runcible/resources/task_group.rb, line 9
def self.path(id = nil)
  id.nil? ? 'task_groups/' : "task_groups/#{id}/"
end
summary_path(id) click to toggle source
# File lib/runcible/resources/task_group.rb, line 13
def self.summary_path(id)
  "task_groups/#{id}/state_summary/"
end

Public Instance Methods

cancel(id) click to toggle source

cancel a task group @param [String] id the id of the task @return [RestClient::Response]

# File lib/runcible/resources/task_group.rb, line 39
def cancel(id)
  call(:delete, path(id))
end
completed?(summary_report) click to toggle source

checks if all tasks in the summary report have completed @param [Hash] the summary report obtained from summary(id) call @return true if tasks in the summary report have completed

# File lib/runcible/resources/task_group.rb, line 28
def completed?(summary_report)
  sum = 0
  ["finished", "canceled", "skipped", "suspended", "error"].each do |state|
    sum += summary_report[state] if summary_report[state]
  end
  sum == summary_report["total"]
end
summary(id) click to toggle source

summary for the status of a task

@param [String] id the id of the task @return [RestClient::Response]

# File lib/runcible/resources/task_group.rb, line 21
def summary(id)
  call(:get, self.class.summary_path(id))
end