Class: FogExtensions::Vsphere::MiniServer

Inherits:
Object
  • Object
show all
Defined in:
lib/fog_extensions/vsphere/mini_server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ MiniServer


7
8
9
10
11
12
13
14
# File 'lib/fog_extensions/vsphere/mini_server.rb', line 7

def initialize raw
  @raw      = raw
  @name     = raw.name
  @identity = raw.config.instanceUuid
  @cpus     = raw.config.hardware.numCPU
  @memory   = raw.config.hardware.memoryMB * 1024 * 1024
  @ready    = raw.runtime.powerState == "poweredOn"
end

Instance Attribute Details

#cpusObject (readonly)

Returns the value of attribute cpus


4
5
6
# File 'lib/fog_extensions/vsphere/mini_server.rb', line 4

def cpus
  @cpus
end

#identityObject (readonly)

Returns the value of attribute identity


4
5
6
# File 'lib/fog_extensions/vsphere/mini_server.rb', line 4

def identity
  @identity
end

#memoryObject (readonly)

Returns the value of attribute memory


4
5
6
# File 'lib/fog_extensions/vsphere/mini_server.rb', line 4

def memory
  @memory
end

#nameObject (readonly)

Returns the value of attribute name


4
5
6
# File 'lib/fog_extensions/vsphere/mini_server.rb', line 4

def name
  @name
end

#readyObject (readonly) Also known as: ready?

Returns the value of attribute ready


4
5
6
# File 'lib/fog_extensions/vsphere/mini_server.rb', line 4

def ready
  @ready
end