Class: ForemanDiscovery::NodeAPI::PowerLegacyDirectService
- Inherits:
-
NodeResource
- Object
- NodeResource
- ForemanDiscovery::NodeAPI::PowerLegacyDirectService
- Defined in:
- app/services/foreman_discovery/node_api/power_legacy_direct_service.rb
Overview
legacy /reboot call direct
Instance Method Summary collapse
-
#initialize(args) ⇒ PowerLegacyDirectService
constructor
A new instance of PowerLegacyDirectService.
- #reboot ⇒ Object
Methods inherited from NodeResource
#is_proxy?, #port, #root_path, #scheme, #url
Constructor Details
#initialize(args) ⇒ PowerLegacyDirectService
Returns a new instance of PowerLegacyDirectService.
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
#reboot ⇒ Object
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 |