Class: Chef::Knife::RunsList

Inherits:
Chef::Knife show all
Includes:
Reporting::KnifeHelpers
Defined in:
lib/chef/knife/runs_list.rb

Constant Summary collapse

PROTOCOL_VERSION =
'0.1.0'
HEADERS =
{'X-Ops-Reporting-Protocol-Version' => PROTOCOL_VERSION}

Constants included from Reporting::KnifeHelpers

Reporting::KnifeHelpers::SECONDS_IN_24HOURS, Reporting::KnifeHelpers::SECONDS_IN_3MONTHS

Instance Method Summary collapse

Methods included from Reporting::KnifeHelpers

#apply_time_args, #check_3month_window, #check_start_and_end_times_provided, #convert_to_unix_timestamps, #last_24hours_time_window, #uuid?

Instance Method Details

#runObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/chef/knife/runs_list.rb', line 64

def run
  @rest = Chef::REST.new(Chef::Config[:chef_server_url])

  node_name = name_args[0]

  check_start_and_end_times_provided()
  start_time, end_time = apply_time_args()
  check_3month_window(start_time, end_time)

  query_string = generate_query(start_time, end_time, node_name, config[:rows])
  runs = history(query_string)

  output(runs)
end