deltacloud-core 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. data/deltacloud-core.gemspec +4 -7
  2. data/lib/cimi/collections/address_templates.rb +4 -42
  3. data/lib/cimi/collections/addresses.rb +5 -43
  4. data/lib/cimi/collections/base.rb +11 -3
  5. data/lib/cimi/collections/cloud_entry_point.rb +1 -1
  6. data/lib/cimi/collections/credentials.rb +4 -43
  7. data/lib/cimi/collections/forwarding_group_templates.rb +2 -20
  8. data/lib/cimi/collections/forwarding_groups.rb +2 -21
  9. data/lib/cimi/collections/machine_configurations.rb +2 -20
  10. data/lib/cimi/collections/machine_images.rb +4 -42
  11. data/lib/cimi/collections/machine_templates.rb +4 -42
  12. data/lib/cimi/collections/machines.rb +14 -64
  13. data/lib/cimi/collections/network_configurations.rb +2 -20
  14. data/lib/cimi/collections/network_port_configurations.rb +2 -21
  15. data/lib/cimi/collections/network_port_templates.rb +2 -23
  16. data/lib/cimi/collections/network_ports.rb +6 -46
  17. data/lib/cimi/collections/network_templates.rb +2 -21
  18. data/lib/cimi/collections/networks.rb +4 -40
  19. data/lib/cimi/collections/resource_metadata.rb +2 -21
  20. data/lib/cimi/collections/system_templates.rb +4 -45
  21. data/lib/cimi/collections/systems.rb +65 -82
  22. data/lib/cimi/collections/volume_configurations.rb +4 -45
  23. data/lib/cimi/collections/volume_images.rb +4 -42
  24. data/lib/cimi/collections/volume_templates.rb +5 -44
  25. data/lib/cimi/collections/volumes.rb +4 -48
  26. data/lib/cimi/helpers.rb +1 -0
  27. data/lib/cimi/helpers/cimi_helper.rb +1 -1
  28. data/lib/cimi/helpers/cimi_rabbit_helper.rb +113 -0
  29. data/lib/cimi/helpers/database_helper.rb +1 -2
  30. data/lib/cimi/models.rb +12 -11
  31. data/lib/cimi/models/action.rb +0 -4
  32. data/lib/cimi/models/address.rb +0 -38
  33. data/lib/cimi/models/address_create.rb +0 -31
  34. data/lib/cimi/models/address_template.rb +0 -47
  35. data/lib/cimi/models/address_template_create.rb +0 -16
  36. data/lib/cimi/models/base.rb +2 -74
  37. data/lib/cimi/models/cloud_entry_point.rb +2 -30
  38. data/lib/cimi/models/collection.rb +8 -25
  39. data/lib/cimi/models/credential.rb +0 -34
  40. data/lib/cimi/models/credential_create.rb +0 -26
  41. data/lib/cimi/models/credential_template.rb +0 -2
  42. data/lib/cimi/models/disk.rb +0 -56
  43. data/lib/cimi/models/forwarding_group.rb +0 -8
  44. data/lib/cimi/models/forwarding_group_template.rb +0 -8
  45. data/lib/cimi/models/machine.rb +4 -129
  46. data/lib/cimi/models/machine_configuration.rb +0 -31
  47. data/lib/cimi/models/machine_create.rb +1 -29
  48. data/lib/cimi/models/machine_image.rb +0 -28
  49. data/lib/cimi/models/machine_image_create.rb +0 -19
  50. data/lib/cimi/models/machine_template.rb +5 -39
  51. data/lib/cimi/models/machine_template_create.rb +0 -12
  52. data/lib/cimi/models/machine_volume.rb +0 -65
  53. data/lib/cimi/models/network.rb +0 -32
  54. data/lib/cimi/models/network_configuration.rb +0 -15
  55. data/lib/cimi/models/network_create.rb +0 -23
  56. data/lib/cimi/models/network_port.rb +0 -73
  57. data/lib/cimi/models/network_port_configuration.rb +0 -8
  58. data/lib/cimi/models/network_port_template.rb +0 -8
  59. data/lib/cimi/models/network_template.rb +2 -12
  60. data/lib/cimi/models/resource.rb +0 -6
  61. data/lib/cimi/models/resource_metadata.rb +1 -95
  62. data/lib/cimi/models/schema.rb +28 -32
  63. data/lib/cimi/models/system.rb +15 -39
  64. data/lib/cimi/models/system_address.rb +26 -0
  65. data/lib/cimi/models/system_create.rb +20 -0
  66. data/lib/cimi/models/system_credential.rb +26 -0
  67. data/lib/cimi/models/system_forwarding_group.rb +26 -0
  68. data/lib/cimi/models/system_machine.rb +26 -0
  69. data/lib/cimi/models/system_network.rb +26 -0
  70. data/lib/cimi/models/system_network_port.rb +26 -0
  71. data/lib/cimi/models/system_system.rb +26 -0
  72. data/lib/cimi/models/system_template.rb +15 -31
  73. data/lib/cimi/models/system_volume.rb +26 -0
  74. data/lib/cimi/models/volume.rb +0 -59
  75. data/lib/cimi/models/volume_configuration.rb +1 -64
  76. data/lib/cimi/models/volume_configuration_create.rb +22 -0
  77. data/lib/cimi/models/volume_create.rb +0 -38
  78. data/lib/cimi/models/volume_image.rb +0 -30
  79. data/lib/cimi/models/volume_image_create.rb +0 -25
  80. data/lib/cimi/models/volume_template.rb +2 -43
  81. data/lib/cimi/models/volume_template_create.rb +0 -12
  82. data/lib/cimi/service.rb +82 -0
  83. data/lib/cimi/service/action.rb +21 -0
  84. data/lib/cimi/service/address.rb +56 -0
  85. data/lib/cimi/service/address_create.rb +45 -0
  86. data/lib/cimi/service/address_template.rb +71 -0
  87. data/lib/cimi/service/address_template_create.rb +34 -0
  88. data/lib/cimi/service/base.rb +266 -0
  89. data/lib/cimi/service/cloud_entry_point.rb +53 -0
  90. data/lib/cimi/service/credential.rb +52 -0
  91. data/lib/cimi/service/credential_create.rb +38 -0
  92. data/lib/cimi/service/credential_template.rb +20 -0
  93. data/lib/cimi/service/disk.rb +75 -0
  94. data/lib/cimi/service/forwarding_group.rb +26 -0
  95. data/lib/cimi/service/forwarding_group_template.rb +26 -0
  96. data/lib/cimi/service/machine.rb +154 -0
  97. data/lib/cimi/service/machine_configuration.rb +54 -0
  98. data/lib/cimi/service/machine_create.rb +49 -0
  99. data/lib/cimi/service/machine_image.rb +47 -0
  100. data/lib/cimi/service/machine_image_create.rb +35 -0
  101. data/lib/cimi/service/machine_template.rb +61 -0
  102. data/lib/cimi/service/machine_template_create.rb +29 -0
  103. data/lib/cimi/service/machine_volume.rb +74 -0
  104. data/lib/cimi/service/network.rb +51 -0
  105. data/lib/cimi/service/network_configuration.rb +36 -0
  106. data/lib/cimi/service/network_create.rb +39 -0
  107. data/lib/cimi/service/network_port.rb +97 -0
  108. data/lib/cimi/service/network_port_configuration.rb +26 -0
  109. data/lib/cimi/service/network_port_template.rb +26 -0
  110. data/lib/cimi/service/network_template.rb +28 -0
  111. data/lib/cimi/service/resource_metadata.rb +44 -0
  112. data/lib/cimi/service/system.rb +45 -0
  113. data/lib/cimi/service/system_address.rb +34 -0
  114. data/lib/cimi/service/system_create.rb +39 -0
  115. data/lib/cimi/service/system_credential.rb +34 -0
  116. data/lib/cimi/service/system_forwarding_group.rb +34 -0
  117. data/lib/cimi/service/system_machine.rb +34 -0
  118. data/lib/cimi/service/system_network.rb +34 -0
  119. data/lib/cimi/service/system_network_port.rb +34 -0
  120. data/lib/cimi/service/system_system.rb +34 -0
  121. data/lib/cimi/service/system_template.rb +32 -0
  122. data/lib/cimi/service/system_volume.rb +34 -0
  123. data/lib/cimi/service/volume.rb +81 -0
  124. data/lib/cimi/service/volume_configuration.rb +92 -0
  125. data/lib/cimi/service/volume_configuration_create.rb +29 -0
  126. data/lib/cimi/service/volume_create.rb +47 -0
  127. data/lib/cimi/service/volume_image.rb +44 -0
  128. data/lib/cimi/service/volume_image_create.rb +42 -0
  129. data/lib/cimi/service/volume_template.rb +61 -0
  130. data/lib/cimi/service/volume_template_create.rb +29 -0
  131. data/lib/db/entity.rb +16 -1
  132. data/lib/deltacloud/collections/addresses.rb +2 -2
  133. data/lib/deltacloud/collections/buckets.rb +16 -18
  134. data/lib/deltacloud/collections/drivers.rb +4 -4
  135. data/lib/deltacloud/collections/firewalls.rb +5 -5
  136. data/lib/deltacloud/collections/images.rb +3 -3
  137. data/lib/deltacloud/collections/instance_states.rb +4 -4
  138. data/lib/deltacloud/collections/instances.rb +22 -13
  139. data/lib/deltacloud/collections/keys.rb +2 -2
  140. data/lib/deltacloud/collections/load_balancers.rb +16 -13
  141. data/lib/deltacloud/collections/storage_snapshots.rb +3 -3
  142. data/lib/deltacloud/collections/storage_volumes.rb +5 -5
  143. data/lib/deltacloud/core_ext/ordered_hash.rb +0 -4
  144. data/lib/deltacloud/drivers/fgcp/fgcp_client.rb +8 -0
  145. data/lib/deltacloud/drivers/fgcp/fgcp_driver.rb +4 -3
  146. data/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb +266 -19
  147. data/lib/deltacloud/drivers/google/google_driver.rb +6 -0
  148. data/lib/deltacloud/drivers/mock/mock_driver.rb +2 -2
  149. data/lib/deltacloud/drivers/mock/mock_driver_cimi_methods.rb +166 -54
  150. data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +2 -0
  151. data/lib/deltacloud/helpers/blob_stream_helper.rb +0 -2
  152. data/lib/deltacloud/helpers/deltacloud_helper.rb +22 -22
  153. data/lib/deltacloud/helpers/driver_helper.rb +4 -7
  154. data/lib/deltacloud/helpers/rabbit_helper.rb +5 -0
  155. data/lib/deltacloud/server.rb +4 -4
  156. data/lib/deltacloud/version.rb +1 -1
  157. data/lib/deltacloud_rack.rb +6 -1
  158. data/lib/ec2/server.rb +6 -1
  159. data/tests/cimi/collections/common.rb +33 -0
  160. data/tests/cimi/collections/machines_test.rb +19 -0
  161. data/tests/cimi/collections/system_templates_test.rb +47 -0
  162. data/tests/cimi/collections/volumes_test.rb +42 -0
  163. data/tests/cimi/db/database_helper_test.rb +7 -4
  164. data/tests/deltacloud/drivers_test.rb +1 -1
  165. data/tests/drivers/ec2/common.rb +4 -1
  166. data/tests/drivers/fgcp/common.rb +1 -2
  167. data/tests/drivers/gogrid/common.rb +1 -2
  168. data/tests/drivers/google/common.rb +1 -1
  169. data/tests/drivers/models/address_test.rb +2 -2
  170. data/tests/drivers/models/base_test.rb +2 -2
  171. data/tests/drivers/models/blob_test.rb +2 -2
  172. data/tests/drivers/models/instance_address_test.rb +8 -8
  173. data/tests/drivers/models/instance_profile_test.rb +2 -2
  174. data/tests/drivers/models/keys_test.rb +4 -4
  175. data/tests/drivers/models/metrics_test.rb +3 -3
  176. data/tests/drivers/openstack/common.rb +1 -2
  177. data/views/addresses/_address.html.haml +3 -3
  178. data/views/addresses/associate.html.haml +3 -3
  179. data/views/addresses/index.html.haml +2 -2
  180. data/views/addresses/index.xml.haml +2 -2
  181. data/views/addresses/show.html.haml +7 -7
  182. data/views/addresses/show.xml.haml +9 -9
  183. data/views/api/show.html.haml +2 -2
  184. data/views/api/show.xml.haml +1 -1
  185. data/views/blobs/new.html.haml +1 -1
  186. data/views/blobs/show.html.haml +8 -8
  187. data/views/blobs/show.xml.haml +7 -7
  188. data/views/buckets/index.html.haml +1 -1
  189. data/views/buckets/index.xml.haml +2 -2
  190. data/views/buckets/show.html.haml +7 -7
  191. data/views/buckets/show.xml.haml +6 -6
  192. data/views/drivers/index.html.haml +1 -1
  193. data/views/drivers/index.xml.haml +1 -1
  194. data/views/drivers/show.html.haml +6 -6
  195. data/views/drivers/show.xml.haml +5 -5
  196. data/views/error.html.haml +2 -2
  197. data/views/errors/backend_capability_failure.xml.haml +3 -3
  198. data/views/errors/common.html.haml +7 -7
  199. data/views/errors/common.xml.haml +5 -5
  200. data/views/firewalls/index.html.haml +1 -1
  201. data/views/firewalls/index.xml.haml +1 -1
  202. data/views/firewalls/new_rule.html.haml +1 -1
  203. data/views/firewalls/show.html.haml +8 -8
  204. data/views/firewalls/show.xml.haml +9 -9
  205. data/views/hardware_profiles/index.html.haml +1 -1
  206. data/views/hardware_profiles/index.xml.haml +2 -2
  207. data/views/hardware_profiles/show.html.haml +3 -3
  208. data/views/hardware_profiles/show.xml.haml +4 -4
  209. data/views/images/index.html.haml +1 -1
  210. data/views/images/index.xml.haml +2 -2
  211. data/views/images/new.html.haml +2 -2
  212. data/views/images/show.html.haml +14 -14
  213. data/views/images/show.xml.haml +14 -14
  214. data/views/instance_states/show.html.haml +1 -1
  215. data/views/instance_states/show.png.erb +2 -2
  216. data/views/instance_states/show.xml.haml +1 -1
  217. data/views/instances/index.html.haml +1 -1
  218. data/views/instances/index.xml.haml +2 -2
  219. data/views/instances/new.html.haml +22 -14
  220. data/views/instances/run.html.haml +2 -2
  221. data/views/instances/run.xml.haml +3 -3
  222. data/views/instances/run_command.html.haml +4 -4
  223. data/views/instances/show.html.haml +27 -27
  224. data/views/instances/show.xml.haml +37 -37
  225. data/views/keys/index.html.haml +1 -1
  226. data/views/keys/index.xml.haml +2 -2
  227. data/views/keys/show.html.haml +10 -10
  228. data/views/keys/show.xml.haml +12 -12
  229. data/views/load_balancers/index.html.haml +1 -1
  230. data/views/load_balancers/index.xml.haml +2 -2
  231. data/views/load_balancers/new.html.haml +1 -8
  232. data/views/load_balancers/show.html.haml +10 -10
  233. data/views/load_balancers/show.xml.haml +9 -9
  234. data/views/metrics/index.html.haml +1 -1
  235. data/views/metrics/index.xml.haml +2 -2
  236. data/views/metrics/show.html.haml +2 -2
  237. data/views/metrics/show.xml.haml +3 -3
  238. data/views/realms/index.html.haml +1 -1
  239. data/views/realms/index.xml.haml +2 -2
  240. data/views/realms/show.html.haml +6 -6
  241. data/views/realms/show.xml.haml +5 -5
  242. data/views/storage_snapshots/index.html.haml +1 -1
  243. data/views/storage_snapshots/index.xml.haml +2 -2
  244. data/views/storage_snapshots/show.html.haml +6 -6
  245. data/views/storage_snapshots/show.xml.haml +4 -4
  246. data/views/storage_volumes/attach.html.haml +2 -2
  247. data/views/storage_volumes/index.html.haml +1 -1
  248. data/views/storage_volumes/index.xml.haml +2 -2
  249. data/views/storage_volumes/show.html.haml +19 -19
  250. data/views/storage_volumes/show.xml.haml +21 -21
  251. metadata +77 -65
  252. data/views/cimi/cloudEntryPoint/index.html.haml +0 -5
  253. data/views/cimi/cloudEntryPoint/index.xml.haml +0 -9
  254. data/views/cimi/collection/index.html.haml +0 -45
  255. data/views/cimi/collection/response.xml.haml +0 -3
  256. data/views/cimi/error.html.haml +0 -31
  257. data/views/cimi/errors/400.xml.haml +0 -3
  258. data/views/cimi/errors/401.xml.haml +0 -2
  259. data/views/cimi/errors/403.xml.haml +0 -2
  260. data/views/cimi/errors/404.xml.haml +0 -2
  261. data/views/cimi/errors/405.xml.haml +0 -5
  262. data/views/cimi/errors/500.xml.haml +0 -6
  263. data/views/cimi/errors/502.xml.haml +0 -7
  264. data/views/cimi/layout.html.haml +0 -32
  265. data/views/cimi/machine_configurations/show.html.haml +0 -159
  266. data/views/cimi/machine_configurations/show.xml.haml +0 -27
  267. data/views/cimi/machine_images/show.html.haml +0 -79
  268. data/views/cimi/machine_images/show.xml.haml +0 -17
  269. data/views/cimi/machines/show.html.haml +0 -177
  270. data/views/cimi/machines/show.xml.haml +0 -28
  271. data/views/cimi/volumes/show.html.haml +0 -68
  272. data/views/cimi/volumes/show.xml.haml +0 -17
  273. data/views/docs/collection.html.haml +0 -26
  274. data/views/docs/collection.xml.haml +0 -14
  275. data/views/docs/index.html.haml +0 -11
  276. data/views/docs/index.xml.haml +0 -5
  277. data/views/docs/operation.html.haml +0 -33
  278. data/views/docs/operation.xml.haml +0 -10
  279. data/views/root/index.html.haml +0 -4
