Project

General

Profile

« Previous | Next » 

Revision 40df7dfb

Added by Daniel Lobato Garcia about 11 years ago

  • ID 40df7dfbfcde38f06d133fea97f0d30904155916

fixes #426 expose BMC information in foreman UI

Signed-off-by: Ohad Levy <>

This patch also adds an abstracted power management class for both VM
and BM

View differences:

lib/proxy_api/bmc.rb
case args[:action]
when "on?", "off?", "status"
args[:action].chop! if args[:action].include?('?')
parse get(bmc_url_for('power',args[:action]), args)
response = parse(get(bmc_url_for('power',args[:action]), args))
response.is_a?(Hash) ? response['result'] : response
when "on", "off", "cycle", "soft"
res = parse put(args, bmc_url_for('power',args[:action]))
# This is a simple action, just return the result of the action
......
# get "/bmc/:host/lan/:action"
case args[:action]
when "ip", "netmask", "mac", "gateway"
parse get(bmc_url_for('lan',args[:action]), args)
response = parse(get(bmc_url_for('lan',args[:action]), args))
response.is_a?(Hash) ? response['result'] : response
else
raise NoMethodError
end

Also available in: Unified diff