Class: Bmc::Sdk::Shutdown

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

Overview

Shutdown command will shutdown a specific server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, serverID) ⇒ Shutdown

Returns a new instance of Shutdown.



173
174
175
176
# File 'lib/commands.rb', line 173

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

Instance Attribute Details

#serverIDObject

Returns the value of attribute serverID.



171
172
173
# File 'lib/commands.rb', line 171

def serverID
  @serverID
end

Instance Method Details

#executeObject



178
179
180
181
182
# File 'lib/commands.rb', line 178

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