class FoodPusher

Public Class Methods

new(job) click to toggle source
# File lib/chef/knife/foodpusher.rb, line 7
def initialize(job)
  @job = job
end

Public Instance Methods

node_status(nodes) click to toggle source
# File lib/chef/knife/foodpusher.rb, line 20
def node_status(nodes)
  if nodes.empty?
    rest.get_rest('pushy/node_states')
  else
    results = []
    nodes.each do |node|
      results << rest.get_rest("pushy/node_states/#{node}")
    end
  end
  results
end
start() click to toggle source
# File lib/chef/knife/foodpusher.rb, line 11
def start
  result = rest.post_rest('pushy/jobs', @job)
end
status(job_uri) click to toggle source
# File lib/chef/knife/foodpusher.rb, line 15
def status(job_uri)
  job_id = job_uri['uri'].split('/').last
  result = rest.get_rest("pushy/jobs/#{job_id}")
end