deltacloud-core 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. data/Rakefile +40 -28
  2. data/bin/deltacloud-db-upgrade +24 -0
  3. data/bin/deltacloudd +20 -9
  4. data/config.ru +12 -53
  5. data/db/migrations/1_add_realm_to_machine_template.rb +23 -0
  6. data/deltacloud-core.gemspec +11 -5
  7. data/lib/cimi/collections.rb +4 -31
  8. data/lib/cimi/collections/address_templates.rb +2 -5
  9. data/lib/cimi/collections/addresses.rb +2 -5
  10. data/lib/cimi/collections/base.rb +18 -6
  11. data/lib/cimi/collections/credentials.rb +2 -5
  12. data/lib/cimi/collections/machine_images.rb +2 -1
  13. data/lib/cimi/collections/machine_templates.rb +2 -5
  14. data/lib/cimi/collections/machines.rb +6 -9
  15. data/lib/cimi/collections/network_ports.rb +3 -3
  16. data/lib/cimi/collections/networks.rb +5 -8
  17. data/lib/cimi/collections/system_templates.rb +72 -0
  18. data/lib/cimi/collections/systems.rb +194 -0
  19. data/lib/cimi/collections/volume_configurations.rb +1 -1
  20. data/lib/cimi/collections/volume_images.rb +2 -1
  21. data/lib/cimi/collections/volume_templates.rb +3 -2
  22. data/lib/cimi/collections/volumes.rb +2 -2
  23. data/lib/cimi/dependencies.rb +0 -2
  24. data/lib/cimi/helpers/cimi_helper.rb +12 -57
  25. data/lib/cimi/helpers/database_helper.rb +0 -4
  26. data/lib/cimi/models.rb +25 -14
  27. data/lib/cimi/models/address.rb +4 -31
  28. data/lib/cimi/models/address_create.rb +51 -0
  29. data/lib/cimi/models/address_template.rb +8 -52
  30. data/lib/cimi/models/address_template_create.rb +44 -0
  31. data/lib/cimi/models/base.rb +44 -6
  32. data/lib/cimi/models/cloud_entry_point.rb +1 -1
  33. data/lib/cimi/models/credential.rb +1 -1
  34. data/lib/cimi/models/credential_create.rb +46 -0
  35. data/lib/cimi/models/credential_template.rb +24 -0
  36. data/lib/cimi/models/machine.rb +1 -71
  37. data/lib/cimi/models/machine_configuration.rb +3 -3
  38. data/lib/cimi/models/machine_create.rb +49 -0
  39. data/lib/cimi/models/machine_image.rb +2 -25
  40. data/lib/cimi/models/machine_image_create.rb +41 -0
  41. data/lib/cimi/models/machine_template.rb +14 -34
  42. data/lib/cimi/models/machine_template_create.rb +33 -0
  43. data/lib/cimi/models/network.rb +0 -38
  44. data/lib/cimi/models/network_create.rb +43 -0
  45. data/lib/cimi/models/network_port.rb +17 -17
  46. data/lib/cimi/models/network_template.rb +2 -3
  47. data/lib/cimi/models/resource.rb +22 -3
  48. data/lib/cimi/models/schema.rb +94 -8
  49. data/lib/cimi/models/system.rb +67 -0
  50. data/lib/cimi/models/system_template.rb +63 -0
  51. data/lib/cimi/models/volume.rb +2 -42
  52. data/lib/cimi/models/volume_configuration.rb +4 -4
  53. data/lib/cimi/models/volume_create.rb +58 -0
  54. data/lib/cimi/models/volume_image.rb +8 -17
  55. data/lib/cimi/models/volume_image_create.rb +47 -0
  56. data/lib/cimi/models/volume_template.rb +6 -19
  57. data/lib/cimi/models/volume_template_create.rb +33 -0
  58. data/lib/db.rb +14 -22
  59. data/lib/db/volume_template.rb +1 -1
  60. data/lib/deltacloud/api.rb +6 -5
  61. data/lib/deltacloud/collections.rb +4 -27
  62. data/lib/deltacloud/collections/base.rb +4 -0
  63. data/lib/deltacloud/collections/images.rb +1 -1
  64. data/lib/deltacloud/collections/instances.rb +2 -2
  65. data/lib/deltacloud/core_ext/array.rb +1 -0
  66. data/lib/deltacloud/core_ext/integer.rb +13 -9
  67. data/lib/deltacloud/core_ext/string.rb +45 -28
  68. data/lib/deltacloud/drivers/arubacloud/arubacloud_driver.rb +0 -9
  69. data/lib/deltacloud/drivers/base_driver.rb +45 -16
  70. data/lib/deltacloud/drivers/digitalocean/digitalocean_driver.rb +78 -8
  71. data/lib/deltacloud/drivers/ec2/ec2_driver.rb +13 -9
  72. data/lib/deltacloud/drivers/fgcp/fgcp_client.rb +44 -0
  73. data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +164 -90
  74. data/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb +74 -0
  75. data/lib/deltacloud/drivers/mock/data/instances/inst0.yml +3 -3
  76. data/lib/deltacloud/drivers/mock/data/instances/inst1.yml +3 -3
  77. data/lib/deltacloud/drivers/mock/data/instances/inst2.yml +3 -3
  78. data/lib/deltacloud/drivers/mock/mock_client.rb +17 -1
  79. data/lib/deltacloud/drivers/mock/mock_driver.rb +161 -204
  80. data/lib/deltacloud/drivers/mock/mock_driver_cimi_methods.rb +80 -0
  81. data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +6 -1
  82. data/lib/deltacloud/drivers/openstack/openstack_driver.rb +61 -68
  83. data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +0 -9
  84. data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +11 -6
  85. data/lib/deltacloud/drivers/terremark/terremark_driver.rb +0 -8
  86. data/lib/deltacloud/drivers/vsphere/vsphere_client.rb +11 -4
  87. data/lib/deltacloud/drivers/vsphere/vsphere_driver.rb +0 -12
  88. data/lib/deltacloud/helpers/collection_helper.rb +106 -0
  89. data/lib/deltacloud/helpers/deltacloud_helper.rb +12 -8
  90. data/lib/deltacloud/models/address.rb +19 -17
  91. data/lib/deltacloud/models/base_model.rb +29 -26
  92. data/lib/deltacloud/models/blob.rb +22 -20
  93. data/lib/deltacloud/models/bucket.rb +21 -16
  94. data/lib/deltacloud/models/firewall.rb +18 -16
  95. data/lib/deltacloud/models/firewall_rule.rb +22 -20
  96. data/lib/deltacloud/models/image.rb +29 -28
  97. data/lib/deltacloud/models/instance.rb +92 -94
  98. data/lib/deltacloud/models/instance_address.rb +42 -40
  99. data/lib/deltacloud/models/instance_profile.rb +28 -26
  100. data/lib/deltacloud/models/key.rb +47 -45
  101. data/lib/deltacloud/models/load_balancer.rb +32 -31
  102. data/lib/deltacloud/models/metric.rb +76 -29
  103. data/lib/deltacloud/models/provider.rb +15 -13
  104. data/lib/deltacloud/models/realm.rb +15 -21
  105. data/lib/deltacloud/models/storage_snapshot.rb +23 -19
  106. data/lib/deltacloud/models/storage_volume.rb +35 -34
  107. data/lib/deltacloud/version.rb +1 -1
  108. data/lib/deltacloud_rack.rb +22 -0
  109. data/lib/initialize.rb +28 -0
  110. data/lib/initializers/database_initialize.rb +76 -0
  111. data/lib/initializers/frontend_initialize.rb +42 -0
  112. data/lib/initializers/mock_initialize.rb +33 -0
  113. data/lib/sinatra/rack_logger.rb +35 -24
  114. data/tests/cimi/collections/cloud_entry_point_test.rb +1 -7
  115. data/tests/cimi/collections/machine_images_test.rb +2 -2
  116. data/tests/cimi/collections/machine_templates_test.rb +75 -0
  117. data/tests/cimi/collections/machines_test.rb +2 -2
  118. data/tests/cimi/collections/system_templates_test.rb +41 -0
  119. data/tests/cimi/collections/systems_test.rb +50 -0
  120. data/tests/cimi/db/database_helper_test.rb +17 -25
  121. data/tests/cimi/db/db_helper.rb +1 -12
  122. data/tests/cimi/db/entity_test.rb +7 -8
  123. data/tests/cimi/model/machine_create_spec.rb +44 -0
  124. data/tests/cimi/model/machine_template_spec.rb +29 -0
  125. data/tests/cimi/model/resource_spec.rb +40 -0
  126. data/tests/cimi/model/schema_spec.rb +37 -0
  127. data/tests/cimi/spec_helper.rb +3 -0
  128. data/tests/deltacloud/collections/buckets_collection_test.rb +1 -1
  129. data/tests/deltacloud/collections/drivers_collection_test.rb +2 -2
  130. data/tests/deltacloud/collections/hardware_profiles_collection_test.rb +2 -2
  131. data/tests/deltacloud/collections/images_collection_test.rb +2 -2
  132. data/tests/deltacloud/collections/instance_states_collection_test.rb +1 -1
  133. data/tests/deltacloud/collections/instances_collection_test.rb +6 -3
  134. data/tests/deltacloud/collections/keys_collection_test.rb +2 -2
  135. data/tests/deltacloud/collections/realms_collection_test.rb +2 -2
  136. data/tests/deltacloud/collections/storage_snapshots_collection_test.rb +2 -2
  137. data/tests/deltacloud/collections/storage_volumes_collection_test.rb +2 -2
  138. data/tests/deltacloud/collections_test.rb +5 -5
  139. data/tests/deltacloud/common.rb +2 -13
  140. data/tests/deltacloud/launcher_test.rb +3 -3
  141. data/tests/deltacloud/rack_test.rb +2 -2
  142. data/tests/deltacloud/server_test.rb +1 -1
  143. data/tests/drivers/base/base_driver_test.rb +5 -5
  144. data/tests/drivers/base/common.rb +2 -12
  145. data/tests/drivers/ec2/buckets_test.rb +1 -1
  146. data/tests/drivers/ec2/images_test.rb +2 -2
  147. data/tests/drivers/ec2/instance_test.rb +6 -6
  148. data/tests/drivers/ec2/keys_test.rb +3 -3
  149. data/tests/drivers/ec2/realms_test.rb +2 -2
  150. data/tests/drivers/ec2/storage_snapshots_test.rb +1 -1
  151. data/tests/drivers/fgcp/common.rb +32 -0
  152. data/tests/drivers/fgcp/firewall_test.rb +70 -0
  153. data/tests/drivers/fgcp/hardware_profiles_test.rb +61 -0
  154. data/tests/drivers/fgcp/images_test.rb +46 -0
  155. data/tests/drivers/fgcp/provider_test.rb +27 -0
  156. data/tests/drivers/fgcp/realms_test.rb +53 -0
  157. data/tests/drivers/fgcp/storage_volumes_test.rb +58 -0
  158. data/tests/drivers/gogrid/images_test.rb +2 -2
  159. data/tests/drivers/gogrid/instances_test.rb +2 -2
  160. data/tests/drivers/gogrid/realms_test.rb +2 -2
  161. data/tests/drivers/mock/images_test.rb +4 -4
  162. data/tests/drivers/mock/instances_test.rb +9 -9
  163. data/tests/drivers/mock/keys_test.rb +3 -3
  164. data/tests/drivers/mock/realms_test.rb +2 -2
  165. data/tests/drivers/mock/storage_snapshots_test.rb +2 -2
  166. data/tests/drivers/mock/storage_volumes_test.rb +4 -4
  167. data/tests/drivers/models/instance_test.rb +2 -2
  168. data/tests/drivers/openstack/images_test.rb +2 -2
  169. data/tests/drivers/openstack/instances_test.rb +2 -3
  170. data/tests/drivers/openstack/keys_test.rb +1 -1
  171. data/tests/drivers/openstack/realms_test.rb +2 -11
  172. data/tests/drivers/rhevm/common.rb +33 -12
  173. data/tests/drivers/rhevm/images_test.rb +20 -12
  174. data/tests/drivers/rhevm/instance_test.rb +62 -46
  175. data/tests/drivers/rhevm/provider_test.rb +12 -6
  176. data/tests/drivers/rhevm/realms_test.rb +15 -9
  177. data/tests/ec2/query_parser_test.rb +1 -1
  178. data/tests/test_helper.rb +68 -12
  179. data/views/addresses/show.html.haml +1 -1
  180. data/views/buckets/show.html.haml +1 -1
  181. data/views/errors/{500.html.haml → common.html.haml} +0 -0
  182. data/views/errors/common.xml.haml +17 -0
  183. data/views/firewalls/index.xml.haml +2 -2
  184. data/views/firewalls/new.html.haml +2 -2
  185. data/views/images/show.html.haml +1 -1
  186. data/views/instances/run_command.html.haml +1 -1
  187. data/views/instances/show.html.haml +3 -3
  188. data/views/keys/index.html.haml +1 -0
  189. data/views/keys/show.html.haml +8 -4
  190. data/views/keys/show.xml.haml +3 -2
  191. data/views/load_balancers/new.html.haml +1 -1
  192. data/views/load_balancers/show.html.haml +2 -2
  193. data/views/metrics/show.html.haml +1 -1
  194. data/views/realms/index.html.haml +0 -2
  195. data/views/realms/show.html.haml +0 -4
  196. data/views/realms/show.xml.haml +0 -3
  197. data/views/storage_snapshots/index.html.haml +1 -1
  198. data/views/storage_snapshots/new.html.haml +1 -1
  199. data/views/storage_volumes/new.html.haml +2 -2
  200. data/views/storage_volumes/show.html.haml +3 -3
  201. metadata +90 -41
  202. data/views/errors/400.html.haml +0 -41
  203. data/views/errors/400.xml.haml +0 -3
  204. data/views/errors/401.html.haml +0 -26
  205. data/views/errors/401.xml.haml +0 -3
  206. data/views/errors/403.html.haml +0 -42
  207. data/views/errors/403.xml.haml +0 -9
  208. data/views/errors/404.html.haml +0 -28
  209. data/views/errors/404.xml.haml +0 -3
  210. data/views/errors/405.html.haml +0 -29
  211. data/views/errors/405.xml.haml +0 -5
  212. data/views/errors/409.html.haml +0 -47
  213. data/views/errors/409.xml.haml +0 -11
  214. data/views/errors/500.xml.haml +0 -13
  215. data/views/errors/501.html.haml +0 -44
  216. data/views/errors/501.xml.haml +0 -1
  217. data/views/errors/502.html.haml +0 -44
  218. data/views/errors/502.xml.haml +0 -1
  219. data/views/errors/504.html.haml +0 -43
  220. data/views/errors/504.xml.haml +0 -1