@@ -1,5 +1,5 @@
1
1
  %drivers
2
- - @drivers.each do |id, details|
2
+ - drivers.each do |id, details|
3
3
  %driver{ :href => driver_url(id), :id => id }
4
4
  %name<
5
5
  =details[:name]
@@ -1,23 +1,23 @@
1
- =header @name
1
+ =header name
2
2
  =subheader "Deltacloud API #{settings.version}"
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
6
6
  %li{ :'data-role' => 'list-divider'} Identifier
7
7
  %li
8
- %p{ :'data-role' => 'fieldcontain'}=@name
8
+ %p{ :'data-role' => 'fieldcontain'}=name
9
9
  %li{ :'data-role' => 'list-divider'} Name
10
10
  %li
11
- %p{ :'data-role' => 'fieldcontain'}=@driver[:name]
11
+ %p{ :'data-role' => 'fieldcontain'}=driver[:name]
12
12
  %li{ :'data-role' => 'list-divider'} Provider
13
13
  %li
14
14
  %p{ :'data-role' => 'fieldcontain'}
15
- - if @providers
16
- - @providers.each do |p|
15
+ - if providers
16
+ - providers.each do |p|
17
17
  %h3= p.id
18
18
  %p= p.url
19
19
  - else
20
- - providers = driver_provider(@driver).keys.collect { |k| k.to_s }.sort
20
+ - providers = driver_provider(driver).keys.collect { |k| k.to_s }.sort
21
21
  - if providers.empty?
