Class: VagrantPlugins::VCloud::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-vcloud/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#catalogObject

catalog object (Hash)



122
123
124
# File 'lib/vagrant-vcloud/config.rb', line 122

def catalog
  @catalog
end

#catalog_idObject

catalog id (String)



125
126
127
# File 'lib/vagrant-vcloud/config.rb', line 125

def catalog_id
  @catalog_id
end

#catalog_itemObject

catalog item object (Hash)



128
129
130
# File 'lib/vagrant-vcloud/config.rb', line 128

def catalog_item
  @catalog_item
end

#catalog_item_nameString

Catalog Item to be used as a template

Returns:

  • (String)


38
39
40
# File 'lib/vagrant-vcloud/config.rb', line 38

def catalog_item_name
  @catalog_item_name
end

#catalog_nameString

Catalog Name where the item resides

Returns:

  • (String)


33
34
35
# File 'lib/vagrant-vcloud/config.rb', line 33

def catalog_name
  @catalog_name
end

#cpusObject

VM number of cpus (Integer)



140
141
142
# File 'lib/vagrant-vcloud/config.rb', line 140

def cpus
  @cpus
end

#hostnameString

The vCloud Director hostname

Returns:

  • (String)


11
12
13
# File 'lib/vagrant-vcloud/config.rb', line 11

def hostname
  @hostname
end

#ip_allocation_typeString

IP allocation type

Returns:

  • (String)


63
64
65
# File 'lib/vagrant-vcloud/config.rb', line 63

def ip_allocation_type
  @ip_allocation_type
end

#ip_dnsArray

DNS

Returns:

  • (Array)


73
74
75
# File 'lib/vagrant-vcloud/config.rb', line 73

def ip_dns
  @ip_dns
end

#ip_subnetString

IP subnet

Returns:

  • (String)


68
69
70
# File 'lib/vagrant-vcloud/config.rb', line 68

def ip_subnet
  @ip_subnet
end

#memoryObject

VM memory size in MB (Integer)



137
138
139
# File 'lib/vagrant-vcloud/config.rb', line 137

def memory
  @memory
end

#nested_hypervisorObject

NestedHypervisor (Bool)



143
144
145
# File 'lib/vagrant-vcloud/config.rb', line 143

def nested_hypervisor
  @nested_hypervisor
end

#network_bridgeBool

Bridge Mode

Returns:

  • (Bool)


78
79
80
# File 'lib/vagrant-vcloud/config.rb', line 78

def network_bridge
  @network_bridge
end

#orgObject

org object (Hash)



110
111
112
# File 'lib/vagrant-vcloud/config.rb', line 110

def org
  @org
end

#org_idObject

org id (String)



113
114
115
# File 'lib/vagrant-vcloud/config.rb', line 113

def org_id
  @org_id
end

#org_nameString

The Organization Name to log in to

Returns:

  • (String)


16
17
18
# File 'lib/vagrant-vcloud/config.rb', line 16

def org_name
  @org_name
end

#passwordString

The password used to log in

Returns:

  • (String)


26
27
28
# File 'lib/vagrant-vcloud/config.rb', line 26

def password
  @password
end

#port_forwarding_rulesHash (readonly)

Port forwarding rules

Returns:

  • (Hash)


83
84
85
# File 'lib/vagrant-vcloud/config.rb', line 83

def port_forwarding_rules
  @port_forwarding_rules
end

#upload_chunksizeInteger

Chunksize for upload in bytes (default 1048576 == 1M)

Returns:

  • (Integer)


43
44
45
# File 'lib/vagrant-vcloud/config.rb', line 43

def upload_chunksize
  @upload_chunksize
end

#usernameString

The username used to log in

Returns:

  • (String)


21
22
23
# File 'lib/vagrant-vcloud/config.rb', line 21

def username
  @username
end

#vapp_prefixString

Name of the vApp prefix [optional, defaults to ‘Vagrant’ ]

Returns:

  • (String)


99
100
101
# File 'lib/vagrant-vcloud/config.rb', line 99

def vapp_prefix
  @vapp_prefix
end

#vAppIdObject

vApp Id (String)



134
135
136
# File 'lib/vagrant-vcloud/config.rb', line 134

def vAppId
  @vAppId
end

#vAppNameObject

vApp Name (String)



131
132
133
# File 'lib/vagrant-vcloud/config.rb', line 131

def vAppName
  @vAppName
end

#vcloud_cnxObject

connection handle



107
108
109
# File 'lib/vagrant-vcloud/config.rb', line 107

def vcloud_cnx
  @vcloud_cnx
end

#vdcObject

vdc object (Hash)



116
117
118
# File 'lib/vagrant-vcloud/config.rb', line 116

def vdc
  @vdc
end

#vdc_edge_gatewayString

Name of the edge gateway [optional]

Returns:

  • (String)


88
89
90
# File 'lib/vagrant-vcloud/config.rb', line 88

def vdc_edge_gateway
  @vdc_edge_gateway
end

#vdc_edge_gateway_ipString

Public IP of the edge gateway [optional, required if :vdc_edge_gateway is specified]

Returns:

  • (String)


94
95
96
# File 'lib/vagrant-vcloud/config.rb', line 94

def vdc_edge_gateway_ip
  @vdc_edge_gateway_ip
end

#vdc_idObject

vdc id (String)



119
120
121
# File 'lib/vagrant-vcloud/config.rb', line 119

def vdc_id
  @vdc_id
end

#vdc_nameString

Virtual Data Center to be used

Returns:

  • (String)


48
49
50
# File 'lib/vagrant-vcloud/config.rb', line 48

def vdc_name
  @vdc_name
end

#vdc_network_idString

Virtual Data Center Network Id to be used

Returns:

  • (String)


58
59
60
# File 'lib/vagrant-vcloud/config.rb', line 58

def vdc_network_id
  @vdc_network_id
end

#vdc_network_nameString

Virtual Data Center Network to be used

Returns:

  • (String)


53
54
55
# File 'lib/vagrant-vcloud/config.rb', line 53

def vdc_network_name
  @vdc_network_name
end

Instance Method Details

#validate(machine) ⇒ Object



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/vagrant-vcloud/config.rb', line 145

def validate(machine)
  errors = _detected_errors

  # TODO: add blank?
  errors << I18n.t('vagrant_vcloud.config.hostname') if hostname.nil?
  errors << I18n.t('vagrant_vcloud.config.org_name') if org_name.nil?
  errors << I18n.t('vagrant_vcloud.config.username') if username.nil?
  errors << I18n.t('vagrant_vcloud.config.password') if password.nil?

  unless ip_dns.nil?
    unless ip_dns.kind_of?(Array)
      errors << I18n.t('vagrant_vcloud.config.ip_dns')
    end
  end

  if catalog_name.nil?
    errors << I18n.t('vagrant_vcloud.config.catalog_name')
  end

  if vdc_name.nil?
    errors << I18n.t('vagrant_vcloud.config.vdc_name')
  end

  if vdc_network_name.nil?
    errors << I18n.t('vagrant_vcloud.config.vdc_network_name')
  end

  { 'vCloud Provider' => errors }
end