steamcannon-deltacloud-core 0.0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. data/COPYING +176 -0
  2. data/Rakefile +106 -0
  3. data/bin/deltacloudd +120 -0
  4. data/config.ru +5 -0
  5. data/deltacloud.rb +20 -0
  6. data/lib/deltacloud/base_driver/base_driver.rb +259 -0
  7. data/lib/deltacloud/base_driver/features.rb +173 -0
  8. data/lib/deltacloud/base_driver/mock_driver.rb +58 -0
  9. data/lib/deltacloud/base_driver.rb +20 -0
  10. data/lib/deltacloud/drivers/azure/azure_driver.rb +127 -0
  11. data/lib/deltacloud/drivers/ec2/ec2_driver.rb +580 -0
  12. data/lib/deltacloud/drivers/ec2/ec2_mock_driver.rb +170 -0
  13. data/lib/deltacloud/drivers/gogrid/gogrid_client.rb +50 -0
  14. data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +343 -0
  15. data/lib/deltacloud/drivers/gogrid/test.rb +13 -0
  16. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob1.yml +5 -0
  17. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob2.yml +5 -0
  18. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob3.yml +5 -0
  19. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob4.yml +5 -0
  20. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob5.yml +5 -0
  21. data/lib/deltacloud/drivers/mock/data/buckets/bucket1.yml +2 -0
  22. data/lib/deltacloud/drivers/mock/data/buckets/bucket2.yml +2 -0
  23. data/lib/deltacloud/drivers/mock/data/images/img1.yml +3 -0
  24. data/lib/deltacloud/drivers/mock/data/images/img2.yml +3 -0
  25. data/lib/deltacloud/drivers/mock/data/images/img3.yml +3 -0
  26. data/lib/deltacloud/drivers/mock/data/instances/inst0.yml +16 -0
  27. data/lib/deltacloud/drivers/mock/data/instances/inst1.yml +9 -0
  28. data/lib/deltacloud/drivers/mock/data/instances/inst2.yml +9 -0
  29. data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap1.yml +4 -0
  30. data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap2.yml +4 -0
  31. data/lib/deltacloud/drivers/mock/data/storage_snapshots/snap3.yml +4 -0
  32. data/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml +6 -0
  33. data/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml +6 -0
  34. data/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml +6 -0
  35. data/lib/deltacloud/drivers/mock/mock_driver.rb +356 -0
  36. data/lib/deltacloud/drivers/opennebula/cloud_client.rb +116 -0
  37. data/lib/deltacloud/drivers/opennebula/occi_client.rb +204 -0
  38. data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +241 -0
  39. data/lib/deltacloud/drivers/rackspace/rackspace_client.rb +130 -0
  40. data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +290 -0
  41. data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +258 -0
  42. data/lib/deltacloud/drivers/rimuhosting/rimuhosting_client.rb +85 -0
  43. data/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb +166 -0
  44. data/lib/deltacloud/drivers/terremark/terremark_driver.rb +295 -0
  45. data/lib/deltacloud/hardware_profile.rb +153 -0
  46. data/lib/deltacloud/helpers/application_helper.rb +122 -0
  47. data/lib/deltacloud/helpers/blob_stream.rb +51 -0
  48. data/lib/deltacloud/helpers/conversion_helper.rb +39 -0
  49. data/lib/deltacloud/helpers/hardware_profiles_helper.rb +35 -0
  50. data/lib/deltacloud/helpers.rb +5 -0
  51. data/lib/deltacloud/method_serializer.rb +85 -0
  52. data/lib/deltacloud/models/base_model.rb +59 -0
  53. data/lib/deltacloud/models/blob.rb +26 -0
  54. data/lib/deltacloud/models/bucket.rb +24 -0
  55. data/lib/deltacloud/models/image.rb +27 -0
  56. data/lib/deltacloud/models/instance.rb +38 -0
  57. data/lib/deltacloud/models/instance_profile.rb +48 -0
  58. data/lib/deltacloud/models/key.rb +35 -0
  59. data/lib/deltacloud/models/realm.rb +26 -0
  60. data/lib/deltacloud/models/storage_snapshot.rb +27 -0
  61. data/lib/deltacloud/models/storage_volume.rb +28 -0
  62. data/lib/deltacloud/state_machine.rb +84 -0
  63. data/lib/deltacloud/validation.rb +70 -0
  64. data/lib/drivers.rb +51 -0
  65. data/lib/sinatra/accept_media_types.rb +128 -0
  66. data/lib/sinatra/lazy_auth.rb +56 -0
  67. data/lib/sinatra/rabbit.rb +279 -0
  68. data/lib/sinatra/respond_to.rb +238 -0
  69. data/lib/sinatra/static_assets.rb +83 -0
  70. data/lib/sinatra/url_for.rb +53 -0
  71. data/public/favicon.ico +0 -0
  72. data/public/images/grid.png +0 -0
  73. data/public/images/logo-wide.png +0 -0
  74. data/public/images/rails.png +0 -0
  75. data/public/images/topbar-bg.png +0 -0
  76. data/public/javascripts/application.js +32 -0
  77. data/public/javascripts/jquery-1.4.2.min.js +154 -0
  78. data/public/stylesheets/compiled/application.css +613 -0
  79. data/public/stylesheets/compiled/ie.css +31 -0
  80. data/public/stylesheets/compiled/print.css +27 -0
  81. data/public/stylesheets/compiled/screen.css +456 -0
  82. data/server.rb +516 -0
  83. data/support/fedora/deltacloudd +68 -0
  84. data/support/fedora/rubygem-deltacloud-core.spec +91 -0
  85. data/tests/api_test.rb +37 -0
  86. data/tests/hardware_profiles_test.rb +120 -0
  87. data/tests/images_test.rb +111 -0
  88. data/tests/instance_states_test.rb +51 -0
  89. data/tests/instances_test.rb +222 -0
  90. data/tests/realms_test.rb +78 -0
  91. data/tests/url_for_test.rb +50 -0
  92. data/views/accounts/index.html.haml +11 -0
  93. data/views/accounts/show.html.haml +30 -0
  94. data/views/api/show.html.haml +15 -0
  95. data/views/api/show.xml.haml +5 -0
  96. data/views/blobs/show.html.haml +20 -0
  97. data/views/blobs/show.xml.haml +7 -0
  98. data/views/buckets/index.html.haml +33 -0
  99. data/views/buckets/index.xml.haml +10 -0
  100. data/views/buckets/new.html.haml +13 -0
  101. data/views/buckets/show.html.haml +19 -0
  102. data/views/buckets/show.xml.haml +8 -0
  103. data/views/docs/collection.html.haml +37 -0
  104. data/views/docs/collection.xml.haml +14 -0
  105. data/views/docs/index.html.haml +15 -0
  106. data/views/docs/index.xml.haml +5 -0
  107. data/views/docs/operation.html.haml +31 -0
  108. data/views/docs/operation.xml.haml +10 -0
  109. data/views/errors/auth_exception.html.haml +8 -0
  110. data/views/errors/auth_exception.xml.haml +2 -0
  111. data/views/errors/backend_error.html.haml +19 -0
  112. data/views/errors/backend_error.xml.haml +8 -0
  113. data/views/errors/not_found.html.haml +6 -0
  114. data/views/errors/not_found.xml.haml +2 -0
  115. data/views/errors/validation_failure.html.haml +11 -0
  116. data/views/errors/validation_failure.xml.haml +7 -0
  117. data/views/hardware_profiles/index.html.haml +25 -0
  118. data/views/hardware_profiles/index.xml.haml +4 -0
  119. data/views/hardware_profiles/show.html.haml +19 -0
  120. data/views/hardware_profiles/show.xml.haml +18 -0
  121. data/views/images/index.html.haml +30 -0
  122. data/views/images/index.xml.haml +8 -0
  123. data/views/images/show.html.haml +21 -0
  124. data/views/images/show.xml.haml +5 -0
  125. data/views/instance_states/show.html.haml +31 -0
  126. data/views/instance_states/show.png.erb +45 -0
  127. data/views/instance_states/show.xml.haml +8 -0
  128. data/views/instances/index.html.haml +30 -0
  129. data/views/instances/index.xml.haml +21 -0
  130. data/views/instances/new.html.haml +55 -0
  131. data/views/instances/show.html.haml +43 -0
  132. data/views/instances/show.xml.haml +49 -0
  133. data/views/keys/index.html.haml +26 -0
  134. data/views/keys/index.xml.haml +4 -0
  135. data/views/keys/new.html.haml +8 -0
  136. data/views/keys/show.html.haml +22 -0
  137. data/views/keys/show.xml.haml +20 -0
  138. data/views/layout.html.haml +26 -0
  139. data/views/realms/index.html.haml +29 -0
  140. data/views/realms/index.xml.haml +10 -0
  141. data/views/realms/show.html.haml +15 -0
  142. data/views/realms/show.xml.haml +9 -0
  143. data/views/root/index.html.haml +4 -0
  144. data/views/storage_snapshots/index.html.haml +20 -0
  145. data/views/storage_snapshots/index.xml.haml +9 -0
  146. data/views/storage_snapshots/show.html.haml +14 -0
  147. data/views/storage_snapshots/show.xml.haml +7 -0
  148. data/views/storage_volumes/index.html.haml +21 -0
  149. data/views/storage_volumes/index.xml.haml +23 -0
  150. data/views/storage_volumes/show.html.haml +20 -0
  151. data/views/storage_volumes/show.xml.haml +24 -0
  152. metadata +409 -0