22
22
  None
23
23
  - else
@@ -1,12 +1,12 @@
1
- %driver{ :href => driver_url(@name), :id => @name }
1
+ %driver{ :href => driver_url(name), :id => name }
2
2
  %name<
3
- = @driver[:name]
4
- - if @providers.nil?
5
- - driver_provider(@driver).each do |prov, details|
3
+ = driver[:name]
4
+ - if providers.nil?
5
+ - driver_provider(driver).each do |prov, details|
6
6
  %provider{ :id => prov }
7
7
  - details.each do |kind, url|
8
8
  %entrypoint{ :kind => kind }<=cdata(url)
9
9
  - else
10
- - @providers.each do |p|
10
+ - providers.each do |p|
11
11
  %provider{ :id => p.id }
12
12
  %entrypoint{ :kind => p.name }<=p.url
@@ -17,8 +17,8 @@
17
17
  %body
18
18
  %div{ 'data-role' => :page, :'data-theme' => 'e', :class => :error }
19
19
  =header "#{response.status} - #{translate_error_code(response.status)[:message]}"
20
- - if @error
21
- =subheader @error.message
20
+ - if err
21
+ =subheader err.message
22
22
  - elsif response.status.to_s =~ /4(\d{2})/
23
23
  =subheader request.env['REQUEST_URI']
