Class: VirtualMachine

Inherits:
Object
  • Object
show all
Defined in:
lib/secured_cloud_api_client/virtual_machine.rb

Overview

Virtual machines.

@author

Alan Vella

Instance Method Summary collapse

Constructor Details

#initialize(name, description, storageGB, storageType, memoryMB, vCPUs, powerStatus, nodeResource, organizationResource, operatingSystemTemplate, imageResource, disks, macAddress, deducedPrivateIps, ipMappings) ⇒ VirtualMachine

Returns a new instance of VirtualMachine.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/secured_cloud_api_client/virtual_machine.rb', line 11

def initialize(name, description, storageGB, storageType, memoryMB, vCPUs, powerStatus, nodeResource, organizationResource,
  operatingSystemTemplate, imageResource, disks, macAddress, deducedPrivateIps, ipMappings)
  @name = name
  @description = description
  @storageGB = storageGB
  @storageType = storageType
  @memoryMB = memoryMB
  @vCPUs = vCPUs
  @powerStatus = powerStatus
  @nodeResource = nodeResource
  @organizationResource = organizationResource
  @operatingSystemTemplate = operatingSystemTemplate
  @imageResource = imageResource
  @disks = disks
  @macAddress = macAddress
  @deducedPrivateIps = deducedPrivateIps
  @ipMappings = ipMappings
end

Instance Method Details

#get_detailsObject



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/secured_cloud_api_client/virtual_machine.rb', line 31

def get_details()
  details  = "Name                     : #{@name}\n"
  details += "Description              : #{@description}\n"
  details += "Storage (GB)             : #{@storageGB}\n"
  details += "Storage Type             : #{@storageType}\n"
  details += "Memory (Mb)              : #{@memoryMB}\n"
  details += "vCPUs                    : #{@vCPUs}\n"
  details += "Power Status             : #{@powerStatus}\n"
  details += "Node Resource            : #{@nodeResource}\n"
  details += "Organization Resource    : #{@organizationResource}\n"
  details += "Operation System Template: #{@operatingSystemTemplate}\n"
  details += "Image Resource           : #{@imageResource}\n"
  if (@disks == nil) then
    details += "Disks                    : -\n"
  else
    details += "Disks                    : #{@disks.join(", ")}\n"
  end
  if (@deducedPrivateIps == nil) then
    details += "Deduced Private IPs      : -\n"
  else
    details += "Deduced Private IPs      : #{@deducedPrivateIps.join(", ")}\n"
  end
  details += "IP Mappings:"
  @ipMappings.each do |ipMapping|
    details += "\n\t#{ipMapping.get_details()}"
  end
  details += "\nMAC Address              : #{@macAddress}\n"
  return details
end

#get_image_resource_urlObject



72
73
74
# File 'lib/secured_cloud_api_client/virtual_machine.rb', line 72

def get_image_resource_url
  return @imageResource
end

#get_ip_mappingsObject



77
78
79
# File 'lib/secured_cloud_api_client/virtual_machine.rb', line 77

def get_ip_mappings
  return @ipMappings
end

#get_nameObject



82
83
84
# File 'lib/secured_cloud_api_client/virtual_machine.rb', line 82

def get_name
  return @name
end

#get_os_template_resource_urlObject



67
68
69
# File 'lib/secured_cloud_api_client/virtual_machine.rb', line 67

def get_os_template_resource_url
  return @operatingSystemTemplate
end

#get_power_statusObject



62
63
64
# File 'lib/secured_cloud_api_client/virtual_machine.rb', line 62

def get_power_status
  return @powerStatus
end