Class: Fog::Compute::OpenNebula::Server

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

Instance Method Summary collapse

Instance Method Details

#console_outputObject



74
75
76
77
# File 'lib/fog/opennebula/models/compute/server.rb', line 74

def console_output
  requires :id
  service.get_vnc_console(id, 'vnc', onevm_object)
end

#destroyObject



66
67
68
# File 'lib/fog/opennebula/models/compute/server.rb', line 66

def destroy
  service.vm_destroy(id)
end

#private_ip_addressObject



36
37
38
# File 'lib/fog/opennebula/models/compute/server.rb', line 36

def private_ip_address
  ip
end

#public_ip_addressObject



40
41
42
# File 'lib/fog/opennebula/models/compute/server.rb', line 40

def public_ip_address
  ip
end

#ready?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/fog/opennebula/models/compute/server.rb', line 70

def ready?
  (status == 3)
end

#resumeObject



62
63
64
# File 'lib/fog/opennebula/models/compute/server.rb', line 62

def resume
  service.vm_resume(id)
end

#saveObject



28
29
30
# File 'lib/fog/opennebula/models/compute/server.rb', line 28

def save
  merge_attributes(service.vm_allocate(attributes))
end

#startObject



48
49
50
51
# File 'lib/fog/opennebula/models/compute/server.rb', line 48

def start
  service.vm_resume(id) if status == 4
  true
end

#stopObject



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

def stop
  Fog::Logger.warning("stop VM: ID:#{id}")
  service.vm_stop(id)
end

#suspendObject



58
59
60
# File 'lib/fog/opennebula/models/compute/server.rb', line 58

def suspend
  service.vm_suspend(id)
end

#vm_ip_addressObject



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

def vm_ip_address
  ip
end

#vm_mac_addressObject



44
45
46
# File 'lib/fog/opennebula/models/compute/server.rb', line 44

def vm_mac_address
  mac
end