24
24
  = yield
@@ -1,5 +1,5 @@
1
- %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
- %capability #{@error.capability}
3
- %message< #{cdata @error.message}
1
+ %err{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
+ %capability #{err.capability}
3
+ %message< #{cdata err.message}
4
4
 
5
5
 
@@ -2,28 +2,28 @@
2
2
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
3
3
  %li{ :'data-role' => 'list-divider'} Server message
4
4
  %li
5
- %h3= h [@error.class.name, @error.message].join(' - ')
5
+ %h3= h [err.class.name, err.message].join(' - ')
6
6
  %li{ :'data-role' => 'list-divider'} Original request URI
7
7
  %li
8
8
  %a{ :href => request.env['REQUEST_URI'], :'data-ajax' => 'false'}
9
9
  %span=request.env['REQUEST_URI']
10
10
  %span{ :class => 'ui-li-count'} Retry
11
- %li{ :'data-role' => 'list-divider'} Error details
11
+ %li{ :'data-role' => 'list-divider'} err details
12
12
  %li
13
- - if @error.class.method_defined? :details
14
- %p= h @error.details
13
+ - if err.class.method_defined? :details
14
+ %p= h err.details
15
15
  - else
16
16
  %em No details
17
17
  %li{ :'data-role' => 'list-divider'} Backtrace
18
18
  %li
19
- %pre= bt @error.backtrace
19
+ %pre= bt err.backtrace
20
20
 
21
- - if @error.backtrace
21
+ - if err.backtrace
22
22
  %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
23
23
  %h3 Backtrace
24
24
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'e'}
25
25
  %li
