Class: Jamie::Driver::Bluebox
- Inherits:
-
SSHBase
- Object
- SSHBase
- Jamie::Driver::Bluebox
- Defined in:
- lib/jamie/driver/bluebox.rb
Overview
Blue Box blocks API driver for Jamie.
Instance Method Summary collapse
Instance Method Details
#create(state) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/jamie/driver/bluebox.rb', line 42 def create(state) server = create_server state[:block_id] = server.id state[:hostname] = server.ips.first['address'] info("Blocks instance <#{state[:block_id]}> created.") server.wait_for { print "."; ready? } ; print "(server ready)" wait_for_sshd(state[:hostname]) ; print "(ssh ready)\n" rescue Fog::Errors::Error, Excon::Errors::Error => ex raise ActionFailed, ex. end |
#destroy(state) ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/jamie/driver/bluebox.rb', line 54 def destroy(state) return if state[:block_id].nil? connection.destroy_block(state[:block_id]) info("Blocks instance <#{state[:block_id]}> destroyed.") state.delete(:block_id) state.delete(:hostname) rescue Fog::Errors::Error, Excon::Errors::Error => ex raise ActionFailed, ex. end |