deltacloud-core 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +99 -141
- data/bin/deltacloudd +4 -1
- data/config.ru +13 -6
- data/config/drivers/aruba.yaml +8 -0
- data/config/drivers/fgcp.yaml +3 -2
- data/deltacloud-core.gemspec +13 -9
- data/lib/cimi/collections/cloud_entry_point.rb +1 -1
- data/lib/cimi/models.rb +1 -7
- data/lib/cimi/models/base.rb +1 -4
- data/lib/cimi/models/cloud_entry_point.rb +14 -0
- data/lib/cimi/models/machine.rb +4 -4
- data/lib/cimi/models/machine_admin.rb +1 -0
- data/lib/cimi/models/machine_configuration.rb +4 -4
- data/lib/cimi/models/schema.rb +17 -14
- data/lib/cimi/models/volume_image.rb +1 -1
- data/lib/cimi/server.rb +1 -1
- data/lib/deltacloud/api.rb +55 -3
- data/lib/deltacloud/collections/addresses.rb +1 -1
- data/lib/deltacloud/collections/buckets.rb +12 -10
- data/lib/deltacloud/collections/firewalls.rb +2 -1
- data/lib/deltacloud/collections/hardware_profiles.rb +1 -1
- data/lib/deltacloud/collections/images.rb +2 -2
- data/lib/deltacloud/collections/instance_states.rb +6 -3
- data/lib/deltacloud/collections/instances.rb +2 -1
- data/lib/deltacloud/collections/keys.rb +6 -2
- data/lib/deltacloud/collections/load_balancers.rb +8 -7
- data/lib/deltacloud/collections/metrics.rb +2 -1
- data/lib/deltacloud/collections/realms.rb +1 -1
- data/lib/deltacloud/collections/storage_snapshots.rb +2 -1
- data/lib/deltacloud/collections/storage_volumes.rb +2 -2
- data/lib/deltacloud/core_ext.rb +1 -7
- data/lib/deltacloud/core_ext/hash.rb +7 -5
- data/lib/deltacloud/core_ext/string.rb +1 -0
- data/lib/deltacloud/drivers/aruba/aruba_driver.rb +469 -0
- data/lib/deltacloud/drivers/base_driver.rb +12 -17
- data/lib/deltacloud/drivers/ec2/ec2_driver.rb +50 -22
- data/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb +1 -1
- data/lib/deltacloud/drivers/exceptions.rb +12 -2
- data/lib/deltacloud/drivers/features.rb +8 -0
- data/lib/deltacloud/drivers/fgcp/fgcp_client.rb +21 -6
- data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +169 -57
- data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +1 -1
- data/lib/deltacloud/drivers/mock/mock_client.rb +2 -0
- data/lib/deltacloud/drivers/mock/mock_driver.rb +101 -13
- data/lib/deltacloud/drivers/opennebula/occi_client.rb +12 -6
- data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +10 -18
- data/lib/deltacloud/drivers/openstack/openstack_driver.rb +46 -1
- data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +17 -17
- data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +4 -4
- data/lib/deltacloud/helpers.rb +4 -4
- data/lib/deltacloud/helpers/blob_stream_helper.rb +4 -6
- data/lib/deltacloud/helpers/deltacloud_helper.rb +17 -1
- data/lib/deltacloud/helpers/driver_helper.rb +7 -3
- data/lib/deltacloud/helpers/url_helper.rb +4 -4
- data/lib/deltacloud/models/address.rb +1 -1
- data/lib/deltacloud/models/base_model.rb +0 -14
- data/lib/deltacloud/models/bucket.rb +0 -10
- data/lib/deltacloud/models/hardware_profile.rb +5 -26
- data/lib/deltacloud/models/image.rb +0 -12
- data/lib/deltacloud/models/instance.rb +6 -22
- data/lib/deltacloud/models/key.rb +2 -2
- data/lib/deltacloud/models/metric.rb +1 -1
- data/lib/deltacloud/models/storage_snapshot.rb +4 -0
- data/lib/deltacloud/server.rb +8 -2
- data/lib/deltacloud_rack.rb +40 -10
- data/lib/ec2/query_parser.rb +9 -4
- data/lib/ec2/server.rb +1 -1
- data/lib/ec2/views/create_key_pair.haml +3 -0
- data/lib/ec2/views/delete_key_pair.haml +1 -0
- data/lib/ec2/views/describe_availability_zones.haml +6 -0
- data/lib/ec2/views/describe_images.haml +10 -0
- data/lib/ec2/views/describe_instance_set.haml +24 -0
- data/lib/ec2/views/describe_instances.haml +9 -0
- data/lib/ec2/views/describe_key_pairs.haml +5 -0
- data/lib/ec2/views/error.haml +4 -0
- data/lib/ec2/views/instance_action.haml +9 -0
- data/lib/ec2/views/reboot_instances.haml +1 -0
- data/lib/ec2/views/run_instances.haml +7 -0
- data/lib/ec2/views/start_instances.haml +1 -0
- data/lib/ec2/views/stop_instances.haml +1 -0
- data/lib/ec2/views/terminate_instances.haml +9 -0
- data/lib/sinatra.rb +0 -1
- data/lib/sinatra/rack_accept.rb +1 -1
- data/lib/sinatra/rack_driver_select.rb +2 -2
- data/lib/sinatra/rack_etag.rb +5 -1
- data/lib/sinatra/rack_logger.rb +127 -0
- data/lib/sinatra/rack_matrix_params.rb +1 -1
- data/tests/cimi/collections/cloud_entry_point_test.rb +46 -0
- data/tests/cimi/collections/common.rb +17 -0
- data/tests/cimi/collections/machine_images_test.rb +44 -0
- data/tests/cimi/collections/machines_test.rb +41 -0
- data/tests/cimi/spec/cimi/model/machine_admin_spec.rb +35 -0
- data/tests/cimi/spec/cimi/model/machine_configuration_spec.rb +31 -0
- data/tests/cimi/spec/cimi/model/machine_image_spec.rb +33 -0
- data/tests/cimi/spec/cimi/model/machine_spec.rb +32 -0
- data/tests/cimi/spec/cimi/model/machine_template_spec.rb +32 -0
- data/tests/cimi/spec/cimi/model/schema_spec.rb +245 -0
- data/tests/cimi/spec/cimi/model/volume_configuration_spec.rb +34 -0
- data/tests/cimi/spec/cimi/model/volume_image_spec.rb +33 -0
- data/tests/cimi/spec/cimi/model/volume_spec.rb +32 -0
- data/tests/cimi/spec/cimi/model/volume_template_spec.rb +32 -0
- data/tests/cimi/spec/spec_helper.rb +136 -0
- data/tests/deltacloud/base_collection_test.rb +30 -0
- data/tests/deltacloud/collections/buckets_collection_test.rb +65 -0
- data/tests/deltacloud/collections/drivers_collection_test.rb +37 -0
- data/tests/deltacloud/collections/hardware_profiles_collection_test.rb +53 -0
- data/tests/deltacloud/collections/images_collection_test.rb +59 -0
- data/tests/deltacloud/collections/instance_states_collection_test.rb +34 -0
- data/tests/deltacloud/collections/instances_collection_test.rb +63 -0
- data/tests/deltacloud/collections/keys_collection_test.rb +63 -0
- data/tests/deltacloud/collections_test.rb +35 -0
- data/tests/deltacloud/common.rb +14 -0
- data/tests/deltacloud/deltacloud_helper_test.rb +55 -0
- data/tests/deltacloud/drivers_test.rb +73 -0
- data/tests/deltacloud/rack_test.rb +51 -0
- data/tests/deltacloud/server_test.rb +149 -0
- data/tests/{api → deprecated/api}/common.rb +0 -0
- data/tests/{api → deprecated/api}/driver_test.rb +0 -0
- data/tests/deprecated/api/library_test.rb +6 -0
- data/tests/{cimi → deprecated/cimi}/features/step_definitions/common_steps.rb +0 -0
- data/tests/{cimi → deprecated/cimi}/features/step_definitions/machine_images_steps.rb +0 -0
- data/tests/{cimi → deprecated/cimi}/features/step_definitions/machines_steps.rb +0 -0
- data/tests/{cimi → deprecated/cimi}/features/step_definitions/volumes_steps.rb +0 -0
- data/tests/{cimi → deprecated/cimi}/features/support/env.rb +0 -0
- data/tests/{common.rb → deprecated/common.rb} +0 -0
- data/tests/{core_ext → deprecated/core_ext}/string.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/ec2/api_test.rb +0 -0
- data/tests/deprecated/drivers/ec2/common.rb +23 -0
- data/tests/{drivers → deprecated/drivers}/ec2/drivers_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/ec2/hardware_profiles_test.rb +0 -0
- data/tests/deprecated/drivers/ec2/images_test.rb +230 -0
- data/tests/{drivers → deprecated/drivers}/ec2/instances_test.rb +0 -0
- data/tests/deprecated/drivers/ec2/keys_test.rb +181 -0
- data/tests/deprecated/drivers/ec2/realms_test.rb +146 -0
- data/tests/{drivers → deprecated/drivers}/fgcp/api_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/fgcp/hardware_profiles_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/fgcp/realms_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/fgcp/setup.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/google/api_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/google/buckets_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/google/common.rb +2 -2
- data/tests/{drivers → deprecated/drivers}/mock/api_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/mock/buckets_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/mock/common.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/mock/drivers_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/mock/hardware_profiles_test.rb +0 -0
- data/tests/deprecated/drivers/mock/images_test.rb +197 -0
- data/tests/deprecated/drivers/mock/instances_test.rb +343 -0
- data/tests/deprecated/drivers/mock/keys_test.rb +161 -0
- data/tests/deprecated/drivers/mock/realms_test.rb +132 -0
- data/tests/deprecated/drivers/mock/storage_snapshots_test.rb +114 -0
- data/tests/deprecated/drivers/mock/storage_volumes_test.rb +122 -0
- data/tests/{drivers → deprecated/drivers}/openstack/api_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/openstack/common.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/openstack/hardware_profiles_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/openstack/images_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/openstack/instances_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/openstack/realms_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rackspace/api_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rackspace/buckets_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rackspace/common.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rackspace/hardware_profiles_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rackspace/images_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rackspace/instances_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rackspace/realms_test.rb +0 -0
- data/tests/{drivers → deprecated/drivers}/rhevm/api_test.rb +0 -0
- data/tests/deprecated/drivers/rhevm/common.rb +21 -0
- data/tests/{drivers → deprecated/drivers}/rhevm/hardware_profiles_test.rb +0 -0
- data/tests/deprecated/drivers/rhevm/images_test.rb +48 -0
- data/tests/{drivers → deprecated/drivers}/rhevm/instances_test.rb +0 -0
- data/tests/deprecated/drivers/rhevm/realms_test.rb +40 -0
- data/tests/{minitest_common.rb → deprecated/minitest_common.rb} +0 -0
- data/tests/{minitest_common_api_test.rb → deprecated/minitest_common_api_test.rb} +0 -0
- data/tests/{rabbit_test.rb → deprecated/rabbit_test.rb} +0 -0
- data/tests/drivers/base/base_driver_test.rb +124 -0
- data/tests/{api → drivers/base}/library_test.rb +2 -8
- data/tests/drivers/ec2/common.rb +23 -15
- data/tests/drivers/ec2/images_test.rb +30 -211
- data/tests/drivers/ec2/instance_test.rb +104 -0
- data/tests/drivers/ec2/keys_test.rb +32 -161
- data/tests/drivers/ec2/realms_test.rb +26 -128
- data/tests/drivers/ec2/storage_snapshots_test.rb +54 -0
- data/tests/drivers/mock/images_test.rb +37 -179
- data/tests/drivers/mock/instances_test.rb +103 -340
- data/tests/drivers/mock/keys_test.rb +30 -145
- data/tests/drivers/mock/realms_test.rb +23 -118
- data/tests/drivers/mock/storage_snapshots_test.rb +23 -100
- data/tests/drivers/mock/storage_volumes_test.rb +41 -104
- data/tests/drivers/models/address_test.rb +18 -0
- data/tests/drivers/models/base_test.rb +33 -0
- data/tests/drivers/models/blob_test.rb +18 -0
- data/tests/drivers/models/hardware_profile_test.rb +52 -0
- data/tests/drivers/models/instance_address_test.rb +24 -0
- data/tests/drivers/models/instance_profile_test.rb +21 -0
- data/tests/drivers/models/instance_test.rb +29 -0
- data/tests/drivers/models/keys_test.rb +25 -0
- data/tests/drivers/models/metrics_test.rb +20 -0
- data/tests/drivers/rhevm/common.rb +15 -15
- data/tests/drivers/rhevm/images_test.rb +61 -36
- data/tests/drivers/rhevm/instance_test.rb +104 -0
- data/tests/drivers/rhevm/provider_test.rb +48 -0
- data/tests/drivers/rhevm/realms_test.rb +40 -37
- data/tests/ec2/common.rb +24 -0
- data/tests/ec2/query_parser_test.rb +98 -0
- data/tests/ec2/server_test.rb +45 -0
- data/tests/helpers/core_ext/array_test.rb +24 -0
- data/tests/helpers/core_ext/hash_test.rb +42 -0
- data/tests/helpers/core_ext/integer_test.rb +19 -0
- data/tests/helpers/core_ext/string_test.rb +74 -0
- data/tests/test_helper.rb +66 -0
- data/views/api/show.html.haml +1 -2
- data/views/api/show.xml.haml +1 -2
- data/views/blobs/show.xml.haml +1 -2
- data/views/keys/new.html.haml +9 -2
- data/views/load_balancers/new.html.haml +35 -34
- data/views/metrics/index.html.haml +1 -1
- data/views/metrics/show.html.haml +2 -2
- data/views/metrics/show.xml.haml +6 -2
- data/views/storage_volumes/attach.html.haml +1 -1
- data/views/storage_volumes/show.html.haml +1 -1
- metadata +853 -544
- data/lib/sinatra/accept_media_types.rb +0 -154
data/Rakefile
CHANGED
@@ -20,88 +20,18 @@
|
|
20
20
|
require 'rake'
|
21
21
|
require 'rake/testtask'
|
22
22
|
require 'rubygems/package_task'
|
23
|
-
require 'rspec/core/rake_task'
|
24
23
|
|
25
24
|
begin
|
26
|
-
require
|
25
|
+
require "bundler"
|
26
|
+
Bundler.setup
|
27
27
|
rescue LoadError
|
28
|
+
$stderr.puts "Please install bundler with 'gem install bundler'"
|
29
|
+
exit(1)
|
28
30
|
end
|
29
31
|
|
30
32
|
$top_srcdir = File.dirname(__FILE__)
|
31
33
|
$:.unshift File.join($top_srcdir, 'lib')
|
32
34
|
|
33
|
-
begin
|
34
|
-
require 'cucumber'
|
35
|
-
require 'cucumber/rake/task'
|
36
|
-
namespace :cucumber do
|
37
|
-
%w(mock ec2 sbc).each do |driver|
|
38
|
-
namespace driver do
|
39
|
-
Cucumber::Rake::Task.new(:test) do |t|
|
40
|
-
t.cucumber_opts = "../tests/#{driver} --format pretty"
|
41
|
-
t.rcov = false
|
42
|
-
end
|
43
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
44
|
-
t.cucumber_opts = "../tests/#{driver} --format html --out ../tests/tmp/cucumber_#{driver}.html"
|
45
|
-
t.rcov = false
|
46
|
-
end
|
47
|
-
Cucumber::Rake::Task.new(:junit) do |t|
|
48
|
-
t.cucumber_opts = "../tests/#{driver} --format junit --out #{File.join(File.dirname(__FILE__), "tmp", "junit_#{driver}")}"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
Cucumber::Rake::Task.new(:cimi) do |t|
|
54
|
-
t.cucumber_opts = "tests/cimi/features --format pretty"
|
55
|
-
t.rcov = false
|
56
|
-
end
|
57
|
-
namespace :cimi do
|
58
|
-
Cucumber::Rake::Task.new(:machines) do |t|
|
59
|
-
t.cucumber_opts = "tests/cimi/features/machines.feature --format pretty"
|
60
|
-
t.rcov = false
|
61
|
-
end
|
62
|
-
Cucumber::Rake::Task.new(:machine_images) do |t|
|
63
|
-
t.cucumber_opts = "tests/cimi/features/machine_images.feature --format pretty"
|
64
|
-
t.rcov = false
|
65
|
-
end
|
66
|
-
Cucumber::Rake::Task.new(:volumes) do |t|
|
67
|
-
t.cucumber_opts = "tests/cimi/features/volumes.feature --format pretty"
|
68
|
-
t.rcov = false
|
69
|
-
end
|
70
|
-
end
|
71
|
-
rescue LoadError
|
72
|
-
end
|
73
|
-
|
74
|
-
|
75
|
-
desc "Call our Test::Unit suite"
|
76
|
-
task :test do
|
77
|
-
%w(mock rackspace rhevm openstack google fgcp).each do |driver|
|
78
|
-
Rake::Task["test:#{driver}"].reenable
|
79
|
-
Rake::Task["test:#{driver}"].invoke
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
desc "Call our Cucumber suite"
|
84
|
-
task :cucumber do
|
85
|
-
%w(mock ec2 sbc).each do |driver|
|
86
|
-
Rake::Task["cucumber:#{driver}:test"].reenable
|
87
|
-
Rake::Task["cucumber:#{driver}:test"].invoke
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
RSpec::Core::RakeTask.new do |t|
|
92
|
-
t.pattern = FileList['spec/**/*_spec.rb']
|
93
|
-
t.rspec_opts = [ "--format", "nested", "--color", "-r ./spec/spec_helper.rb"]
|
94
|
-
end
|
95
|
-
|
96
|
-
Dir['spec/**/*_spec.rb'].each do |file|
|
97
|
-
RSpec::Core::RakeTask.new("spec:#{File.basename(file).gsub(/_spec\.rb$/, '')}") do |t|
|
98
|
-
t.pattern = FileList[file]
|
99
|
-
t.rspec_opts = [ "--format", "nested", "--color", "-r ./spec/spec_helper.rb"]
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
|
104
|
-
|
105
35
|
begin
|
106
36
|
require 'yard'
|
107
37
|
YARD::Rake::YardocTask.new do |t|
|
@@ -116,25 +46,6 @@ Gem::PackageTask.new(spec) do |pkg|
|
|
116
46
|
pkg.need_tar = true
|
117
47
|
end
|
118
48
|
|
119
|
-
namespace :routes do
|
120
|
-
desc "List all REST routes for the Deltacloud API"
|
121
|
-
task :api do
|
122
|
-
require 'deltacloud/server.rb'
|
123
|
-
Sinatra::Rabbit::routes.each do |m, path|
|
124
|
-
puts sprintf("\033[1;30m%-8s\033[0m %s", m.to_s.upcase, path)
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
desc "List all REST routes for the CIMI API"
|
129
|
-
task :cimi do
|
130
|
-
require 'cimi/server.rb'
|
131
|
-
Sinatra::Rabbit::routes.each do |m, path|
|
132
|
-
puts sprintf("\033[1;30m%-8s\033[0m %s", m.to_s.upcase, path)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
|
138
49
|
namespace :mock do
|
139
50
|
namespace :fixtures do
|
140
51
|
desc "Setup Mock driver fixtures"
|
@@ -174,64 +85,111 @@ namespace :mock do
|
|
174
85
|
end
|
175
86
|
end
|
176
87
|
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
88
|
+
desc "List the routes defined by Rabbit"
|
89
|
+
task :routes do
|
90
|
+
load File.join(File.dirname(__FILE__), 'config.ru')
|
91
|
+
Deltacloud.collections.each do |c|
|
92
|
+
puts "\033[1;32;m#{c.name}\33[0m"
|
93
|
+
c.operations.each do |o|
|
94
|
+
puts "\033[1;37m%6s\033[0m :%-10s %-30s (%s)" % [
|
95
|
+
o.http_method.to_s.upcase,
|
96
|
+
o.operation_name,
|
97
|
+
o.full_path,
|
98
|
+
o.description[0..100]
|
99
|
+
]
|
100
|
+
end
|
101
|
+
unless c.collections.empty?
|
102
|
+
puts
|
103
|
+
c.collections.each do |s|
|
104
|
+
puts "\033[1;32;m#{s.name}\33[0m"
|
105
|
+
s.operations.each do |o|
|
106
|
+
puts "\033[1;37m%6s\033[0m :%-10s %-30s (%s)" % [
|
107
|
+
o.http_method.to_s.upcase,
|
108
|
+
o.operation_name,
|
109
|
+
o.full_path,
|
110
|
+
o.description[0..100]
|
111
|
+
]
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
puts
|
189
116
|
end
|
190
117
|
end
|
191
118
|
|
192
|
-
|
193
|
-
load File.join(File.dirname(__FILE__), 'config.ru')
|
119
|
+
DRIVERS = [:mock, :ec2, :rhevm]
|
194
120
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
121
|
+
desc 'Run all tests'
|
122
|
+
task :test do
|
123
|
+
|
124
|
+
Rake::Task["mock:fixtures:reset"].invoke
|
125
|
+
puts "\n[ \033[1;37;mrake test:base\33[0m ]\n"
|
126
|
+
Rake::Task["test:base"].invoke
|
127
|
+
Rake::Task["mock:fixtures:reset"].invoke
|
128
|
+
puts "\n[ \033[1;37;mrake test:ec2\33[0m ]\n"
|
129
|
+
Rake::Task["test:ec2"].invoke
|
130
|
+
puts "\n[ \033[1;37;mrake test:cimi:models\33[0m ]\n"
|
131
|
+
Rake::Task["test:cimi:models"].invoke
|
132
|
+
DRIVERS.each do |driver|
|
133
|
+
puts "\n[ \033[1;37;mrake drivers:#{driver}\33[0m ]\n"
|
134
|
+
Rake::Task["test:drivers:#{driver}"].invoke
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
namespace :test do
|
139
|
+
|
140
|
+
desc "Run all tests and generate code coverage report"
|
141
|
+
task :coverage do
|
142
|
+
ENV['COVERAGE'] = '1'
|
143
|
+
puts "[ \033[1;37;mCoverage report will be generated to server/coverage\33[0m ]\n\n"
|
144
|
+
Rake::Task["test"].invoke
|
145
|
+
end
|
146
|
+
|
147
|
+
namespace :drivers do
|
148
|
+
|
149
|
+
DRIVERS.each do |driver|
|
150
|
+
Rake::TestTask.new(driver) do |t|
|
151
|
+
t.ruby_opts << '-r./tests/test_helper.rb' # Load SimpleCov when COVERAGE=1 is set
|
152
|
+
unless RUBY_VERSION < '1.9.0'
|
153
|
+
t.loader = :testrb
|
219
154
|
end
|
155
|
+
t.test_files = FileList["tests/drivers/#{driver}/*test.rb"]
|
220
156
|
end
|
221
|
-
puts
|
222
157
|
end
|
158
|
+
|
223
159
|
end
|
224
160
|
|
225
|
-
|
161
|
+
Rake::TestTask.new(:base) do |t|
|
162
|
+
unless RUBY_VERSION < '1.9.0'
|
163
|
+
t.loader = :testrb
|
164
|
+
end
|
165
|
+
t.test_files = FileList[
|
166
|
+
'tests/helpers/core_ext/*test.rb', # Deltacloud extensions (core_ext) and other helpers
|
167
|
+
'tests/drivers/base/*test.rb', # Deltacloud drivers API tests
|
168
|
+
'tests/drivers/models/*test.rb', # Deltacloud models tests
|
169
|
+
'tests/deltacloud/*test.rb', # Deltacloud internal API tests
|
170
|
+
'tests/deltacloud/collections/*test.rb', # Deltacloud collections
|
171
|
+
]
|
172
|
+
end
|
226
173
|
|
227
|
-
|
174
|
+
Rake::TestTask.new(:ec2) do |t|
|
175
|
+
unless RUBY_VERSION < '1.9.0'
|
176
|
+
t.loader = :testrb
|
177
|
+
end
|
178
|
+
t.test_files = FileList[
|
179
|
+
'tests/ec2/*test.rb', # EC2 frontend internal API tests
|
180
|
+
]
|
181
|
+
end
|
228
182
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
t.
|
235
|
-
|
183
|
+
namespace :cimi do
|
184
|
+
Rake::TestTask.new(:models) do |t|
|
185
|
+
unless RUBY_VERSION < '1.9.0'
|
186
|
+
t.loader = :testrb
|
187
|
+
end
|
188
|
+
t.test_files = FileList[
|
189
|
+
'tests/cimi/spec/cimi/model/*spec.rb', # CIMI frontend serialization API tests
|
190
|
+
'tests/cimi/collections/*test.rb', # CIMI frontend API tests
|
191
|
+
]
|
192
|
+
end
|
236
193
|
end
|
194
|
+
|
237
195
|
end
|
data/bin/deltacloudd
CHANGED
@@ -75,6 +75,7 @@ BANNER
|
|
75
75
|
opts.on( '-g', '--group GROUP', 'Group to run daemon as. Use with -d (default: "nobody")') { |group| options[:group] = group }
|
76
76
|
opts.on( '-b', '--pid PID', 'File to store PID (default: tmp/pids/thin.pid)') { |pid| options[:pid] = pid }
|
77
77
|
opts.on( '-l', '--drivers', 'List available drivers') { |env| options[:drivers] = true }
|
78
|
+
opts.on( '-L', '--log FILE', 'Log requests to a file (default: disabled)') { |log| ENV['API_LOG'] = log }
|
78
79
|
opts.on( '-s', '--ssl', 'Enable SSL (default: disabled)') { |ssl| options[:ssl] = true }
|
79
80
|
opts.on( '-k', '--ssl-key KEY', 'SSL key file to use') { |key| options[:ssl_key] = key }
|
80
81
|
opts.on( '-C', '--ssl-cert CERT', 'SSL certificate file to use') { |cert| options[:ssl_cert] = cert }
|
@@ -192,7 +193,9 @@ unless have_thin
|
|
192
193
|
app = Rack::Builder.new {
|
193
194
|
use Rack::CommonLogger # apache-like logging
|
194
195
|
use Rack::Reloader if options[:env] == "development"
|
195
|
-
|
196
|
+
unless RUBY_PLATFORM == 'java'
|
197
|
+
set :root, $top_srcdir # Set Sinatra root since we can't chdir to ../
|
198
|
+
end
|
196
199
|
run inner_app
|
197
200
|
}.to_app
|
198
201
|
|
data/config.ru
CHANGED
@@ -24,20 +24,26 @@ load File.join(File.dirname(__FILE__), 'lib', 'deltacloud_rack.rb')
|
|
24
24
|
|
25
25
|
Deltacloud::configure do |server|
|
26
26
|
server.root_url '/api'
|
27
|
-
server.version '1.0.
|
27
|
+
server.version '1.0.2'
|
28
28
|
server.klass 'Deltacloud::API'
|
29
|
+
server.logger Rack::DeltacloudLogger.setup(ENV['API_LOG'], ENV['API_VERBOSE'])
|
30
|
+
server.default_driver ENV['API_DRIVER']
|
29
31
|
end
|
30
32
|
|
31
33
|
Deltacloud::configure(:cimi) do |server|
|
32
34
|
server.root_url '/cimi'
|
33
|
-
server.version '1.0.
|
35
|
+
server.version '1.0.2'
|
34
36
|
server.klass 'CIMI::API'
|
37
|
+
server.logger Rack::DeltacloudLogger.setup(ENV['API_LOG'], ENV['API_VERBOSE'])
|
38
|
+
server.default_driver ENV['API_DRIVER']
|
35
39
|
end
|
36
40
|
|
37
41
|
Deltacloud::configure(:ec2) do |server|
|
38
42
|
server.root_url '/'
|
39
43
|
server.version '2012-04-01'
|
40
44
|
server.klass 'Deltacloud::EC2::API'
|
45
|
+
server.logger Rack::DeltacloudLogger.setup(ENV['API_LOG'], ENV['API_VERBOSE'])
|
46
|
+
server.default_driver ENV['API_DRIVER']
|
41
47
|
end
|
42
48
|
|
43
49
|
routes = {}
|
@@ -51,21 +57,22 @@ routes = {}
|
|
51
57
|
if ENV['API_FRONTEND'].split(',').size > 1
|
52
58
|
|
53
59
|
ENV['API_FRONTEND'].split(',').each do |frontend|
|
54
|
-
Deltacloud.
|
60
|
+
Deltacloud[frontend.to_sym].require!
|
55
61
|
routes.merge!({
|
56
62
|
Deltacloud[frontend].root_url => Deltacloud[frontend].klass
|
57
63
|
})
|
58
64
|
end
|
59
65
|
|
60
66
|
else
|
61
|
-
Deltacloud
|
67
|
+
Deltacloud[ENV['API_FRONTEND'].to_sym].require!
|
68
|
+
Deltacloud[ENV['API_FRONTEND'].to_sym].default_frontend!
|
62
69
|
class IndexEntrypoint < Sinatra::Base
|
63
70
|
get "/" do
|
64
|
-
redirect Deltacloud
|
71
|
+
redirect Deltacloud.default_frontend.root_url, 301
|
65
72
|
end
|
66
73
|
end
|
67
74
|
routes['/'] = IndexEntrypoint.new
|
68
|
-
routes[Deltacloud
|
75
|
+
routes[Deltacloud.default_frontend.root_url] = Deltacloud.default_frontend.klass
|
69
76
|
end
|
70
77
|
|
71
78
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
---
|
2
|
+
:aruba:
|
3
|
+
:entrypoints:
|
4
|
+
compute:
|
5
|
+
dc1: https://api.dc1.computing.cloud.it/WsEndUser/v1.7/WsEndUser.svc?wsdl
|
6
|
+
dc2: https://api.dc2.computing.cloud.it/WsEndUser/v1.7/WsEndUser.svc?wsdl
|
7
|
+
dc3: https://api.dc3.computing.cloud.it/WsEndUser/v1.7/WsEndUser.svc?wsdl
|
8
|
+
:name: Aruba
|
data/config/drivers/fgcp.yaml
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
---
|
2
2
|
:fgcp:
|
3
3
|
:name: FGCP
|
4
|
-
:username:
|
4
|
+
:username: Folder name containing User Certificate
|
5
5
|
:password: Secret Key Password of User Certificate
|
6
6
|
:entrypoints:
|
7
7
|
default:
|
8
|
-
jp: https://api.oviss.jp.fujitsu.com/ovissapi/endpoint
|
8
|
+
jp-east: https://api.oviss.jp.fujitsu.com/ovissapi/endpoint
|
9
9
|
au: https://api.globalcloud.fujitsu.com.au/ovissapi/endpoint
|
10
10
|
sg: https://api.globalcloud.sg.fujitsu.com/ovissapi/endpoint
|
11
11
|
uk: https://api.globalcloud.uk.fujitsu.com/ovissapi/endpoint
|
12
12
|
us: https://api.globalcloud.us.fujitsu.com/ovissapi/endpoint
|
13
13
|
de: https://api.globalcloud.de.fujitsu.com/ovissapi/endpoint
|
14
|
+
jp-west: https://api.oviss2.jp.fujitsu.com/ovissapi/endpoint
|
data/deltacloud-core.gemspec
CHANGED
@@ -17,9 +17,8 @@
|
|
17
17
|
require 'rake'
|
18
18
|
|
19
19
|
Gem::Specification.new do |s|
|
20
|
-
|
21
20
|
s.author = 'The Apache Software Foundation'
|
22
|
-
s.homepage =
|
21
|
+
s.homepage = "http://www.deltacloud.org"
|
23
22
|
s.email = 'dev@deltacloud.apache.org'
|
24
23
|
s.name = 'deltacloud-core'
|
25
24
|
|
@@ -30,7 +29,7 @@ Gem::Specification.new do |s|
|
|
30
29
|
which implements the REST interface.
|
31
30
|
EOF
|
32
31
|
|
33
|
-
s.version = '1.0.
|
32
|
+
s.version = '1.0.2'
|
34
33
|
s.date = Time.now
|
35
34
|
s.summary = %q{Deltacloud REST API}
|
36
35
|
s.files = FileList[
|
@@ -48,6 +47,7 @@ Gem::Specification.new do |s|
|
|
48
47
|
'support/condor/config/**',
|
49
48
|
'lib/**/*.rb',
|
50
49
|
'lib/**/*.yml',
|
50
|
+
'lib/**/*.haml',
|
51
51
|
'tests/**/*.rb',
|
52
52
|
'views/**/*.haml',
|
53
53
|
'views/instance_states/*.erb',
|
@@ -62,21 +62,22 @@ Gem::Specification.new do |s|
|
|
62
62
|
|
63
63
|
s.bindir = 'bin'
|
64
64
|
s.executables = 'deltacloudd'
|
65
|
-
s.test_files= Dir.glob("tests
|
65
|
+
s.test_files= Dir.glob("tests/**/*_test.rb")
|
66
66
|
s.extra_rdoc_files = Dir["LICENSE", "DISCLAIMER", "NOTICE"]
|
67
67
|
s.required_ruby_version = '>= 1.8.1'
|
68
68
|
s.has_rdoc = 'false'
|
69
69
|
s.add_dependency('rake', '>= 0.8.7')
|
70
70
|
s.add_dependency('haml', '>= 2.2.17')
|
71
71
|
s.add_dependency('sinatra', '>= 0.9.4')
|
72
|
-
s.add_dependency('sinatra-rabbit', '>= 1.0.
|
72
|
+
s.add_dependency('sinatra-rabbit', '>= 1.0.10')
|
73
73
|
s.add_dependency('crack')
|
74
74
|
s.add_dependency('rack', '>= 1.0.0')
|
75
75
|
s.add_dependency('rack-accept')
|
76
76
|
s.add_dependency('json', '>= 1.1.9')
|
77
77
|
s.add_dependency('net-ssh', '>= 2.0.0')
|
78
|
-
s.add_dependency('thin', '>= 1.2.5')
|
78
|
+
s.add_dependency('thin', '>= 1.2.5') unless RUBY_PLATFORM == 'java'
|
79
79
|
s.add_dependency('nokogiri', '>= 1.4.3')
|
80
|
+
s.add_dependency('require_relative') if RUBY_VERSION < '1.9'
|
80
81
|
|
81
82
|
# dependencies for various cloud providers:
|
82
83
|
# RHEV-M
|
@@ -92,8 +93,8 @@ Gem::Specification.new do |s|
|
|
92
93
|
s.add_dependency('cloudfiles')
|
93
94
|
|
94
95
|
# Terremark Vcloud Express
|
95
|
-
s.add_dependency('fog')
|
96
|
-
s.add_dependency('excon')
|
96
|
+
s.add_dependency('fog', '>= 1.4.0')
|
97
|
+
s.add_dependency('excon', '>= 0.14.2' )
|
97
98
|
|
98
99
|
# Rhevm and Condor Cloud
|
99
100
|
s.add_dependency('rest-client')
|
@@ -102,6 +103,9 @@ Gem::Specification.new do |s|
|
|
102
103
|
s.add_dependency('uuidtools', '>= 2.1.1')
|
103
104
|
|
104
105
|
# Openstack Compute and Object-Storage
|
105
|
-
s.add_dependency('openstack')
|
106
|
+
s.add_dependency('openstack', '>= 1.0.1')
|
107
|
+
|
108
|
+
# Aruba Cloud
|
109
|
+
s.add_dependency('savon', '>= 1.0.0')
|
106
110
|
|
107
111
|
end
|