@@ -77,7 +77,7 @@ describe Deltacloud::EC2 do
77
77
  result.must_respond_to :'perform!'
78
78
  realms = result.perform!(@driver.credentials, @driver.backend)
79
79
  realms.wont_be_empty
80
- realms.first.must_be_kind_of Realm
80
+ realms.first.must_be_kind_of Deltacloud::Realm
81
81
  realms.first.id.must_equal 'us'
82
82
  end
83
83
 
@@ -8,10 +8,11 @@ require 'require_relative' if RUBY_VERSION < '1.9'
8
8
 
9
9
  require 'singleton'
10
10
 
11
- require_relative '../lib/deltacloud/api.rb'
12
-
13
11
  ENV['RACK_ENV'] = 'test'
14
12
 
13
+ require_relative '../lib/initialize'
14
+ require_relative '../lib/deltacloud/api.rb'
15
+
15
16
  if ENV['COVERAGE']
16
17
  begin
17
18
  require 'simplecov'
@@ -24,8 +25,9 @@ end
24
25
  #
25
26
  begin
26
27
  require 'turn'
28
+ Turn.config.format = :dot
27
29
  rescue LoadError => e
28
- warn "[WARN] The 'turn' gem is not available. (#{e.message})"
30
+ # We'll be fine
29
31
  end