26
- %pre= h @error.backtrace.join("\n")
26
+ %pre= h err.backtrace.join("\n")
27
27
 
28
28
  %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"}
29
29
  %h3 Parameters
@@ -4,13 +4,13 @@
4
4
  %backend{ :driver => driver_symbol, :provider => current_provider }
5
5
  %code=response.status
6
6
  %message<
7
- - if @error.respond_to? :message
8
- =cdata @error.message
7
+ - if err.respond_to? :message
8
+ =cdata err.message
9
9
  - else
10
- =translate_error_code(response.status)
11
- - if @error.respond_to? :backtrace
10
+ =translate_err_code(response.status)
11
+ - if err.respond_to? :backtrace
12
12
  %backtrace
13
- =cdata @error.backtrace.nil? ? '' : @error.backtrace.join("\n")
13
+ =cdata err.backtrace.nil? ? '' : err.backtrace.join("\n")
14
14
  %request
15
15
  - if params
16
16
  -params.each do |name, value|
@@ -5,7 +5,7 @@
5
5
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
6
6
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
7
7
  %li{ :'data-role' => 'list-divider'}=driver_symbol
8
- - @firewalls.each do |firewall|
8
+ - elements.each do |firewall|
9
9
  %li
10
10
  %a{ :href => firewall_url(firewall.id), :'data-ajax' => 'false'}
11
11
  %img{ :class => 'ui-link-thumb', :src => '/images/firewall.png'}
@@ -1,6 +1,6 @@
1
1
  !!! XML
2
2
  %firewalls
3
- - @firewalls.each do |firewall|
3
+ - elements.each do |firewall|
4
4
  %firewall{:href => firewall_url(firewall.id), :id => firewall.id}
5
5
  %actions
6
6
  %link{ :rel => :destroy, :href => destroy_firewall_url(firewall.id), :method => :delete, :id => firewall.id}
@@ -1,7 +1,7 @@
1
1
  =header "New firewall rule"
2
2
 
3
3
  %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog', :id => "new_rule_form"}
4
- %form{ :action => "#{firewall_url(@firewall_name)}/rules", :method => :post, :'data-ajax' => 'false'}
4
+ %form{ :action => "#{firewall_url(firewall_name)}/rules", :method => :post, :'data-ajax' => 'false'}
5
5
  %div{ 'data-role' => :fieldcontain }
