Class: Fog::Compute::Fifo::Server

Inherits:
Server
  • Object
show all
Defined in:
lib/fog/fifo/models/compute/server.rb

Instance Method Summary collapse

Instance Method Details

#datasetObject



16
17
18
19
# File 'lib/fog/fifo/models/compute/server.rb', line 16

def dataset
  requires :uuid
  config["dataset"]
end

#deleteObject



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

#ipsObject

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

#memoryObject



31
32
33
34
# File 'lib/fog/fifo/models/compute/server.rb', line 31

def memory
  requires :uuid
  config["ram"]
end

#ready?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/fog/fifo/models/compute/server.rb', line 54

def ready?
  self.state == 'running'
end

#rebootObject



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

#startObject



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

#stopObject



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

Returns:

  • (Boolean)


42
43
44
45
# File 'lib/fog/fifo/models/compute/server.rb', line 42

def stopped?
  requires :uuid
  self.state == 'stopped'
end