30
32
 
31
33
  begin
@@ -44,6 +46,14 @@ def record_retries(name='', opts = {})
44
46
  opts
45
47
  end
46
48
 
49
+ def vcr_record_mode
50
+ (ENV['VCR_RECORD'] || :none).to_sym
51
+ end
52
+
53
+ def vcr_recording?
54
+ vcr_record_mode != :none
55
+ end
56
+
47
57
  include Rack::Test::Methods
48
58
 
49
59
  def run_frontend(frontend=:deltacloud)
@@ -71,24 +81,70 @@ module Deltacloud
71
81
 
72
82
  def initialize
73
83
  fname = ENV["CONFIG"] || File::expand_path("~/.deltacloud/config")
84
+ @hash = Hash.new do |hash, driver|
85
+ if hash.has_key?(driver.to_s)
86
+ hash[driver] = hash[driver.to_s]
87
+ else
88
+ hash[driver] = {
89
+ "user" => "fakeuser",
90
+ "password" => "fakepassword",
91
+ "provider" => "fakeprovider"
92
+ }
93
+ end
94
+ end
74
95
  begin
75
- @hash = YAML.load(File::open(fname))
96
+ @hash.merge!(YAML.load(File::open(fname)))
76
97
  rescue Errno::ENOENT
77
- @hash = {}
98
+ # Ignore
78
99
  end
