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)



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

def catalog
  @catalog
end

#catalog_idObject

catalog id (String)



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

def catalog_id
  @catalog_id
end

#catalog_itemObject

catalog item object (Hash)



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

def catalog_item
  @catalog_item
end

#catalog_item_nameString

Catalog Item to be used as a template

Returns:

  • (String)


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

def catalog_item_name
  @catalog_item_name
end

#catalog_nameString

Catalog Name where the item resides

Returns:

  • (String)


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

def catalog_name
  @catalog_name
end

#hostnameString

The vCloud Director hostname

Returns:

  • (String)


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

def hostname
  @hostname
end

#ip_allocation_typeString

IP allocation type

Returns:

  • (String)


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

def ip_allocation_type
  @ip_allocation_type
end

#ip_dnsArray

DNS

Returns:

  • (Array)


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

def ip_dns
  @ip_dns
end

#ip_subnetString

IP subnet

Returns:

  • (String)


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

def ip_subnet
  @ip_subnet
end

#orgObject

org object (Hash)



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

def org
  @org
end

#org_idObject

org id (String)



97
98
99
# File 'lib/vagrant-vcloud/config.rb', line 97

def org_id
  @org_id
end

#org_nameString

The Organization Name to log in to

Returns:

  • (String)


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

def org_name
  @org_name
end

#passwordString

The password used to log in

Returns:

  • (String)


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

def password
  @password
end

#port_forwarding_rulesHash (readonly)

Port forwarding rules

Returns:

  • (Hash)


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

def port_forwarding_rules
  @port_forwarding_rules
end

#usernameString

The username used to log in

Returns:

  • (String)


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

def username
  @username
end

#vAppIdObject

vApp Id (String)



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

def vAppId
  @vAppId
end

#vAppNameObject

vApp Name (String)



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

def vAppName
  @vAppName
end

#vcloud_cnxObject

connection handle



91
92
93
# File 'lib/vagrant-vcloud/config.rb', line 91

def vcloud_cnx
  @vcloud_cnx
end

#vdcObject

vdc object (Hash)



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

def vdc
  @vdc
end

#vdc_edge_gatewayString

Name of the edge gateway [optional]

Returns:

  • (String)


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

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)


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

def vdc_edge_gateway_ip
  @vdc_edge_gateway_ip
end

#vdc_idObject

vdc id (String)



103
104
105
# File 'lib/vagrant-vcloud/config.rb', line 103

def vdc_id
  @vdc_id
end

#vdc_nameString

Virtual Data Center to be used

Returns:

  • (String)


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

def vdc_name
  @vdc_name
end

#vdc_network_idString

Virtual Data Center Network Id to be used

Returns:

  • (String)


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

def vdc_network_id
  @vdc_network_id
end

#vdc_network_nameString

Virtual Data Center Network to be used

Returns:

  • (String)


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

def vdc_network_name
  @vdc_network_name
end

Instance Method Details

#validate(machine) ⇒ Object



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/vagrant-vcloud/config.rb', line 120

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?
  
  if !ip_dns.nil?
    errors << I18n.t("vagrant_vcloud.config.ip_dns") if !ip_dns.kind_of?(Array)
  end
  errors << I18n.t("vagrant_vcloud.config.catalog_name") if catalog_name.nil?
  errors << I18n.t("vagrant_vcloud.config.vdc_name") if vdc_name.nil?
  errors << I18n.t("vagrant_vcloud.config.vdc_network_name") if vdc_network_name.nil?

  { "vCloud Provider" => errors }
end