Class: Fog::Terremark::Vcloud::Real
Instance Method Summary
collapse
#add_internet_service, #add_node_service, #configure_vapp, #create_internet_service, #delete_internet_service, #delete_node_service, #delete_public_ip, #delete_vapp, #deploy_vapp, #get_catalog, #get_catalog_item, #get_internet_services, #get_keys_list, #get_network, #get_network_ips, #get_node_services, #get_organization, #get_public_ip, #get_public_ips, #get_task, #get_tasks_list, #get_vapp, #get_vapp_template, #get_vdc, #instantiate_vapp_template, #organizations, #power_off, #power_on, #power_reset, #power_shutdown
#default_organization_id
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
5
6
7
8
9
10
11
12
13
14
15
|
# File 'lib/fog/terremark/vcloud/real.rb', line 5
def initialize(options={})
@terremark_password = options[:terremark_vcloud_password]
@terremark_username = options[:terremark_vcloud_username]
@connection_options = options[:connection_options] || {}
@host = options[:host] || Fog::Terremark::Vcloud::HOST
@path = options[:path] || Fog::Terremark::Vcloud::PATH
@persistent = options[:persistent] || false
@port = options[:port] || Fog::Terremark::Vcloud::PORT
@scheme = options[:scheme] || Fog::Terremark::Vcloud::SCHEME
@connection = Fog::XML::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options)
end
|
Instance Method Details
#default_network_id ⇒ Object
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/fog/terremark/vcloud/real.rb', line 34
def default_network_id
if default_vdc_id
@default_network_id ||= begin
networks = get_vdc(default_vdc_id).body["AvailableNetworks"]
if networks.length == 1
networks.first["href"].split("/").last.to_i
else
nil
end
end
else
nil
end
end
|
#default_public_ip_id ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/fog/terremark/vcloud/real.rb', line 49
def default_public_ip_id
if default_vdc_id
@default_public_ip_id ||= begin
ips = get_public_ips(default_vdc_id).body["PublicIpAddresses"]
if ips.length == 1
ips.first["href"].split("/").last.to_i
else
nil
end
end
else
nil
end
end
|
#default_vdc_id ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/fog/terremark/vcloud/real.rb', line 17
def default_vdc_id
if default_organization_id
@default_vdc_id ||= begin
vdcs = get_organization(default_organization_id).body["Links"].select do |link|
link["type"] == "application/vnd.vmware.vcloud.vdc+xml"
end
if vdcs.length == 1
vdcs.first["href"].split("/").last.to_i
else
nil
end
end
else
nil
end
end
|