79
100
  end
80
101
 
102
+ # Read credentials from ${HOME/.deltacloud/config if found.
103
+ # e.g.:
104
+ # cat ${HOME/.deltacloud/config
105
+ # rhevm:
106
+ # user: 'user@domain'
107
+ # password: 'mypassword'
108
+ # provider: 'https://16.0.0.7/api;b9bb11c2-f397-4f41-a57b-7ac15a894779'
109
+ # mock:
110
+ # user: mockuser
111
+ # password: mockpassword
112
+ # provider: compute
81
113
  def credentials(driver)
82
114
  driver = driver.to_s
83
- if @hash.has_key?(driver)
84
- user = @hash[driver]["user"]
85
- password = @hash[driver]["password"]
86
- else
87
- user = "fakeuser"
88
- password = "fakepassword"
89
- end
115
+ user = @hash[driver]["user"]
116
+ password = @hash[driver]["password"]
90
117
  { :user => user, :password => password }
91
118
  end
119
+
120
+ def driver(driver)
121
+ user = @hash[driver.to_s]["user"]
122
+ password = @hash[driver.to_s]["password"]
123
+ provider = @hash[driver.to_s]["provider"]
124
+ params = {:user => user, :password => password, :provider => provider}
125
+ Deltacloud::new(driver, params)
126
+ end
127
+
128
+ def preferences(driver)
129
+ @hash[driver.to_s]["preferred"]
130
+ end
131
+
132
+ def save(driver, dir, &block)
133
+ h = @hash[driver.to_s].dup
134
+ h["user"] = "fakeuser"
135
+ h["password"] = "fakepassword"
136
+ yield(h) if block_given?
137
+ File::open(prefs_file(dir), "w") { |f| f.write(h.to_yaml) }
138
+ end
139
+
140
+ def load(driver, dir)
141
+ @hash[driver.to_s] = YAML::load(File::open(prefs_file(dir), "r"))
142
+ end
143
+
144
+ private
145
+ def prefs_file(dir)
146
+ File.join(dir, 'fixtures', 'preferences.yml')
147
+ end
92
148
  end
93
149
 
94
150
  def self.config
@@ -16,5 +16,5 @@
16
16
  =link_to_action 'Disassociate', "#{address_url(@address.id)}/disassociate", :post
17
17
  - else
18
18
  - if driver.respond_to?(:associate_address)
19
- =link_to_action 'Associate',"#{address_url(@address.id)}/associate", :get
19
+ =link_to_action 'Associate...',"#{address_url(@address.id)}/associate", :get
20
20
  =link_to_action "Destroy", destroy_address_url(@address.id), :delete
@@ -19,5 +19,5 @@
19
19
  %li{ :'data-role' => 'list-divider'} Actions
20
20
  %li
21
21
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
22
- %a{ :href => new_blob_form_url(@bucket), :'data-role' => "button", :'data-ajax' => 'false'} Create a new blob
22
+ %a{ :href => new_blob_form_url(@bucket), :'data-role' => "button", :'data-ajax' => 'false'} Create new blob...
23
23
  =link_to_action 'Delete bucket', destroy_bucket_url(@bucket.name), :delete
@@ -0,0 +1,17 @@
1
+ - unless defined?(partial)
2
+ !!! XML
3
+ %error{ :url => request.env['REQUEST_URI'], :status => response.status }
4
+ %backend{ :driver => driver_symbol, :provider => current_provider }
5
+ %code=response.status
6
+ %message<
7
+ - if @error.respond_to? :message
8
+ =cdata @error.message
9
+ - else
10
+ =translate_error_code(response.status)
11
+ - if @error.respond_to? :backtrace
12
+ %backtrace
13
+ =cdata @error.backtrace.nil? ? '' : @error.backtrace.join("\n")
14
+ %request
15
+ - if params
16
+ -params.each do |name, value|
17
+ %param{ :name => name }=cdata value.inspect
@@ -15,8 +15,8 @@
15
15
  %rules
16
16
  - firewall.rules.each do |rule|
17
17
  %rule{:id => rule.id}
18
- %actions
19
- %link{ :rel => :rule, :href => "#{firewall_url(firewall.name)}/#{rule.id}", :method => :delete, :id =>rule.id, :rel => :destroy }
18
+ %actions
19
+ %link{ :rel => :rule, :href => "#{firewall_url(firewall.name)}/#{rule.id}", :method => :delete, :id =>rule.id, :rel => :destroy }
20
20
  - rule.attributes.select{|attr| attr != :sources && attr != :id}.each do |rule_attrib|
21
21
  - haml_tag("#{rule_attrib}".tr('-', '_'), :<) do
22
22
  - haml_concat rule.send(rule_attrib)
@@ -1,4 +1,4 @@
1
- %h1 New Firewall
1
+ %h1 New firewall
2
2
 
3
3
  %form{:action => firewalls_url, :method => :post, :'data-ajax' => 'false'}
4
4
  %label
@@ -8,4 +8,4 @@
8
8
  %label
9
9
  Firewall Description
10
10
  %input{:name => 'description', :size => 100}/
11
- %input{:type => :submit, :name => "commit", :value=>"create"}
11
+ %input{:type => :submit, :name => "commit", :value=>"Create"}
@@ -36,5 +36,5 @@
36
36
  %li{ :'data-role' => 'list-divider'} Actions