6
6
  %label{ :for => :name} Protocol:
7
7
  %input{ :type => :text, :id => :protocol, :name => :protocol, :value => '', :size => 10 }
@@ -1,27 +1,27 @@
1
1
  =header "Firewall"
2
- =subheader @firewall.id
2
+ =subheader firewall.id
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
6
6
  %li{ :'data-role' => 'list-divider'} Identifier
7
7
  %li
8
- %p{ :'data-role' => 'fieldcontain'}=@firewall.id
8
+ %p{ :'data-role' => 'fieldcontain'}=firewall.id
9
9
  %li{ :'data-role' => 'list-divider'} Description
10
10
  %li
11
- %p{ :'data-role' => 'fieldcontain'}=@firewall.description
11
+ %p{ :'data-role' => 'fieldcontain'}=firewall.description
12
12
  %li{ :'data-role' => 'list-divider'} Owner
13
13
  %li
14
- %p{ :'data-role' => 'fieldcontain'}=@firewall.owner_id
14
+ %p{ :'data-role' => 'fieldcontain'}=firewall.owner_id
15
15
  %li{ :'data-role' => 'list-divider'} Actions
16
16
  %li
17
17
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
18
- =link_to_action "Destroy", destroy_firewall_url(@firewall.id), :delete
18
+ =link_to_action "Destroy", destroy_firewall_url(firewall.id), :delete
19
19
 
20
20
  =header "Rules", :back => 'false' do
21
- %a{ :href => url_for("firewalls/#{@firewall.id}/new_rule"), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => 'false'} Add new rule
21
+ %a{ :href => url_for("firewalls/#{firewall.id}/new_rule"), :'data-icon' => :plus, :'data-role' => :button, :class => 'ui-btn-right', :'data-ajax' => 'false'} Add new rule
22
22
 
23
23
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
24
- - @firewall.rules.each do |rule|
24
+ - firewall.rules.each do |rule|
25
25
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
26
26
  %li{ :'data-role' => 'list-divider'}
27
27
  %strong=rule.id
@@ -39,4 +39,4 @@
39
39
  %li{ :'data-role' => 'list-divider'} Actions
40
40
  %li
41
41
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
42
- =link_to_action "Delete", "#{firewall_url(@firewall.id)}/#{rule.id}", :delete
42
+ =link_to_action "Delete", "#{firewall_url(firewall.id)}/#{rule.id}", :delete
@@ -1,20 +1,20 @@
1
1
  !!! XML
2
- %firewall{:href => firewall_url(@firewall.id), :id => @firewall.id}
2
+ %firewall{:href => firewall_url(firewall.id), :id => firewall.id}
3
3
  %actions
4
- %link{ :rel => :destroy, :href => destroy_firewall_url(@firewall.id), :method => :delete}
5
- %link{ :rel => :update, :href => "#{firewall_url(@firewall_name)}/rules", :method => :post}
6
- - @firewall.attributes.select{ |attr| attr != :id && attr!= :rules}.each do |attribute|
4
+ %link{ :rel => :destroy, :href => destroy_firewall_url(firewall.id), :method => :delete}
5
+ %link{ :rel => :update, :href => "#{firewall_url(firewall.id)}/rules", :method => :post}
6
+ - firewall.attributes.select{ |attr| attr != :id && attr!= :rules}.each do |attribute|
7
7
  - haml_tag("#{attribute}".tr('-', '_'), :<) do
8
8
  - if [:name, :description].include?(attribute)
9
9
  =cdata do
10
- - haml_concat @firewall.send(attribute)
10
+ - haml_concat firewall.send(attribute)
11
11
  - else
12
- - haml_concat @firewall.send(attribute)
12
+ - haml_concat firewall.send(attribute)
13
13
  %rules
14
- - @firewall.rules.each do |rule|
15
- %rule{:href => firewall_url(@firewall.id) + '/' + rule.id, :id => rule.id}
14
+ - firewall.rules.each do |rule|
15
+ %rule{:href => firewall_url(firewall.id) + '/' + rule.id, :id => rule.id}
16
16
  %actions
17
- %link{ :rel => :destroy, :href => "#{firewall_url(@firewall.name)}/#{rule.id}", :method => :delete}
17
+ %link{ :rel => :destroy, :href => "#{firewall_url(firewall.name)}/#{rule.id}", :method => :delete}
18
18
  - rule.attributes.select{|attr| attr != :sources && attr != :id}.each do |rule_attrib|
19
19
  - haml_tag("#{rule_attrib}".tr('-', '_'), :<) do
20
20
  - haml_concat rule.send(rule_attrib)
@@ -3,7 +3,7 @@
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview, :'data-inset' => :true }
6
- - for profile in order_hardware_profiles(@hardware_profiles)
6
+ - for profile in order_hardware_profiles(elements)
7
7
  %li{ :'data-theme' => 'c'}
8
8
  %a{ :href => hardware_profile_url(profile.id)}
9
9
  %img{ :class => 'ui-link-thumb', :src => '/images/profile.png'}
