Class: Chef::Knife::GoiardiJobInfo

Inherits:
Chef::Knife show all
Defined in:
lib/chef/knife/goiardi_job_info.rb

Instance Method Summary collapse

Instance Method Details

#runObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/chef/knife/goiardi_job_info.rb', line 27

def run
	job_id = @name_args[0]
	if job_id.nil?
	  ui.error "No job id specified"
	  show_usage
	  exit 1
	end
	node = @name_args[1]
	if node.nil?
	  ui.error "No node specified"
	  show_usage
	  exit 1
	end
	rest = Chef::REST.new(Chef::Config[:chef_server_url])
	info = rest.get_rest("shovey/jobs/#{job_id}/#{node}")
	output(info)
end