@@ -0,0 +1,55 @@
1
+ %h1 New Instance
2
+
3
+ %h2= @image.id
4
+ %h3= @image.description
5
+
6
+ %form{ :action => instances_url, :method => :post }
7
+ %input{ :name => :image_id, :type => :hidden, :value => @instance.image_id }/
8
+ %p
9
+ %label
10
+ Instance Name:
11
+ %input{ :name => 'name', :size => 30 }/
12
+ -if driver_has_feature?(:authentication_key)
13
+ %p
14
+ %label
15
+ Instance Keyname:
16
+ %input{:name => 'keyname', :size => 30 }
17
+ - if !@hardware_profiles.empty?
18
+ %h3 What size machine?
19
+ - for hwp in @hardware_profiles
20
+ .radio-group
21
+ %label{ :for => "hwp_id_#{hwp.name}" }
22
+ %input{ :type => :radio, :name => 'hwp_id', :value => hwp.name }/
23
+ = hwp.name
24
+ %br/
25
+ %span.radio-group-details
26
+ - first = true
27
+ - hwp.properties.select { |prop| prop.fixed? }.each do |prop|
28
+ - unless first
29
+ ,
30
+ - first = false
31
+ = format_hardware_property prop
32
+ - hwp.properties.reject { |prop| prop.fixed? }.each do |prop|
33
+ %span.radio-group-details
34
+ %label{ :for => "#{prop.param}_#{hwp.name}" }
35
+ = prop.name
36
+ - if prop.kind == :enum
37
+ %select{ :size => 1, :name => prop.param }
38
+ - for v in prop.values
39
+ %option= v
40
+ = prop.unit
41
+ - else
42
+ %input{ :name => prop.param, :size => 10, :value => "#{prop.default}" }
43
+ = prop.unit
44
+ (value must be between #{prop.first} #{prop.unit} and #{prop.last} #{prop.unit})
45
+ - if !@realms.empty?
46
+ %h3 Where do you want it?
47
+ - for realm in @realms
48
+ .radio-group
49
+ %label{ :for => "realm_id_#{realm.id}" }
50
+ %input{ :type => :radio, :name => 'realm_id', :value => realm.id }/
51
+ = realm.id
52
+ %br/
53
+ %span.radio-group-details
54
+ = "#{realm.name}, #{realm.limit}"
55
+ %input{ :type => :submit, :name => "commit", :value => "create" }/
@@ -0,0 +1,43 @@
1
+ %h1
2
+ = @instance.id
3
+
4
+ %dl
5
+ %di
6
+ %dt Image
7
+ %dd
8
+ = link_to @instance.image_id, image_url( @instance.image_id )
9
+ %di
10
+ %dt Owner
11
+ %dd
12
+ = @instance.owner_id
13
+ %di
14
+ %dt Name
15
+ %dd
16
+ = @instance.name
17
+ %di
18
+ %dt Hardware Profile
19
+ %dd
20
+ - prof = @instance.instance_profile
21
+ = link_to(prof.name, hardware_profile_url(prof.name))
22
+ = format_instance_profile(prof)
23
+ %di
24
+ %dt Realm
25
+ %dd
26
+ = @instance.realm_id ? link_to(@instance.realm_id, realm_url(@instance.realm_id)) : 'default'
27
+ %di
28
+ %dt State
29
+ %dd
30
+ = @instance.state
31
+ %di
32
+ %dt Public Addresses
33
+ %dd
34
+ = @instance.public_addresses.collect { |address| "<div>#{address}</div>" }.join
35
+ %di
36
+ %dt Private Addresses
37
+ %dd
38
+ = @instance.private_addresses.collect { |address| "<div>#{address}</div>" }.join
39
+ %di
40
+ %dt
41
+ %dd
42
+ -@instance.actions.each do |action|
43
+ =link_to action, self.send(:"#{action}_instance_url", @instance.id), :class => instance_action_method(action)
@@ -0,0 +1,49 @@
1
+ !!! XML
2
+ %instance{:href => instance_url(@instance.id), :id => @instance.id}
3
+ - if @instance.name
4
+ %name<
5
+ =@instance.name
6
+ - if @instance.owner_id
7
+ %owner_id<
8
+ =@instance.owner_id
9
+ - if @instance.image_id
10
+ %image{:href => image_url(@instance.image_id), :id => @instance.image_id }
11
+ - if @instance.realm_id
12
+ %realm{:href => realm_url(@instance.realm_id), :id => @instance.realm_id }
13
+ - if @instance.state
14
+ %state<
15
+ =@instance.state
16
+ - if @instance.instance_profile
17
+ - haml_tag :"hardware_profile", {:id => @instance.instance_profile.id, :href => hardware_profile_url(@instance.instance_profile.id)} do
18
+ - @instance.instance_profile.overrides.each do |p, v|
19
+ %property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
20
+ - if @instance.actions
21
+ %actions
22
+ - @instance.actions.compact.each do |instance_action|
23
+ %link{:rel => instance_action, :method => instance_action_method(instance_action), :href => self.send("#{instance_action}_instance_url", @instance.id)}
24
+ - if @instance.instance_variables.include?("@launch_time")
25
+ %launch_time<
26
+ =@instance.launch_time
27
+ - if @instance.public_addresses
28
+ %public_addresses
29
+ - @instance.public_addresses.each do |address|
30
+ %address<
31
+ =address
32
+ - if @instance.private_addresses
33
+ %private_addresses
34
+ - @instance.private_addresses.each do |address|
35
+ %address<
36
+ =address
37
+ - if driver_has_auth_features?
38
+ %authentication{ :type => driver_auth_feature_name }
39
+ - if @instance.authn_feature_failed?
40
+ %error #{@instance.authn_error}
41
+ - else
42
+ - if driver_auth_feature_name == 'password'
43
+ %login
44
+ %username #{@instance.username}
45
+ %password #{@instance.password}
46
+ - if driver_auth_feature_name == 'key'
47
+ %login
48
+ %keyname #{@instance.keyname}
49
+
@@ -0,0 +1,26 @@
1
+ %h1 Keys
2
+
3
+ %table.display
4
+ %thead
5
+ %tr
6
+ %th ID
7
+ %th Credentials details
8
+ %th Actions
9
+ %tbody
10
+ - @elements.each do |key|
11
+ %tr
12
+ %td
13
+ = link_to key.id, key_url( key.id )
14
+ %td
15
+ - if key.credential_type.eql?(:key)
16
+ = key.fingerprint
17
+ - if key.credential_type.eql?(:password)
18
+ = "#{key.username} - #{key.password}"
19
+ %td
20
+ - if driver.respond_to?(:destroy_key)
21
+ =link_to 'Destroy', destroy_key_url(key.id), :class => 'delete'
22
+ %tfoot
23
+ - if driver.respond_to?(:create_key)
24
+ %tr
25
+ %td{:colspan => 3, :style => "text-align:right;"}
26
+ =link_to 'Create &raquo;', "#{url_for('/api/keys/new')}", :class => 'button'
@@ -0,0 +1,4 @@
1
+ !!!XML
2
+ %keys
3
+ - @elements.each do |c|
4
+ = haml :'keys/show', :locals => { :@key => c, :partial => true }
@@ -0,0 +1,8 @@
1
+ %h1 New key
2
+
3
+ %form{ :action => '/api/keys', :method => :post }
4
+ %p
5
+ %label
6
+ Name:
7
+ %input{ :name => 'name', :size => 30 }/
8
+ %input{ :type => :submit, :name => "commit", :value => "create" }/
@@ -0,0 +1,22 @@
1
+ %h1
2
+ = @key.id
3
+
4
+ %dl
5
+ - if @key.is_key?
6
+ %di
7
+ %dt Fingerprint
8
+ %dd
9
+ = @key.fingerprint
10
+ - if @key.pem_rsa_key
11
+ %dt PEM key
12
+ %dd
13
+ %pre
14
+ = @key.pem_rsa_key
15
+ - if @key.is_password?
16
+ %di
17
+ %dt Username
18
+ %dd
19
+ = @key.username
20
+ %dt Password
21
+ %dd
22
+ = @key.password
@@ -0,0 +1,20 @@
1
+ - unless defined?(partial)
2
+ !!! XML
3
+ %key{ :href => key_url(@key.id), :id => @key.id, :type => "#{@key.credential_type}" }
4
+ %actions
5
+ - if driver.respond_to?(:destroy_key)
6
+ %link{ :rel => "destroy", :method => "delete", :href => destroy_key_url(@key.id)}
7
+ - if @key.is_key?
8
+ %fingerprint<
9
+ =@key.fingerprint
10
+ - unless @key.pem_rsa_key.nil?
11
+ %pem<
12
+ =cdata do
13
+ =@key.pem_rsa_key
14
+ - if @key.is_password?
15
+ %username<
16
+ =cdata do
17
+ =@key.username
18
+ %password<
19
+ =cdata do
20
+ =@key.password
@@ -0,0 +1,26 @@
1
+ !!!
2
+ !!! XML
3
+
4
+ %html
5
+ %head
6
+ = stylesheet_link_tag '/stylesheets/compiled/screen.css', :media => 'screen, projection'
7
+ = stylesheet_link_tag '/stylesheets/compiled/print.css', :media => 'print'
8
+ /[if lt IE 8]
9
+ = stylesheet_link_tag '/stylesheets/compiled/ie.css', :media => 'screen, projection'
10
+ = stylesheet_link_tag '/stylesheets/compiled/application.css', :media => 'screen, projection'
11
+ %script{:type => "text/javascript", :src => "/javascripts/jquery-1.4.2.min.js" }
12
+ %script{:type => "text/javascript", :src => "/javascripts/application.js" }
13
+ %body
14
+ #wrapper
15
+ #header
16
+ = link_to image_tag( "/images/logo-wide.png" ), root_url
17
+ = bread_crumb
18
+ #content
19
+ = yield
20
+ #footer
21
+ #driver_info
22
+ Driver: #{DRIVER}
23
+ #copyright
24
+ Copyright 2009, 2010
25
+ %a{:href => 'http://redhat.com'} Red Hat
26
+ and individual contributors.
@@ -0,0 +1,29 @@
1
+ %h1
2
+ Realms
3
+
4
+ %table.display
5
+ %thead
6
+ %tr
7
+ %th
8
+ Name
9
+ %th
10
+ Architecture
11
+ %th
12
+ Memory
13
+ %th
14
+ Storage
15
+ %th
16
+ Mutable
17
+ %tbody
18
+ - @realms.each do |realm|
19
+ %tr
20
+ %td
21
+ = link_to realm.id, realm_url( realm.id )
22
+ %td
23
+ = realm.name
24
+ %td
25
+ = realm.state
26
+ %td
27
+ = realm.limit
28
+ %td
29
+
@@ -0,0 +1,10 @@
1
+ !!!XML
2
+ %realms
3
+ - @elements.each do |realm|
4
+ %realm{:href => realm_url(realm.id), :id => realm.id }
5
+ %name<
6
+ =realm.name
7
+ %state<
8
+ =realm.state
9
+ %limit<
10
+ =realm.limit.eql?(:unlimited) ? '' : realm.limit
@@ -0,0 +1,15 @@
1
+ %h1
2
+ = @realm.id
3
+ %dl
4
+ %di
5
+ %dt Name
6
+ %dd
7
+ = @realm.name
8
+ %di
9
+ %dt State
10
+ %dd
11
+ = @realm.state
12
+ %di
13
+ %dt Limit
14
+ %dd
15
+ = @realm.limit
@@ -0,0 +1,9 @@
1
+ !!!XML
2
+ %realm{:href => realm_url(@realm.id), :id => @realm.id }
3
+ %name<
4
+ =@realm.name
5
+ %state<
6
+ =@realm.state
7
+ - unless @realm.limit.eql?(:unlimited)
8
+ %limit<
9
+ =@realm.limit
@@ -0,0 +1,4 @@
1
+ %h1
2
+ Deltacloud:
3
+ = DRIVER.to_s.titlecase
4
+ = link_to 'API', api_url
@@ -0,0 +1,20 @@
1
+ %h1 Storage Snapshots
2
+
3
+ %table
4
+ %thead
5
+ %tr
6
+ %th ID
7
+ %th Volume
8
+ %th Created
9
+ %th State
10
+ %tbody
11
+ - @storage_snapshots.each do |snapshot|
12
+ %tr
13
+ %td
14
+ = link_to snapshot.id, storage_snapshot_url( snapshot.id )
15
+ %td
16
+ = link_to snapshot.storage_volume_id, storage_volume_url( snapshot.storage_volume_id )
17
+ %td
18
+ = snapshot.created
19
+ %td
20
+ = snapshot.state
@@ -0,0 +1,9 @@
1
+ !!!XML
2
+ %storage_snapshots
3
+ - @elements.each do |snapshot|
4
+ %storage_snapshot{ :href => storage_snapshot_url(snapshot.id), :id => snapshot.id }
5
+ %created<
6
+ =snapshot.created
7
+ %state<
8
+ =snapshot.state
9
+ %storage_volume{ :href => storage_volume_url(snapshot.storage_volume_id), :id => snapshot.storage_volume_id }
@@ -0,0 +1,14 @@
1
+ %h1
2
+ = @storage_snapshot.id
3
+
4
+ %dl
5
+ %di
6
+ %dt Volume
7
+ %dd
8
+ = @storage_snapshot.storage_volume_id
9
+ %dt Created
10
+ %dd
11
+ = @storage_snapshot.created
12
+ %dt State
13
+ %dd
14
+ = @storage_snapshot.state
@@ -0,0 +1,7 @@
1
+ !!!XML
2
+ %storage_snapshot{:href => storage_snapshot_url(@storage_snapshot.id), :id => @storage_snapshot.id }
3
+ %created<
4
+ =@storage_snapshot.created
5
+ %state<
6
+ =@storage_snapshot.state
7
+ %storage_volume{:href => storage_volume_url(@storage_snapshot.storage_volume_id), :id => @storage_snapshot.storage_volume_id}
@@ -0,0 +1,21 @@
1
+ %h1 Storage Volumes
2
+
3
+ %table.display
4
+ %thead
5
+ %tr
6
+ %th ID
7
+ %th Created
8
+ %th Capacity
9
+ %th Status
10
+ %tbody
11
+ - @storage_volumes.each do |volume|
12
+ %tr
13
+ %td
14
+ = link_to volume.id, storage_volume_url( volume.id )
15
+ %td
16
+ = volume.created
17
+ %td
18
+ = "#{volume.capacity} GB"
19
+ %td
20
+ = "#{volume.state}"
21
+
@@ -0,0 +1,23 @@
1
+ !!!XML
2
+ %storage_volumes
3
+ - @elements.each do |volume|
4
+ %storage_volume{ :href => storage_volume_url(volume.id), :id => volume.id }
5
+ %created<
6
+ =volume.created
7
+ %capacity<
8
+ =volume.capacity
9
+ %state<
10
+ =volume.state
11
+ %device<
12
+ =volume.device
13
+ %instance_id<
14
+ =volume.instance_id
15
+ - unless volume.instance_id.nil?
16
+ %instance{:href => instance_url(volume.instance_id), :id => volume.instance_id}
17
+ %actions
18
+ - if driver.respond_to?(:destroy_storage_volume)
19
+ %link{ :rel => "destroy", :method => "delete", :href => destroy_storage_volume_url(volume.id)}
20
+ - if driver.respond_to?(:attach_storage_volume)
21
+ %link{ :rel => "attach", :method => "post", :href => attach_storage_volume_url(volume.id)}
22
+ - if driver.respond_to?(:detach_storage_volume)
23
+ %link{ :rel => "detach", :method => "post", :href => detach_storage_volume_url(volume.id)}
@@ -0,0 +1,20 @@
1
+ %h1
2
+ = @storage_volume.id
3
+
4
+ %dl
5
+ %di
6
+ %dt Created
7
+ %dd
8
+ = @storage_volume.created
9
+ %di
10
+ %dt Capacity
11
+ %dd
12
+ = "#{@storage_volume.capacity} GB"
13
+ %di
14
+ %dt State
15
+ %dd
16
+ = @storage_volume.state
17
+ %di
18
+ %dt Attached
19
+ %dd
20
+ = link_to(@storage_volume.instance_id, instance_url( @storage_volume.instance_id)) + ' - ' + @storage_volume.device.to_s if @storage_volume.instance_id
@@ -0,0 +1,24 @@
1
+ !!!XML
2
+ %storage_volume{ :href => storage_volume_url(@storage_volume.id), :id => @storage_volume.id}
3
+ %created<
4
+ =@storage_volume.created
5
+ %capacity<
6
+ =@storage_volume.capacity
7
+ %device<
8
+ =@storage_volume.device
9
+ %state<
10
+ =@storage_volume.state
11
+ %device<
12
+ =@storage_volume.device
13
+ %instance_id<
14
+ =@storage_volume.instance_id
15
+ - unless @storage_volume.instance_id.nil?
16
+ %instance{:href => instance_url(@storage_volume.instance_id), :id => @storage_volume.instance_id}
17
+ %actions
18
+ - if driver.respond_to?(:destroy_storage_volume)
19
+ %link{ :rel => "destroy", :method => "delete", :href => destroy_storage_volume_url(@storage_volume.id)}
20
+ - if driver.respond_to?(:attach_storage_volume)
21
+ %link{ :rel => "attach", :method => "post", :href => attach_storage_volume_url(@storage_volume.id)}
22
+ - if driver.respond_to?(:detach_storage_volume)
23
+ %link{ :rel => "detach", :method => "post", :href => detach_storage_volume_url(@storage_volume.id)}
24
+