@@ -1,4 +1,4 @@
1
1
  !!! XML
2
2
  %hardware_profiles
3
- - order_hardware_profiles(@hardware_profiles).each do |prof|
4
- = haml :'hardware_profiles/show', :locals => { :@hardware_profile => prof, :partial => true }
3
+ - order_hardware_profiles(elements).each do |prof|
4
+ = haml :'hardware_profiles/show', :locals => { :hardware_profile => prof, :partial => true }
@@ -1,12 +1,12 @@
1
1
  =header "Hardware profiles"
2
- =subheader @hardware_profile.name || @hardware_profile.id
2
+ =subheader hardware_profile.name || hardware_profile.id
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
6
6
  %li{ :'data-role' => 'list-divider'} Name
7
7
  %li
8
- %p{ :'data-role' => 'fieldcontain'}=@hardware_profile.name || @hardware_profile.id
9
- - @hardware_profile.each_property do |p|
8
+ %p{ :'data-role' => 'fieldcontain'}=hardware_profile.name || hardware_profile.id
9
+ - hardware_profile.each_property do |p|
10
10
  %li{ :'data-role' => 'list-divider'} #{p.name.to_s.titlecase}
11
11
  %li
12
12
  %p{ :'data-role' => 'fieldcontain'}
@@ -1,10 +1,10 @@
1
1
  - unless defined?(partial)
2
2
  !!! XML
3
- %hardware_profile{ :href => hardware_profile_url(@hardware_profile.id), :id => @hardware_profile.id }
4
- %id= @hardware_profile.id
3
+ %hardware_profile{ :href => hardware_profile_url(hardware_profile.id), :id => hardware_profile.id }
4
+ %id= hardware_profile.id
5
5
  %name<
6
- = @hardware_profile.name
7
- - @hardware_profile.each_property do |prop|
6
+ = hardware_profile.name
7
+ - hardware_profile.each_property do |prop|
8
8
  - attr = { :name => prop.name, :kind => prop.kind, :unit => prop.unit }
9
9
  - if prop.kind == :fixed
10
10
  %property{ attr, :value => prop.value }/
@@ -4,7 +4,7 @@
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
6
6
  %li{ :'data-role' => 'list-divider'}=driver_symbol
7
- - @images.each do |image|
7
+ - elements.each do |image|
8
8
  %li
9
9
  %a{ :href => image_url(image.id), :'data-ajax' => 'false'}
10
10
  %img{ :class => 'ui-link-thumb', :src => '/images/image.png'}
@@ -1,5 +1,5 @@
1
1
  - unless defined?(partial)
2
2
  !!! XML
3
3
  %images
4
- - @elements.each do |c|
5
- = haml :'images/show', :locals => { :@image => c, :partial => true }
4
+ - elements.each do |c|
5
+ = haml :'images/show', :locals => { :image => c, :partial => true }
@@ -1,9 +1,9 @@
1
1
  =header "Create new image"
2
- =subheader "#{@instance.id}"
2
+ =subheader "#{instance.id}"
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c', :class => 'middle-dialog'}
5
5
  %form{ :action => images_url, :method => :post}
6
- %input{ :type => :hidden, :name => :instance_id, :value => @instance.id}
6
+ %input{ :type => :hidden, :name => :instance_id, :value => instance.id}
7
7
  %div{ 'data-role' => :fieldcontain }
8
8
  %label{ :for => :name} Name:
9
9
  %input{ :type => :text, :id => :name, :name => :name, :value => '' }
@@ -1,40 +1,40 @@
1
1
  =header "Image"
2
- =subheader @image.id
2
+ =subheader image.id
3
3
 
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'd'}
6
6
  %li{ :'data-role' => 'list-divider'} Name
7
7
  %li
8
- %p{ :'data-role' => 'fieldcontain'}=@image.name
8
+ %p{ :'data-role' => 'fieldcontain'}=image.name
9
9
  %li{ :'data-role' => 'list-divider'} Description
10
10
  %li
11
- %p{ :'data-role' => 'fieldcontain'}=@image.description
11
+ %p{ :'data-role' => 'fieldcontain'}=image.description
12
12
  %li{ :'data-role' => 'list-divider'} Owner
13
13
  %li
14
14
  %p{ :'data-role' => 'fieldcontain'}
15
- %a{ :href => images_url + "?owner_id=#{@image.owner_id}"}
16
- =@image.owner_id
15
+ %a{ :href => images_url + "?owner_id=#{image.owner_id}"}
16
+ =image.owner_id
17
17
  %li{ :'data-role' => 'list-divider'} State
18
18
  %li
19
- %p{ :'data-role' => 'fieldcontain'}=@image.state
20
- - if @image.creation_time
19
+ %p{ :'data-role' => 'fieldcontain'}=image.state
20
+ - if image.creation_time
21
21
  %li{ :'data-role' => 'list-divider'} Creation Time
22
22
  %li