37
37
  %li
38
38
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
39
- %a{ :href => url_for("instances/new?image_id=#{@image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch
39
+ %a{ :href => url_for("instances/new?image_id=#{@image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch...
40
40
  = link_to_action 'Destroy', destroy_image_url(@image.id), :delete
@@ -1,4 +1,4 @@
1
- =header "Run a command on #{@instance.name}"
1
+ =header "Run command on #{@instance.name}"
2
2
  =subheader "#{@instance.id}"
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
@@ -60,8 +60,8 @@
60
60
  %li
61
61
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
62
62
  - @instance.actions.each do |action|
63
- =link_to_action action, self.send(:"#{action}_instance_url", @instance.id), instance_action_method(action)
63
+ =link_to_action action.to_s.capitalize, self.send(:"#{action}_instance_url", @instance.id), instance_action_method(action)
64
64
  - if @instance.state=="RUNNING" and driver.respond_to?(:run_on_instance)
65
- =link_to_action 'run command', url_for('instances/%s/run' % @instance.id), :get
65
+ =link_to_action 'Run command...', url_for('instances/%s/run' % @instance.id), :get
66
66
  - if @instance.can_create_image?
67
- =link_to_action 'Create Image', url_for("images/new?instance_id=#{@instance.id}"), :get
67
+ =link_to_action 'Create image...', url_for("images/new?instance_id=#{@instance.id}"), :get
@@ -8,6 +8,7 @@
8
8
  %a{ :href => key_url(key.id), :'data-ajax' => 'false'}
9
9
  %img{ :class => 'ui-link-thumb', :src => '/images/key.png'}
10
10
  %h3=key.id
11
+ %p=key.name
11
12
  %p
12
13
  - if key.credential_type.eql?(:key)
13
14
  = key.fingerprint
@@ -6,6 +6,9 @@
6
6
  %li{ :'data-role' => 'list-divider'} Identifier
7
7
  %li
8
8
  %p{ :'data-role' => 'fieldcontain'}=@key.id
9
+ %li{ :'data-role' => 'list-divider'} Name
10
+ %li
11
+ %p{ :'data-role' => 'fieldcontain'}=@key.name
9
12
  - if @key.is_password?
10
13
  %li{ :'data-role' => 'list-divider'} Username
11
14
  %li
@@ -14,13 +17,14 @@
14
17
  %li
15
18
  %p{ :'data-role' => 'fieldcontain'}=@key.password
16
19
  - else
17
- %li{ :'data-role' => 'list-divider'} Fingerprint
18
- %li
19
- %p{ :'data-role' => 'fieldcontain'}=@key.fingerprint
20
+ - if @key.fingerprint
21
+ %li{ :'data-role' => 'list-divider'} Fingerprint
22
+ %li
23
+ %p{ :'data-role' => 'fieldcontain'}=@key.fingerprint
20
24
  %li{ :'data-role' => 'list-divider'} PEM key
21
25
  %li
22
26
  %p{ :'data-role' => 'fieldcontain'}
23
- %pre=@key.pem_rsa_key
27
+ %pre{:style=> 'width:600px;overflow:auto;'}=@key.pem_rsa_key
24
28
  %li{ :'data-role' => 'list-divider'} Actions
25
29
  %li
26
30
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
@@ -6,8 +6,9 @@
6
6
  - if driver.respond_to?(:destroy_key)
7
7
  %link{ :rel => "destroy", :method => "delete", :href => destroy_key_url(@key.id)}
8
8
  - if @key.is_key?
9
- %fingerprint<
10
- =@key.fingerprint
9
+ - if @key.fingerprint
10
+ %fingerprint<
11
+ =@key.fingerprint
11
12
  - unless @key.pem_rsa_key.nil?
12
13
  %pem
13
14
  ~render_cdata(@key.pem_rsa_key)
@@ -35,5 +35,5 @@
35
35
  Instances port:
36
36
  %input{ :name => "listener_instance_port", :size => 30}
37
37
  %p
38
- %input{ :type => :submit, :name => "commit", :value => "create" }/
38
+ %input{ :type => :submit, :name => "commit", :value => "Create" }/
39
39
 
@@ -1,4 +1,4 @@
1
- =header "Loadbalancer"
1
+ =header "Load balancer"
2
2
  =subheader @load_balancer.id
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
@@ -20,7 +20,7 @@
20
20
  %li
21
21
  %a{ :href => instance_url(instance[:id]), :'data-ajax' => 'false'}
22
22
  %h3=instance[:name]
23
- =link_to_action "UnRegister", url_for("load_balancers/#{@load_balancer.id}/unregister?instance_id=#{instance[:id]}"), :post
23
+ =link_to_action "Unregister", url_for("load_balancers/#{@load_balancer.id}/unregister?instance_id=#{instance[:id]}"), :post
24
24
  %li{ :'data-role' => 'list-divider'} Unregistered Instances
25
25
  - @unregistered_instances.each do |instance|
26
26
  %li
@@ -7,7 +7,7 @@
7
7
  %div{ :'data-role' => :'collapsible', :'data-collapse' => 'true'}
8
8
  %h3=p.name
9
9
  %table{ :summary => "#{p.name} values"}
10
- %caption Statistics for last 60 minutes
10
+ %caption Statistics for the last 60 minutes
11
11
  %tr
12
12
  %th Time
13
13
  %th Minimum
@@ -10,6 +10,4 @@
10
10
  %img{ :class => 'ui-link-thumb', :src => '/images/realm.png'}
11
11
  %h3= realm.name
12
12
  %p=[realm.id, realm.limit].join(', ')
13
- -if realm.resource_types
14
- %p=realm.resource_types.join(",")
15
13
  %span{ :class => 'ui-li-count'}=realm.state
@@ -15,7 +15,3 @@
15
15
  %li{ :'data-role' => 'list-divider'} Limit
16
16
  %li
17
17
  %p{ :'data-role' => 'fieldcontain'}=@realm.limit
18
- - if @realm.resource_types
19
- %li{ :'data-role' => 'list-divider'} Resource Types
20
- %li
21
- %p{ :'data-role' => 'fieldcontain'}=@realm.resource_types
@@ -9,6 +9,3 @@
9
9
  %limit<
10
10
  =cdata do
11
11
  =@realm.limit
12
- - @realm.resource_types.each do |r|
13
- %resource_type<
14
- =r
@@ -1,4 +1,4 @@
1
- =header "Storage Snapshots"
1
+ =header "Storage snapshots"
2
2
 
3
3
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
4
4
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
@@ -6,4 +6,4 @@
6
6
  Volume ID:
7
7
  %input{ :name => 'volume_id', :size => 30, :value => params[:volume_id] }
8
8
  %p
9
- %input{ :type => :submit, :name => "commit", :value => "create" }/
9
+ %input{ :type => :submit, :name => "commit", :value => "Create" }/
@@ -1,4 +1,4 @@
1
- =header "Create new Storage Volume"
1
+ =header "Create new storage volume"
2
2
 
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
@@ -20,4 +20,4 @@
20
20
  Realm ID:
21
21
  %input{ :name => "realm_id", :size => 10, :value => driver.realms(credentials).first.id}
22
22
  %p
23
- %input{ :type => :submit, :name => "commit", :value => "create" }/
23
+ %input{ :type => :submit, :name => "commit", :value => "Create" }/
@@ -24,7 +24,7 @@
24
24
  - if @storage_volume.instance_id
25
25
  %a{ :href => instance_url( @storage_volume.instance_id)}
26
26
  = @storage_volume.instance_id
27
- - elsif @storage_volume.state == "AVAILABLE"
27
+ - elsif @storage_volume.state and @storage_volume.state != "IN-USE"
28
28
  %p{ :'data-role' => 'fieldcontain'}= 'none (detached)'
29
29
  -else
30
30
  %p{ :'data-role' => 'fieldcontain'}= 'unknown'
@@ -35,9 +35,9 @@
35
35
  %li
36
36
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
37
37
  - if ["AVAILABLE", "IN-USE"].include?(@storage_volume.state)
38
- =link_to_action "Snapshot", url_for("storage_snapshots/new?volume_id=#{@storage_volume.id}"), :get
38
+ =link_to_action "Snapshot...", url_for("storage_snapshots/new?volume_id=#{@storage_volume.id}"), :get
39
39
  - unless @storage_volume.instance_id
40
40
  =link_to_action "Delete", url_for("storage_volumes/#{@storage_volume.id}"), :delete
41
- =link_to_action "Attach", url_for("storage_volumes/#{@storage_volume.id}/attach_instance"), :get
41
+ =link_to_action "Attach...", url_for("storage_volumes/#{@storage_volume.id}/attach_instance"), :get
42
42
  - if @storage_volume.instance_id
43
43
  =link_to_action "Detach", url_for("storage_volumes/#{@storage_volume.id}/detach"), :post
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deltacloud-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-19 00:00:00.000000000 Z
12
+ date: 2013-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -43,22 +43,6 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: 2.2.17
46
- - !ruby/object:Gem::Dependency
47
- name: sinatra
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: 1.3.0
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: 1.3.0
62
46
  - !ruby/object:Gem::Dependency
63
47
  name: sinatra-rabbit
64
48
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +50,7 @@ dependencies:
66
50
  requirements:
67
51
  - - ! '>='
68
52
  - !ruby/object:Gem::Version
69
- version: 1.0.11
53
+ version: 1.1.6
70
54
  type: :runtime
71
55
  prerelease: false
72
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +58,7 @@ dependencies:
74
58
  requirements:
75
59
  - - ! '>='
76
60
  - !ruby/object:Gem::Version
77
- version: 1.0.11
61
+ version: 1.1.6
78
62
  - !ruby/object:Gem::Dependency
79
63
  name: rack
80
64
  requirement: !ruby/object:Gem::Requirement
@@ -171,6 +155,38 @@ dependencies:
171
155
  - - <=
172
156
  - !ruby/object:Gem::Version
173
157
  version: 3.42.0
158
+ - !ruby/object:Gem::Dependency
159
+ name: tilt
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - <=
164
+ - !ruby/object:Gem::Version
165
+ version: 1.3.3
166
+ type: :runtime
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - <=
172
+ - !ruby/object:Gem::Version
173
+ version: 1.3.3
174
+ - !ruby/object:Gem::Dependency
175
+ name: sinatra
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - <=
180
+ - !ruby/object:Gem::Version
181
+ version: 1.3.5
182
+ type: :runtime
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - <=
188
+ - !ruby/object:Gem::Version
189
+ version: 1.3.5
174
190
  - !ruby/object:Gem::Dependency
175
191
  name: sqlite3
176
192
  requirement: !ruby/object:Gem::Requirement
@@ -307,6 +323,9 @@ dependencies:
307
323
  - - ! '>='
308
324
  - !ruby/object:Gem::Version
309
325
  version: 0.14.2
326
+ - - <
327
+ - !ruby/object:Gem::Version
328
+ version: 0.17.0
310
329
  type: :runtime
311
330
  prerelease: false
312
331
  version_requirements: !ruby/object:Gem::Requirement
@@ -315,6 +334,9 @@ dependencies:
315
334
  - - ! '>='
316
335
  - !ruby/object:Gem::Version
317
336
  version: 0.14.2
337
+ - - <
338
+ - !ruby/object:Gem::Version
339
+ version: 0.17.0
318
340
  - !ruby/object:Gem::Dependency
319
341
  name: rest-client
320
342
  requirement: !ruby/object:Gem::Requirement
@@ -402,6 +424,7 @@ description: ! " The Deltacloud API is built as a service-based REST API.\n
402
424
  email: dev@deltacloud.apache.org
403
425
  executables:
404
426
  - deltacloudd
427
+ - deltacloud-db-upgrade
405
428
  extensions: []
406
429
  extra_rdoc_files:
407
430
  - LICENSE
@@ -459,10 +482,19 @@ files:
459
482
  - lib/cimi/helpers/database_helper.rb
460
483
  - lib/cimi/helpers/filter_helper.rb
461
484
  - lib/cimi/models/volume_image.rb
485
+ - lib/cimi/models/system_template.rb
462
486
  - lib/cimi/models/network_port_configuration.rb
487
+ - lib/cimi/models/credential_create.rb
488
+ - lib/cimi/models/machine_template_create.rb
489
+ - lib/cimi/models/volume_create.rb
463
490
  - lib/cimi/models/network.rb
491
+ - lib/cimi/models/network_create.rb
464
492
  - lib/cimi/models/forwarding_group.rb
493
+ - lib/cimi/models/volume_template_create.rb
494
+ - lib/cimi/models/system.rb
495
+ - lib/cimi/models/address_template_create.rb
465
496
  - lib/cimi/models/volume.rb
497
+ - lib/cimi/models/volume_image_create.rb
466
498
  - lib/cimi/models/base.rb
467
499
  - lib/cimi/models/machine_configuration.rb
468
500
  - lib/cimi/models/collection.rb
@@ -471,6 +503,7 @@ files:
471
503
  - lib/cimi/models/network_port.rb
472
504
  - lib/cimi/models/forwarding_group_template.rb
473
505
  - lib/cimi/models/resource.rb
506
+ - lib/cimi/models/credential_template.rb
474
507
  - lib/cimi/models/machine.rb
475
508
  - lib/cimi/models/volume_configuration.rb
476
509
  - lib/cimi/models/cloud_entry_point.rb
@@ -478,10 +511,13 @@ files:
478
511
  - lib/cimi/models/address_template.rb
479
512
  - lib/cimi/models/action.rb
480
513
  - lib/cimi/models/machine_image.rb
514
+ - lib/cimi/models/machine_create.rb
481
515
  - lib/cimi/models/schema.rb
482
516
  - lib/cimi/models/address.rb
483
517
  - lib/cimi/models/credential.rb
484
518
  - lib/cimi/models/network_port_template.rb
519
+ - lib/cimi/models/machine_image_create.rb
520
+ - lib/cimi/models/address_create.rb
485
521
  - lib/cimi/models/network_template.rb
486
522
  - lib/cimi/models/disk.rb
487
523
  - lib/cimi/models/errors.rb
@@ -505,6 +541,8 @@ files:
505
541
  - lib/cimi/collections/volume_configurations.rb
506
542
  - lib/cimi/collections/network_configurations.rb
507
543
  - lib/cimi/collections/addresses.rb
544
+ - lib/cimi/collections/systems.rb
545
+ - lib/cimi/collections/system_templates.rb
508
546
  - lib/cimi/collections/resource_metadata.rb
509
547
  - lib/cimi/collections/networks.rb
510
548
  - lib/cimi/collections/volumes.rb
@@ -531,6 +569,7 @@ files:
531
569
  - lib/deltacloud/helpers/blob_stream_helper.rb
532
570
  - lib/deltacloud/helpers/auth_helper.rb
533
571
  - lib/deltacloud/helpers/rabbit_helper.rb
572
+ - lib/deltacloud/helpers/collection_helper.rb
534
573
  - lib/deltacloud/helpers/deltacloud_helper.rb
535
574
  - lib/deltacloud/helpers/driver_helper.rb
536
575
  - lib/deltacloud/core_ext.rb
@@ -602,6 +641,7 @@ files:
602
641
  - lib/deltacloud/drivers/sbc/sbc_driver.rb
603
642
  - lib/deltacloud/drivers/sbc/sbc_client.rb
604
643
  - lib/deltacloud/drivers/fgcp/fgcp_driver.rb
644
+ - lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
605
645
  - lib/deltacloud/drivers/fgcp/fgcp_client.rb
606
646
  - lib/deltacloud/drivers/opennebula/occi_client.rb
607
647
  - lib/deltacloud/drivers/opennebula/cloud_client.rb
@@ -609,6 +649,7 @@ files:
609
649
  - lib/deltacloud/drivers/cimi_features.rb
610
650
  - lib/deltacloud/drivers/exceptions.rb
611
651
  - lib/deltacloud/drivers/terremark/terremark_driver.rb
652
+ - lib/initialize.rb
612
653
  - lib/sinatra.rb
613
654
  - lib/db/volume_template.rb
614
655
  - lib/db/machine_template.rb
@@ -616,6 +657,9 @@ files:
616
657
  - lib/db/entity.rb
617
658
  - lib/db/provider.rb
618
659
  - lib/db/address_template.rb
660
+ - lib/initializers/database_initialize.rb
661
+ - lib/initializers/frontend_initialize.rb
662
+ - lib/initializers/mock_initialize.rb
619
663
  - lib/deltacloud/drivers/mock/data/instances/inst0.yml
620
664
  - lib/deltacloud/drivers/mock/data/instances/inst2.yml
621
665
  - lib/deltacloud/drivers/mock/data/instances/inst1.yml
@@ -654,6 +698,7 @@ files:
654
698
  - lib/ec2/views/stop_instances.haml
655
699
  - lib/ec2/views/describe_images.haml
656
700
  - lib/ec2/views/create_key_pair.haml
701
+ - db/migrations/1_add_realm_to_machine_template.rb
657
702
  - tests/ec2/server_test.rb
658
703
  - tests/ec2/common.rb
659
704
  - tests/ec2/query_parser_test.rb
@@ -662,13 +707,18 @@ files:
662
707
  - tests/cimi/model/machine_configuration_spec.rb
663
708
  - tests/cimi/model/collection_spec.rb
664
709
  - tests/cimi/model/volume_spec.rb
710
+ - tests/cimi/model/machine_create_spec.rb
665
711
  - tests/cimi/model/volume_template_spec.rb
666
712
  - tests/cimi/model/schema_spec.rb
667
713
  - tests/cimi/model/volume_image_spec.rb
668
714
  - tests/cimi/model/machine_image_spec.rb
669
715
  - tests/cimi/model/volume_configuration_spec.rb
670
716
  - tests/cimi/model/credential_spec.rb
717
+ - tests/cimi/model/resource_spec.rb
671
718
  - tests/cimi/spec_helper.rb
719
+ - tests/cimi/collections/system_templates_test.rb
720
+ - tests/cimi/collections/machine_templates_test.rb
721
+ - tests/cimi/collections/systems_test.rb
672
722
  - tests/cimi/collections/common.rb
673
723
  - tests/cimi/collections/cloud_entry_point_test.rb
674
724
  - tests/cimi/collections/machines_test.rb
@@ -754,6 +804,13 @@ files:
754
804
  - tests/drivers/models/keys_test.rb
755
805
  - tests/drivers/models/instance_profile_test.rb
756
806
  - tests/drivers/models/hardware_profile_test.rb
807
+ - tests/drivers/fgcp/realms_test.rb
808
+ - tests/drivers/fgcp/firewall_test.rb
809
+ - tests/drivers/fgcp/images_test.rb
810
+ - tests/drivers/fgcp/storage_volumes_test.rb
811
+ - tests/drivers/fgcp/common.rb
812
+ - tests/drivers/fgcp/provider_test.rb
813
+ - tests/drivers/fgcp/hardware_profiles_test.rb
757
814
  - views/instances/run.xml.haml
758
815
  - views/instances/show.xml.haml
759
816
  - views/instances/run.html.haml
@@ -782,28 +839,10 @@ files:
782
839
  - views/realms/index.html.haml
783
840
  - views/realms/index.xml.haml
784
841
  - views/realms/show.html.haml
785
- - views/errors/504.html.haml
786
- - views/errors/409.xml.haml
787
- - views/errors/501.xml.haml
788
- - views/errors/404.html.haml
789
- - views/errors/502.html.haml
790
- - views/errors/401.xml.haml
791
- - views/errors/404.xml.haml
792
- - views/errors/403.html.haml
793
- - views/errors/405.html.haml
842
+ - views/errors/common.html.haml
794
843
  - views/errors/backend_capability_failure.xml.haml
795
844
  - views/errors/backend_capability_failure.html.haml
796
- - views/errors/501.html.haml
797
- - views/errors/400.xml.haml
798
- - views/errors/400.html.haml
799
- - views/errors/502.xml.haml
800
- - views/errors/405.xml.haml
801
- - views/errors/401.html.haml
802
- - views/errors/500.xml.haml
803
- - views/errors/403.xml.haml
804
- - views/errors/409.html.haml
805
- - views/errors/500.html.haml
806
- - views/errors/504.xml.haml
845
+ - views/errors/common.xml.haml
807
846
  - views/load_balancers/show.xml.haml
808
847
  - views/load_balancers/new.html.haml
809
848
  - views/load_balancers/index.html.haml
@@ -927,6 +966,7 @@ files:
927
966
  - public/stylesheets/compiled/screen.css
928
967
  - public/stylesheets/compiled/ie.css
929
968
  - bin/deltacloudd
969
+ - bin/deltacloud-db-upgrade
930
970
  - LICENSE
931
971
  - NOTICE
932
972
  homepage: http://www.deltacloud.org
@@ -949,7 +989,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
949
989
  version: '0'
950
990
  segments:
951
991
  - 0
952
- hash: -2269388389884938239
992
+ hash: -1292396733782227782
953
993
  requirements: []
954
994
  rubyforge_project:
955
995
  rubygems_version: 1.8.23
@@ -959,6 +999,9 @@ summary: Deltacloud REST API
959
999
  test_files:
960
1000
  - tests/ec2/server_test.rb
961
1001
  - tests/ec2/query_parser_test.rb
1002
+ - tests/cimi/collections/system_templates_test.rb
1003
+ - tests/cimi/collections/machine_templates_test.rb
1004
+ - tests/cimi/collections/systems_test.rb
962
1005
  - tests/cimi/collections/cloud_entry_point_test.rb
963
1006
  - tests/cimi/collections/machines_test.rb
964
1007
  - tests/cimi/collections/machine_images_test.rb
@@ -1031,3 +1074,9 @@ test_files:
1031
1074
  - tests/drivers/models/keys_test.rb
1032
1075
  - tests/drivers/models/instance_profile_test.rb
1033
1076
  - tests/drivers/models/hardware_profile_test.rb
1077
+ - tests/drivers/fgcp/realms_test.rb
1078
+ - tests/drivers/fgcp/firewall_test.rb
1079
+ - tests/drivers/fgcp/images_test.rb
1080
+ - tests/drivers/fgcp/storage_volumes_test.rb
1081
+ - tests/drivers/fgcp/provider_test.rb
1082
+ - tests/drivers/fgcp/hardware_profiles_test.rb