Class: Dployr::Compute::BAREMETAL
- Inherits:
-
Object
- Object
- Dployr::Compute::BAREMETAL
- Includes:
- Common
- Defined in:
- lib/dployr/compute/baremetal.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #get_info ⇒ Object
- #get_ip ⇒ Object
- #halt ⇒ Object
-
#initialize(options, attrs) ⇒ BAREMETAL
constructor
A new instance of BAREMETAL.
- #start ⇒ Object
Methods included from Common
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(, attrs) @options = @attrs = attrs end |
Instance Method Details
#destroy ⇒ Object
33 34 35 |
# File 'lib/dployr/compute/baremetal.rb', line 33 def destroy puts "Could not destroy baremetal machine".yellow end |
#get_info ⇒ Object
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"], } result end |
#get_ip ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/dployr/compute/baremetal.rb', line 16 def get_ip if @options["public_ip"] @attrs["public_ip"] else @attrs["private_ip"] end end |
#halt ⇒ Object
37 38 39 |
# File 'lib/dployr/compute/baremetal.rb', line 37 def halt puts "Could not halt baremetal machine".yellow end |
#start ⇒ Object
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 |