Class: VmShepherd::Vcloud::VappConfig

Inherits:
Object
  • Object
show all
Includes:
DataObject
Defined in:
lib/vm_shepherd/vcloud/vapp_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DataObject

#==

Constructor Details

#initialize(name:, ip:, gateway:, netmask:, dns:, ntp:, catalog:, network:) ⇒ VappConfig

Returns a new instance of VappConfig.



7
8
9
10
11
12
13
14
15
16
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 7

def initialize(name:, ip:, gateway:, netmask:, dns:, ntp:, catalog:, network:)
  @name    = name
  @ip      = ip
  @gateway = gateway
  @netmask = netmask
  @dns     = dns
  @ntp     = ntp
  @catalog = catalog
  @network = network
end

Instance Attribute Details

#catalogObject (readonly)

Returns the value of attribute catalog.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def catalog
  @catalog
end

#dnsObject (readonly)

Returns the value of attribute dns.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def dns
  @dns
end

#gatewayObject (readonly)

Returns the value of attribute gateway.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def gateway
  @gateway
end

#ipObject (readonly)

Returns the value of attribute ip.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def ip
  @ip
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def name
  @name
end

#netmaskObject (readonly)

Returns the value of attribute netmask.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def netmask
  @netmask
end

#networkObject (readonly)

Returns the value of attribute network.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def network
  @network
end

#ntpObject (readonly)

Returns the value of attribute ntp.



5
6
7
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 5

def ntp
  @ntp
end

Instance Method Details

#build_propertiesObject



18
19
20
21
22
23
24
25
26
27
28
29
30
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/vm_shepherd/vcloud/vapp_config.rb', line 18

def build_properties
  [
    {
      'type'             => 'string',
      'key'              => 'gateway',
      'value'            => gateway,
      'password'         => 'false',
      'userConfigurable' => 'true',
      'Label'            => 'Default Gateway',
      'Description'      => 'The default gateway address for the VM network. Leave blank if DHCP is desired.'
    },
    {
      'type'             => 'string',
      'key'              => 'DNS',
      'value'            => dns,
      'password'         => 'false',
      'userConfigurable' => 'true',
      'Label'            => 'DNS',
      'Description'      => 'The domain name servers for the VM (comma separated). Leave blank if DHCP is desired.',
    },
    {
      'type'             => 'string',
      'key'              => 'ntp_servers',
      'value'            => ntp,
      'password'         => 'false',
      'userConfigurable' => 'true',
      'Label'            => 'NTP Servers',
      'Description'      => 'Comma-delimited list of NTP servers'
    },
    {
      'type'             => 'string',
      'key'              => 'admin_password',
      'value'            => 'tempest',
      'password'         => 'true',
      'userConfigurable' => 'true',
      'Label'            => 'Admin Password',
      'Description'      => 'This password is used to SSH into the VM. The username is "tempest".',
    },
    {
      'type'             => 'string',
      'key'              => 'ip0',
      'value'            => ip,
      'password'         => 'false',
      'userConfigurable' => 'true',
      'Label'            => 'IP Address',
      'Description'      => 'The IP address for the VM. Leave blank if DHCP is desired.',
    },
    {
      'type'             => 'string',
      'key'              => 'netmask0',
      'value'            => netmask,
      'password'         => 'false',
      'userConfigurable' => 'true',
      'Label'            => 'Netmask',
      'Description'      => 'The netmask for the VM network. Leave blank if DHCP is desired.'
    }
  ]
end