23
- %p{ :'data-role' => 'fieldcontain'}=@image.creation_time
23
+ %p{ :'data-role' => 'fieldcontain'}=image.creation_time
24
24
  %li{ :'data-role' => 'list-divider'} Root Device Type
25
25
  %li
26
- %p{ :'data-role' => 'fieldcontain'}=@image.root_type
26
+ %p{ :'data-role' => 'fieldcontain'}=image.root_type
27
27
  %li{ :'data-role' => 'list-divider'} Architecture
28
28
  %li
29
- %p{ :'data-role' => 'fieldcontain'}=@image.architecture
30
- - if @image.hardware_profiles
29
+ %p{ :'data-role' => 'fieldcontain'}=image.architecture
30
+ - if image.hardware_profiles
31
31
  %li{ :'data-role' => 'list-divider'} Compatible Hardware Profiles
32
32
  %li
33
33
  %div{ :'data-role' => 'controlgroup', :'data-type' => "horizontal" }
34
- - @image.hardware_profiles.each do |hwp|
34
+ - image.hardware_profiles.each do |hwp|
35
35
  %a{ :href => url_for("hardware_profiles/#{hwp.id}"), :'data-role' => "button", :'data-ajax' => 'false'} #{hwp.name}
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...
40
- = link_to_action 'Destroy', destroy_image_url(@image.id), :delete
39
+ %a{ :href => url_for("instances/new?image_id=#{image.id}"), :'data-role' => "button", :'data-ajax' => 'false'} Launch...
40
+ = link_to_action 'Destroy', destroy_image_url(image.id), :delete
@@ -1,20 +1,20 @@
1
1
  - unless defined?(partial)
2
2
  !!! XML
3
- %image{:href => image_url(@image.id), :id => @image.id}
4
- %name=@image.name
5
- %description=@image.description
6
- %owner_id=@image.owner_id
7
- %architecture=@image.architecture
8
- - if @image.state
9
- %state=@image.state
10
- - if @image.creation_time
11
- %creation_time=@image.creation_time
12
- - if @image.hardware_profiles
3
+ %image{:href => image_url(image.id), :id => image.id}
4
+ %name=image.name
5
+ %description=image.description
6
+ %owner_id=image.owner_id
7
+ %architecture=image.architecture
8
+ - if image.state
9
+ %state=image.state
10
+ - if image.creation_time
11
+ %creation_time=image.creation_time
12
+ - if image.hardware_profiles
13
13
  %hardware_profiles
14
- - @image.hardware_profiles.each do |profile|
14
+ - image.hardware_profiles.each do |profile|
15
15
  %hardware_profile{ :href => hardware_profile_url(profile.id), :id => profile.id, :rel => :hardware_profile }
16
- %root_type=@image.root_type
16
+ %root_type=image.root_type
17
17
  %actions
18
- %link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{@image.id}"}
18
+ %link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{image.id}"}
19
19
  - if driver.respond_to? :destroy_image
20
- %link{ :rel => 'destroy_image', :method => :delete, :href => "#{destroy_image_url(@image.id)}" }
20
+ %link{ :rel => 'destroy_image', :method => :delete, :href => "#{destroy_image_url(image.id)}" }
@@ -5,7 +5,7 @@
5
5
  %img{ :src => url_for('instance_states?format=png') }
6
6
 
7
7
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-theme' => 'a'}
8
- - @machine.states.each do |state|
8
+ - machine.states.each do |state|
9
9
  %li{ :'data-role' => 'list-divider', :'class' => 'ui-bar-a', :'data-theme' => 'a'}=state
10
10
  - if state.transitions.empty?
11
11
  %li{ :'data-role' => 'list-divider'} Action
@@ -1,6 +1,6 @@
1
1
  digraph instance_states {
2
2
  rankdir=LR;
3
- <% for state in @machine.states do %>
3
+ <% for state in machine.states do %>
4
4
  <%= state %>
5
5
  [
6
6
  label="<%= state.to_s.titlecase %>",
@@ -23,7 +23,7 @@ digraph instance_states {
23
23
  ]
24
24
  <% end %>
25
25
 
26
- <% for state in @machine.states do %>
26
+ <% for state in machine.states do %>
27
27
  <% for transition in state.transitions do %>
28
28
  <%= state %> -> <%= transition.destination %>
29
29
  [
@@ -1,5 +1,5 @@
1
1
  %states
2
- - for state in @machine.states
2
+ - for state in machine.states
3
3
  %state{ :name=>state }
4
4
  - for transition in state.transitions
5
5
  - if ( transition.automatically? )
@@ -4,7 +4,7 @@
4
4
  %div{ :'data-role' => :content, :'data-theme' => 'c'}
5
5
  %ul{ :'data-role' => :listview , :'data-inset' => :true, :'data-divider-theme' => 'a'}
6
6
  %li{ :'data-role' => 'list-divider'}=driver_symbol
7
- - @elements.each do |instance|
7
+ - elements.each do |instance|
8
8
  %li
9
9
  %a{ :href => instance_url(instance.id), :'data-ajax' => 'false'}
10
10
  %img{ :class => 'ui-link-thumb', :src => '/images/machine.png'}