Class: Yun::Node
- Inherits:
-
Object
- Object
- Yun::Node
- Defined in:
- lib/yun/model/node.rb
Instance Method Summary collapse
- #all_info ⇒ Object
- #created_at ⇒ Object
- #destroy(&block) ⇒ Object
- #id ⇒ Object
- #image ⇒ Object
-
#initialize(server) ⇒ Node
constructor
A new instance of Node.
- #instance_type ⇒ Object
- #ip ⇒ Object
- #is_destroyed? ⇒ Boolean
- #key_name ⇒ Object
- #name ⇒ Object
- #os ⇒ Object
- #state ⇒ Object
- #user ⇒ Object
- #wait_for_ssh_ready(&block) ⇒ Object
Constructor Details
#initialize(server) ⇒ Node
Returns a new instance of Node.
4 5 6 |
# File 'lib/yun/model/node.rb', line 4 def initialize server @server = server end |
Instance Method Details
#all_info ⇒ Object
56 57 58 |
# File 'lib/yun/model/node.rb', line 56 def all_info @server end |
#created_at ⇒ Object
44 45 46 |
# File 'lib/yun/model/node.rb', line 44 def created_at @server.created_at end |
#destroy(&block) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/yun/model/node.rb', line 48 def destroy &block @server.destroy @server.wait_for do instance_eval(&block) if block_given? not reload or state == 'terminated' end end |
#id ⇒ Object
8 9 10 |
# File 'lib/yun/model/node.rb', line 8 def id @server.id end |
#image ⇒ Object
12 13 14 |
# File 'lib/yun/model/node.rb', line 12 def image @server.image_id end |
#instance_type ⇒ Object
16 17 18 |
# File 'lib/yun/model/node.rb', line 16 def instance_type @server.flavor_id end |
#ip ⇒ Object
40 41 42 |
# File 'lib/yun/model/node.rb', line 40 def ip @server.public_ip_address end |
#is_destroyed? ⇒ Boolean
60 61 62 |
# File 'lib/yun/model/node.rb', line 60 def is_destroyed? @server.state == 'terminated' end |
#key_name ⇒ Object
20 21 22 |
# File 'lib/yun/model/node.rb', line 20 def key_name @server.key_name end |
#name ⇒ Object
24 25 26 |
# File 'lib/yun/model/node.rb', line 24 def name @server.["name"] end |
#os ⇒ Object
28 29 30 |
# File 'lib/yun/model/node.rb', line 28 def os @server.["os"] end |
#state ⇒ Object
36 37 38 |
# File 'lib/yun/model/node.rb', line 36 def state @server.state end |
#user ⇒ Object
32 33 34 |
# File 'lib/yun/model/node.rb', line 32 def user @server.["user"] end |