Class: Fog::Compute::Fifo::Server
- Inherits:
-
Server
- Object
- Server
- Fog::Compute::Fifo::Server
- Defined in:
- lib/fog/fifo/models/compute/server.rb
Instance Method Summary collapse
- #dataset ⇒ Object
- #delete ⇒ Object
-
#ips ⇒ Object
def package requires :uuid config end.
- #memory ⇒ Object
- #ready? ⇒ Boolean
- #reboot ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #stopped? ⇒ Boolean
Instance Method Details
#dataset ⇒ Object
16 17 18 19 |
# File 'lib/fog/fifo/models/compute/server.rb', line 16 def dataset requires :uuid config["dataset"] end |
#delete ⇒ Object
65 66 67 68 69 |
# File 'lib/fog/fifo/models/compute/server.rb', line 65 def delete requires :uuid service.delete_vm(uuid) true end |
#ips ⇒ Object
def package
requires :uuid
config["package"]
end
26 27 28 29 |
# File 'lib/fog/fifo/models/compute/server.rb', line 26 def ips requires :uuid config["networks"].map{|n| n["ip"]} end |
#memory ⇒ Object
31 32 33 34 |
# File 'lib/fog/fifo/models/compute/server.rb', line 31 def memory requires :uuid config["ram"] end |
#ready? ⇒ Boolean
54 55 56 |
# File 'lib/fog/fifo/models/compute/server.rb', line 54 def ready? self.state == 'running' end |
#reboot ⇒ Object
36 37 38 39 40 |
# File 'lib/fog/fifo/models/compute/server.rb', line 36 def reboot requires :uuid service.reboot_vm(uuid) true end |
#start ⇒ Object
58 59 60 61 62 63 |
# File 'lib/fog/fifo/models/compute/server.rb', line 58 def start requires :uuid service.start_vm(uuid) self.wait_for { ready? } true end |
#stop ⇒ Object
47 48 49 50 51 52 |
# File 'lib/fog/fifo/models/compute/server.rb', line 47 def stop requires :uuid service.stop_vm(uuid) self.wait_for { stopped? } true end |
#stopped? ⇒ Boolean
42 43 44 45 |
# File 'lib/fog/fifo/models/compute/server.rb', line 42 def stopped? requires :uuid self.state == 'stopped' end |