Class: Fog::Terremark::Vcloud::Real
Instance Method Summary
collapse
#parse
#add_internet_service, #add_node_service, #addresses, #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_network, #get_network_ips, #get_node_services, #get_organization, #get_organizations, #get_public_ip, #get_public_ips, #get_task, #get_tasks_list, #get_vapp, #get_vapp_template, #get_vdc, #instantiate_vapp_template, #networks, #power_off, #power_on, #power_reset, #power_shutdown, #servers, #tasks, #vdcs
#default_organization_id
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
Instance Method Details
#default_network_id ⇒ Object
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/fog/terremark/vcloud.rb', line 69
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/fog/terremark/vcloud.rb', line 84
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/fog/terremark/vcloud.rb', line 52
def default_vdc_id
if default_organization_id
@default_vdc_id ||= begin
vdcs = get_organization(default_organization_id).body['Links'].select {|link|
link['type'] == 'application/vnd.vmware.vcloud.vdc+xml'
}
if vdcs.length == 1
vdcs.first['href'].split('/').last.to_i
else
nil
end
end
else
nil
end
end
|