Class: Dployr::Compute::BAREMETAL

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/dployr/compute/baremetal.rb

Instance Method Summary collapse

Methods included from Common

wait_ssh

Constructor Details

#initialize(options, attrs) ⇒ BAREMETAL

Returns a new instance of BAREMETAL.



11
12
13
14
# File 'lib/dployr/compute/baremetal.rb', line 11

def initialize(options, attrs)
  @options = options
  @attrs = attrs
end

Instance Method Details

#destroyObject



33
34
35
# File 'lib/dployr/compute/baremetal.rb', line 33

def destroy()
  puts "Could not destroy baremetal machine".yellow
end

#get_infoObject



24
25
26
27
28
29
30
31
# File 'lib/dployr/compute/baremetal.rb', line 24

def get_info()
  result = OpenStruct.new
  result.attributes = {
    public_ip: @attrs["public_ip"],
    private_ip: @attrs["private_ip"],
  }
  return result
end

#get_ipObject



16
17
18
19
20
21
22
# File 'lib/dployr/compute/baremetal.rb', line 16

def get_ip()
  if @options["public_ip"]
    return @attrs["public_ip"]
  else
    return @attrs["private_ip"]
  end
end

#haltObject



37
38
39
# File 'lib/dployr/compute/baremetal.rb', line 37

def halt()
  puts "Could not halt baremetal machine".yellow
end

#startObject



41
42
43
44
# File 'lib/dployr/compute/baremetal.rb', line 41

def start()
  puts "Could not start baremetal machine".yellow
  wait_ssh(attributes, server, @options["public_ip"])
end