class HammerCLIForeman::Host::ReportsCommand

Public Instance Methods

execute() click to toggle source
Calls superclass method HammerCLIForeman::ListCommand#execute
# File lib/hammer_cli_foreman/host.rb, line 261
def execute
  warn _('%{reports} command is deprecated and will be removed in one of the future versions. Please use %{config_reports} command instead.') % {:reports => 'reports', :config_reports => 'config-reports'}
  super
end
request_params() click to toggle source
# File lib/hammer_cli_foreman/host.rb, line 270
def request_params
  params = super
  search = []
  search << params['search'] if params['search']

  hostname = get_option_value('name')
  search << %Q(host="#{hostname}") if hostname

  host_id = get_option_value('id')
  search << "host_id=#{host_id}" if host_id

  params['search'] = search.join(' and ') unless search.empty?
  params
end
validate_options() click to toggle source
# File lib/hammer_cli_foreman/host.rb, line 266
def validate_options
  validator.any(:option_name, :option_id).required
end