fog 0.3.16 → 0.3.17
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.rdoc +17 -12
- data/fog.gemspec +10 -5
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/models/storage/directory.rb +22 -0
- data/lib/fog/aws/models/storage/file.rb +15 -0
- data/lib/fog/aws/storage.rb +8 -0
- data/lib/fog/core/collection.rb +9 -8
- data/lib/fog/core/compute.rb +1 -1
- data/lib/fog/google/models/storage/directory.rb +23 -1
- data/lib/fog/google/models/storage/file.rb +16 -1
- data/lib/fog/google/parsers/storage/access_control_list.rb +16 -14
- data/lib/fog/local/models/storage/directory.rb +8 -0
- data/lib/fog/local/models/storage/file.rb +4 -0
- data/lib/fog/rackspace/cdn.rb +3 -3
- data/lib/fog/rackspace/models/storage/directory.rb +18 -0
- data/lib/fog/rackspace/models/storage/file.rb +7 -0
- data/lib/fog/rackspace/requests/cdn/{get_cdn_containers.rb → get_containers.rb} +3 -3
- data/lib/fog/rackspace/requests/cdn/{head_cdn_container.rb → head_container.rb} +3 -3
- data/lib/fog/rackspace/requests/cdn/{put_cdn_container.rb → put_container.rb} +3 -3
- data/lib/fog/rackspace/storage.rb +10 -0
- data/lib/fog/vcloud.rb +32 -153
- data/lib/fog/vcloud/collection.rb +18 -0
- data/lib/fog/vcloud/mock_data_classes.rb +701 -0
- data/lib/fog/vcloud/requests/get_network.rb +8 -8
- data/lib/fog/vcloud/requests/get_organization.rb +10 -10
- data/lib/fog/vcloud/requests/get_vdc.rb +18 -18
- data/lib/fog/vcloud/requests/get_versions.rb +3 -3
- data/lib/fog/vcloud/requests/login.rb +2 -2
- data/lib/fog/vcloud/terremark/ecloud.rb +65 -109
- data/lib/fog/vcloud/terremark/ecloud/models/catalog.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/firewall_acls.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/ip.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/ips.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/network.rb +3 -2
- data/lib/fog/vcloud/terremark/ecloud/models/networks.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/nodes.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/public_ips.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/server.rb +20 -8
- data/lib/fog/vcloud/terremark/ecloud/models/servers.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/tasks.rb +1 -0
- data/lib/fog/vcloud/terremark/ecloud/models/vdcs.rb +2 -0
- data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +4 -8
- data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +4 -7
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +18 -20
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb +6 -7
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_vapp.rb +40 -9
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_internet_service.rb +2 -10
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_node.rb +2 -6
- data/lib/fog/vcloud/terremark/ecloud/requests/delete_vapp.rb +13 -1
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb +6 -6
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb +6 -7
- data/lib/fog/vcloud/terremark/ecloud/requests/get_internet_services.rb +34 -33
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network.rb +23 -24
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_extensions.rb +10 -13
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ip.rb +15 -19
- data/lib/fog/vcloud/terremark/ecloud/requests/get_network_ips.rb +20 -22
- data/lib/fog/vcloud/terremark/ecloud/requests/get_node.rb +12 -15
- data/lib/fog/vcloud/terremark/ecloud/requests/get_nodes.rb +11 -12
- data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ip.rb +5 -4
- data/lib/fog/vcloud/terremark/ecloud/requests/get_public_ips.rb +9 -8
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vapp.rb +33 -17
- data/lib/fog/vcloud/terremark/ecloud/requests/get_vdc.rb +54 -53
- data/lib/fog/vcloud/terremark/ecloud/requests/instantiate_vapp_template.rb +13 -19
- data/lib/fog/vcloud/terremark/ecloud/requests/power_off.rb +9 -2
- data/lib/fog/vcloud/terremark/ecloud/requests/power_on.rb +2 -4
- data/spec/vcloud/bin_spec.rb +3 -6
- data/spec/vcloud/models/vdc_spec.rb +8 -8
- data/spec/vcloud/requests/get_network_spec.rb +8 -8
- data/spec/vcloud/requests/get_organization_spec.rb +9 -9
- data/spec/vcloud/requests/get_vdc_spec.rb +7 -7
- data/spec/vcloud/requests/get_versions_spec.rb +1 -1
- data/spec/vcloud/requests/login_spec.rb +2 -2
- data/spec/vcloud/spec_helper.rb +45 -30
- data/spec/vcloud/terremark/ecloud/models/internet_service_spec.rb +10 -14
- data/spec/vcloud/terremark/ecloud/models/ip_spec.rb +5 -8
- data/spec/vcloud/terremark/ecloud/models/ips_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/models/network_spec.rb +15 -16
- data/spec/vcloud/terremark/ecloud/models/node_spec.rb +7 -7
- data/spec/vcloud/terremark/ecloud/models/nodes_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/models/public_ip_spec.rb +4 -8
- data/spec/vcloud/terremark/ecloud/models/server_spec.rb +42 -0
- data/spec/vcloud/terremark/ecloud/models/vdc_spec.rb +7 -7
- data/spec/vcloud/terremark/ecloud/models/vdcs_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/add_internet_service_spec.rb +13 -18
- data/spec/vcloud/terremark/ecloud/requests/add_node_spec.rb +9 -5
- data/spec/vcloud/terremark/ecloud/requests/configure_internet_service_spec.rb +5 -7
- data/spec/vcloud/terremark/ecloud/requests/configure_node_spec.rb +22 -28
- data/spec/vcloud/terremark/ecloud/requests/configure_vapp_spec.rb +71 -0
- data/spec/vcloud/terremark/ecloud/requests/delete_internet_service_spec.rb +7 -9
- data/spec/vcloud/terremark/ecloud/requests/delete_node_spec.rb +3 -7
- data/spec/vcloud/terremark/ecloud/requests/delete_vapp_spec.rb +83 -0
- data/spec/vcloud/terremark/ecloud/requests/get_catalog_item_spec.rb +6 -5
- data/spec/vcloud/terremark/ecloud/requests/get_catalog_spec.rb +2 -2
- data/spec/vcloud/terremark/ecloud/requests/get_internet_services_spec.rb +31 -42
- data/spec/vcloud/terremark/ecloud/requests/get_network_ip_spec.rb +4 -7
- data/spec/vcloud/terremark/ecloud/requests/get_network_ips_spec.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/get_network_spec.rb +19 -11
- data/spec/vcloud/terremark/ecloud/requests/get_node_spec.rb +8 -8
- data/spec/vcloud/terremark/ecloud/requests/get_nodes_spec.rb +11 -11
- data/spec/vcloud/terremark/ecloud/requests/get_public_ip_spec.rb +4 -5
- data/spec/vcloud/terremark/ecloud/requests/get_public_ips_spec.rb +6 -6
- data/spec/vcloud/terremark/ecloud/requests/get_vapp_spec.rb +36 -19
- data/spec/vcloud/terremark/ecloud/requests/get_vdc_spec.rb +21 -18
- data/spec/vcloud/terremark/ecloud/requests/instantiate_vapp_template_spec.rb +27 -17
- data/spec/vcloud/terremark/ecloud/requests/power_off_spec.rb +34 -0
- data/spec/vcloud/terremark/ecloud/requests/power_on_spec.rb +3 -4
- data/spec/vcloud/vcloud_spec.rb +2 -2
- data/tests/helpers/storage/directory_tests.rb +8 -0
- data/tests/helpers/storage/file_tests.rb +4 -0
- metadata +11 -6
@@ -18,19 +18,19 @@ module Fog
|
|
18
18
|
network_uri = ensure_unparsed(network_uri)
|
19
19
|
type = "application/vnd.vmware.vcloud.network+xml"
|
20
20
|
response = Excon::Response.new
|
21
|
-
if network = mock_data
|
21
|
+
if network = mock_data.organizations.map { |org| org.vdcs.map { |vdc| vdc.networks } }.flatten.detect { |network| network.href == network_uri.to_s }
|
22
22
|
xml = Builder::XmlMarkup.new
|
23
23
|
mock_it 200,
|
24
|
-
xml.Network(xmlns.merge(:href => network
|
25
|
-
xml.Description(network
|
24
|
+
xml.Network(xmlns.merge(:href => network.href, :name => network.name, :type => type)) {
|
25
|
+
xml.Description(network.name)
|
26
26
|
xml.Configuration {
|
27
|
-
xml.Gateway(network
|
28
|
-
xml.Netmask(network
|
29
|
-
xml.Dns(network
|
27
|
+
xml.Gateway(network.gateway)
|
28
|
+
xml.Netmask(network.netmask)
|
29
|
+
xml.Dns(network.dns)
|
30
30
|
}
|
31
|
-
if network
|
31
|
+
if network.features
|
32
32
|
xml.Features {
|
33
|
-
if feature = network
|
33
|
+
if feature = network.features.detect { |feature| feature[:type] == :FenceMode }
|
34
34
|
xml.FenceMode(feature[:value])
|
35
35
|
end
|
36
36
|
}
|
@@ -11,29 +11,29 @@ module Fog
|
|
11
11
|
#
|
12
12
|
# Based off of:
|
13
13
|
# http://support.theenterprisecloud.com/kb/default.asp?id=540&Lang=1&SID=
|
14
|
-
#
|
14
|
+
#
|
15
15
|
# vCloud API Guide v0.9 - Page 26
|
16
16
|
#
|
17
17
|
organization_uri = ensure_unparsed(organization_uri)
|
18
|
-
if
|
18
|
+
if organization = mock_data.organization_from_href(organization_uri)
|
19
19
|
xml = Builder::XmlMarkup.new
|
20
20
|
|
21
21
|
mock_it 200,
|
22
|
-
xml.Org(xmlns.merge(:href =>
|
22
|
+
xml.Org(xmlns.merge(:href => organization.href, :name => organization.name)) {
|
23
23
|
|
24
|
-
|
24
|
+
organization.vdcs.each do |vdc|
|
25
25
|
xml.Link(:rel => "down",
|
26
|
-
:href => vdc
|
26
|
+
:href => vdc.href,
|
27
27
|
:type => "application/vnd.vmware.vcloud.vdc+xml",
|
28
|
-
:name => vdc
|
28
|
+
:name => vdc.name)
|
29
29
|
xml.Link(:rel => "down",
|
30
|
-
:href =>
|
30
|
+
:href => vdc.catalog.href,
|
31
31
|
:type => "application/vnd.vmware.vcloud.catalog+xml",
|
32
|
-
:name =>
|
32
|
+
:name => vdc.catalog.name)
|
33
33
|
xml.Link(:rel => "down",
|
34
|
-
:href =>
|
34
|
+
:href => vdc.task_list.href,
|
35
35
|
:type => "application/vnd.vmware.vcloud.tasksList+xml",
|
36
|
-
:name =>
|
36
|
+
:name => vdc.task_list.name)
|
37
37
|
end
|
38
38
|
},
|
39
39
|
{'Content-Type' => "application/vnd.vmware.vcloud.org+xml" }
|
@@ -12,59 +12,59 @@ module Fog
|
|
12
12
|
|
13
13
|
def get_vdc(vdc_uri)
|
14
14
|
vdc_uri = ensure_unparsed(vdc_uri)
|
15
|
-
if vdc = mock_data
|
15
|
+
if vdc = mock_data.organizations.map { |org| org.vdcs }.flatten.detect { |vdc| vdc.href == vdc_uri }
|
16
16
|
xml = Builder::XmlMarkup.new
|
17
17
|
mock_it 200,
|
18
|
-
xml.Vdc(xmlns.merge(:href => vdc
|
18
|
+
xml.Vdc(xmlns.merge(:href => vdc.href, :name => vdc.name)) {
|
19
19
|
xml.Link(:rel => "up",
|
20
|
-
:href =>
|
20
|
+
:href => mock_data.organizations.detect { |org| org.vdcs.detect { |_vdc| vdc.href == _vdc.href }.href == vdc.href }.href,
|
21
21
|
:type => "application/vnd.vmware.vcloud.org+xml")
|
22
22
|
xml.Link(:rel => "add",
|
23
|
-
:href => vdc
|
23
|
+
:href => vdc.href + "/action/uploadVAppTemplate",
|
24
24
|
:type => "application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml")
|
25
25
|
xml.Link(:rel => "add",
|
26
|
-
:href => vdc
|
26
|
+
:href => vdc.href + "/media",
|
27
27
|
:type => "application/vnd.vmware.vcloud.media+xml")
|
28
28
|
xml.Link(:rel => "add",
|
29
|
-
:href => vdc
|
29
|
+
:href => vdc.href + "/action/instantiateVAppTemplate",
|
30
30
|
:type => "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml")
|
31
31
|
xml.Link(:rel => "add",
|
32
32
|
:type => "application/vnd.vmware.vcloud.cloneVAppParams+xml",
|
33
|
-
:href => vdc
|
33
|
+
:href => vdc.href + "/action/cloneVApp")
|
34
34
|
xml.Link(:rel => "add",
|
35
35
|
:type => "application/vnd.vmware.vcloud.captureVAppParams+xml",
|
36
|
-
:href => vdc
|
36
|
+
:href => vdc.href + "/action/captureVApp")
|
37
37
|
xml.Link(:rel => "add",
|
38
38
|
:type => "application/vnd.vmware.vcloud.composeVAppParams+xml",
|
39
|
-
:href => vdc
|
39
|
+
:href => vdc.href + "/action/composeVApp")
|
40
40
|
xml.AllocationModel("AllocationPool")
|
41
41
|
xml.Description(vdc[:name] + " VDC")
|
42
42
|
xml.ResourceEntities {
|
43
|
-
|
43
|
+
mock_data.organizations.first.vdcs.first.virtual_machines.each do |resource|
|
44
44
|
xml.ResourceEntity(resource)
|
45
45
|
end
|
46
46
|
}
|
47
47
|
xml.AvailableNetworks {
|
48
|
-
vdc
|
49
|
-
xml.Network( :name => network
|
48
|
+
vdc.networks.each do |network|
|
49
|
+
xml.Network( :name => network.name, :href => network.href, :type => "application/vnd.vmware.vcloud.network+xml" )
|
50
50
|
end
|
51
51
|
}
|
52
52
|
xml.ComputeCapacity{
|
53
53
|
xml.Cpu {
|
54
54
|
xml.Units("Mhz")
|
55
|
-
xml.Allocated(vdc
|
56
|
-
xml.Limit(vdc
|
55
|
+
xml.Allocated(vdc.cpu_allocated)
|
56
|
+
xml.Limit(vdc.cpu_allocated)
|
57
57
|
}
|
58
58
|
xml.Memory {
|
59
59
|
xml.Units("MB")
|
60
|
-
xml.Allocated(vdc
|
61
|
-
xml.Limit(vdc
|
60
|
+
xml.Allocated(vdc.memory_allocated)
|
61
|
+
xml.Limit(vdc.memory_allocated)
|
62
62
|
}
|
63
63
|
}
|
64
64
|
xml.StorageCapacity{
|
65
65
|
xml.Units("MB")
|
66
|
-
xml.Allocated(vdc
|
67
|
-
xml.Limit(vdc
|
66
|
+
xml.Allocated(vdc.storage_allocated)
|
67
|
+
xml.Limit(vdc.storage_allocated)
|
68
68
|
}
|
69
69
|
xml.VmQuota(0)
|
70
70
|
xml.NicQuota(0)
|
@@ -19,10 +19,10 @@ module Fog
|
|
19
19
|
mock_it 200,
|
20
20
|
xml.SupportedVersions( xmlns.merge("xmlns" => "http://www.vmware.com/vcloud/versions")) {
|
21
21
|
|
22
|
-
mock_data
|
22
|
+
mock_data.versions.select {|version| version.supported }.each do |version|
|
23
23
|
xml.VersionInfo {
|
24
|
-
xml.Version(version
|
25
|
-
xml.LoginUrl(version
|
24
|
+
xml.Version(version.version)
|
25
|
+
xml.LoginUrl(version.login_url)
|
26
26
|
}
|
27
27
|
end
|
28
28
|
}
|
@@ -31,8 +31,8 @@ module Fog
|
|
31
31
|
|
32
32
|
mock_it 200,
|
33
33
|
xml.OrgList(xmlns) {
|
34
|
-
mock_data
|
35
|
-
xml.Org( :type => "application/vnd.vmware.vcloud.org+xml", :href =>
|
34
|
+
mock_data.organizations.each do |organization|
|
35
|
+
xml.Org( :type => "application/vnd.vmware.vcloud.org+xml", :href => organization.href, :name => organization.name )
|
36
36
|
end
|
37
37
|
},
|
38
38
|
{ 'Set-Cookie' => 'vcloud-token=fc020a05-21d7-4f33-9b2a-25d8cd05a44e; path=/',
|
@@ -76,125 +76,81 @@ module Fog
|
|
76
76
|
Fog::Vcloud::Mock.data_reset
|
77
77
|
end
|
78
78
|
|
79
|
-
def self.extension_url
|
80
|
-
self.base_url + "/extensions"
|
81
|
-
end
|
82
|
-
|
83
79
|
def self.data( base_url = self.base_url )
|
84
|
-
@mock_data ||=
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
:
|
112
|
-
|
113
|
-
{ :id => "73", :href => extension_url + "/internetService/73", :port => "80", :protocol => 'HTTP', :enabled => "true",
|
114
|
-
:timeout => "2", :name => 'Web Site', :description => 'Web Servers', :redirect_url => 'http://fakey.com',
|
115
|
-
:nodes => [] },
|
116
|
-
{ :id => "74", :href => extension_url + "/internetService/74", :port => "7000", :protocol => 'HTTP', :enabled => "true",
|
117
|
-
:timeout => "2", :name => 'An SSH Map', :description => 'SSH 2', :redirect_url => '',
|
118
|
-
:nodes => [] }
|
119
|
-
]
|
120
|
-
},
|
121
|
-
{ :id => "53",
|
122
|
-
:href => extension_url + "/publicIp/53",
|
123
|
-
:name => "99.1.9.7",
|
124
|
-
:services => []
|
125
|
-
}
|
126
|
-
]
|
127
|
-
|
128
|
-
vcloud_data[:organizations][0][:vdcs][1][:public_ips] =
|
129
|
-
[
|
130
|
-
{ :id => "54",
|
131
|
-
:href => extension_url + "/publicIp/54",
|
132
|
-
:name => "99.99.99.99",
|
133
|
-
:services => []
|
134
|
-
}
|
135
|
-
]
|
136
|
-
|
137
|
-
vcloud_data[:organizations].each do |organization|
|
138
|
-
organization[:info][:extension_href] = extension_url
|
139
|
-
organization[:vdcs].each do | vdc|
|
140
|
-
vdc[:extension_href] = "#{base_url}/extensions/vdc/#{vdc[:id]}"
|
141
|
-
vdc[:networks].each do |network|
|
142
|
-
network[:extension_href] = "#{extension_url}/network/#{network[:id]}"
|
143
|
-
network[:rnat] = vdc[:public_ips].first[:name]
|
80
|
+
@mock_data ||= Fog::Vcloud::Mock.data(base_url).tap do |vcloud_mock_data|
|
81
|
+
vcloud_mock_data.versions.clear
|
82
|
+
vcloud_mock_data.versions << MockVersion.new(:version => "v0.8b-ext2.3")
|
83
|
+
|
84
|
+
vcloud_mock_data.organizations.detect {|o| o.name == "Boom Inc." }.tap do |mock_organization|
|
85
|
+
mock_organization.vdcs.detect {|v| v.name == "Boomstick" }.tap do |mock_vdc|
|
86
|
+
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.1.2.3").tap do |mock_public_ip|
|
87
|
+
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
88
|
+
:protocol => "HTTP",
|
89
|
+
:port => 80,
|
90
|
+
:name => "Web Site",
|
91
|
+
:description => "Web Servers",
|
92
|
+
:redirect_url => "http://fakey.com"
|
93
|
+
}, mock_public_ip.internet_service_collection
|
94
|
+
).tap do |mock_public_ip_service|
|
95
|
+
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({:ip_address => "1.2.3.5", :name => "Test Node 1", :description => "web 1"}, mock_public_ip_service.node_collection)
|
96
|
+
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({:ip_address => "1.2.3.6", :name => "Test Node 2", :description => "web 2"}, mock_public_ip_service.node_collection)
|
97
|
+
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({:ip_address => "1.2.3.7", :name => "Test Node 3", :description => "web 3"}, mock_public_ip_service.node_collection)
|
98
|
+
end
|
99
|
+
|
100
|
+
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
101
|
+
:protocol => "TCP",
|
102
|
+
:port => 7000,
|
103
|
+
:name => "An SSH Map",
|
104
|
+
:description => "SSH 1"
|
105
|
+
}, mock_public_ip.internet_service_collection
|
106
|
+
).tap do |mock_public_ip_service|
|
107
|
+
mock_public_ip_service.node_collection.items << MockPublicIpInternetServiceNode.new({ :ip_address => "1.2.3.5", :port => 22, :name => "SSH", :description => "web ssh" }, mock_public_ip_service.node_collection)
|
108
|
+
end
|
144
109
|
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
vcloud_data
|
149
|
-
end
|
150
|
-
end
|
151
|
-
|
152
|
-
def self.public_ip_href(ip)
|
153
|
-
"#{base_url}/extensions/publicIp/#{ip[:id]}"
|
154
|
-
end
|
155
|
-
|
156
|
-
def self.internet_service_href(internet_service)
|
157
|
-
"#{base_url}/extensions/internetService/#{internet_service[:id]}"
|
158
|
-
end
|
159
|
-
|
160
|
-
def self.vapp_href(options)
|
161
|
-
"#{base_url}/vapp/#{options[:id]}"
|
162
|
-
end
|
163
|
-
|
164
|
-
def self.vapp_template_href(options)
|
165
|
-
"#{base_url}/vappTemplate/#{options[:id]}"
|
166
|
-
end
|
167
110
|
|
168
|
-
|
169
|
-
|
170
|
-
|
111
|
+
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.1.2.4").tap do |mock_public_ip|
|
112
|
+
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
113
|
+
:protocol => "HTTP",
|
114
|
+
:port => 80,
|
115
|
+
:name => "Web Site",
|
116
|
+
:description => "Web Servers",
|
117
|
+
:redirect_url => "http://fakey.com"
|
118
|
+
}, mock_public_ip.internet_service_collection
|
119
|
+
)
|
120
|
+
|
121
|
+
mock_public_ip.internet_service_collection.items << MockPublicIpInternetService.new({
|
122
|
+
:protocol => "TCP",
|
123
|
+
:port => 7000,
|
124
|
+
:name => "An SSH Map",
|
125
|
+
:description => "SSH 2"
|
126
|
+
}, mock_public_ip.internet_service_collection
|
127
|
+
)
|
128
|
+
end
|
171
129
|
|
172
|
-
|
173
|
-
|
174
|
-
end
|
130
|
+
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.1.9.7")
|
131
|
+
end
|
175
132
|
|
176
|
-
|
177
|
-
|
178
|
-
|
133
|
+
mock_organization.vdcs.detect {|v| v.name == "Rock-n-Roll" }.tap do |mock_vdc|
|
134
|
+
mock_vdc.public_ip_collection.items << MockPublicIp.new(:name => "99.99.99.99")
|
135
|
+
end
|
136
|
+
end
|
179
137
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
138
|
+
vcloud_mock_data.organizations.each do |organization|
|
139
|
+
organization.vdcs.each do |vdc|
|
140
|
+
vdc.networks.each do |network|
|
141
|
+
network[:rnat] = vdc.public_ip_collection.items.first.name
|
142
|
+
end
|
143
|
+
vdc.virtual_machines.each do |virtual_machine|
|
144
|
+
virtual_machine.disks << MockVirtualMachineDisk.new(:size => 25 * 1024)
|
145
|
+
virtual_machine.disks << MockVirtualMachineDisk.new(:size => 50 * 1024)
|
146
|
+
end
|
147
|
+
end
|
186
148
|
end
|
187
|
-
else
|
188
|
-
[nil, nil]
|
189
149
|
end
|
190
150
|
end
|
191
151
|
|
192
|
-
def
|
193
|
-
|
194
|
-
end
|
195
|
-
|
196
|
-
def mock_service_from_node_url(uri)
|
197
|
-
mock_data[:organizations].map { |org| org[:vdcs] }.flatten.map { |vdc| vdc[:public_ips] }.flatten.map { |pip| pip[:services] }.flatten.map { |service| service }.detect {|service| service[:nodes].map { |node| node[:href] }.include?(uri) }
|
152
|
+
def ecloud_xmlns
|
153
|
+
{ :xmlns => "urn:tmrk:eCloudExtensions-2.3", :"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance" }
|
198
154
|
end
|
199
155
|
|
200
156
|
def mock_data
|
@@ -12,6 +12,7 @@ module Fog
|
|
12
12
|
attribute :href, :aliases => :Href
|
13
13
|
|
14
14
|
def all
|
15
|
+
check_href! :message => "the Firewall ACL href for the network you want to enumerate"
|
15
16
|
if data = connection.get_firewall_acls(href).body[:FirewallAcl]
|
16
17
|
data = [ data ] if data.is_a?(Hash)
|
17
18
|
load(data)
|
@@ -6,10 +6,10 @@ module Fog
|
|
6
6
|
|
7
7
|
identity :href
|
8
8
|
|
9
|
-
ignore_attributes :xmlns, :xmlns_xsi, :xmlns_xsd, :xmlns_i, :Configuration
|
9
|
+
ignore_attributes :xmlns, :xmlns_xsi, :xmlns_xsd, :xmlns_i, :Configuration, :Id
|
10
10
|
|
11
11
|
attribute :name, :aliases => :Name
|
12
|
-
attribute :id, :aliases => :Id
|
12
|
+
#attribute :id, :aliases => :Id
|
13
13
|
attribute :features, :aliases => :Features, :type => :array
|
14
14
|
attribute :links, :aliases => :Link, :type => :array
|
15
15
|
attribute :type
|
@@ -41,6 +41,7 @@ module Fog
|
|
41
41
|
def reload
|
42
42
|
super
|
43
43
|
merge_attributes(extension_data.body)
|
44
|
+
self
|
44
45
|
end
|
45
46
|
|
46
47
|
private
|