Class: Bmc::Sdk::PowerOff

Inherits:
Object
  • Object
show all
Defined in:
lib/commands.rb

Overview

PowerOff command will power off a specific server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, serverID) ⇒ PowerOff

Returns a new instance of PowerOff.



91
92
93
94
# File 'lib/commands.rb', line 91

def initialize(client, serverID)
  @client = client
  @serverID = serverID
end

Instance Attribute Details

#serverIDObject

Returns the value of attribute serverID.



89
90
91
# File 'lib/commands.rb', line 89

def serverID
  @serverID
end

Instance Method Details

#executeObject



96
97
98
99
100
# File 'lib/commands.rb', line 96

def execute
  return @client.post(
    "#{Entrypoint}servers/#{serverID}/actions/power-off", 
    headers: {'Content-Type': 'application/json'})
end