Class: ForemanDiscovery::NodeAPI::PowerLegacyDirectService

Inherits:
NodeResource
  • Object
show all
Defined in:
app/services/foreman_discovery/node_api/power_legacy_direct_service.rb

Overview

legacy /reboot call direct

Instance Method Summary collapse

Methods inherited from NodeResource

#is_proxy?, #port, #root_path, #scheme, #url

Constructor Details

#initialize(args) ⇒ PowerLegacyDirectService

Returns a new instance of PowerLegacyDirectService.

Raises:

  • (ArgumentError)


4
5
6
7
8
9
# File 'app/services/foreman_discovery/node_api/power_legacy_direct_service.rb', line 4

def initialize(args)
  super args
  raise ArgumentError, "Legacy direct service only supports http scheme" if scheme != 'http'
  raise ArgumentError, "Legacy direct service only supports port 8443" if port != 8443
  Foreman::Deprecation.deprecation_warning("1.11", "Discovery legacy API will be removed, use the new Power API")
end

Instance Method Details

#rebootObject



11
12
13
# File 'app/services/foreman_discovery/node_api/power_legacy_direct_service.rb', line 11

def reboot
  ::ProxyAPI::BMC.new(:url => url).power :action => "cycle"
end