deltacloud-core 0.1.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. data/DISCLAIMER +8 -0
  2. data/{COPYING → LICENSE} +0 -0
  3. data/NOTICE +13 -0
  4. data/Rakefile +50 -51
  5. data/bin/deltacloudd +8 -1
  6. data/config.ru +0 -2
  7. data/config/drivers.yaml +48 -0
  8. data/deltacloud-core.gemspec +75 -0
  9. data/deltacloud.rb +3 -2
  10. data/lib/deltacloud/backend_capability.rb +15 -3
  11. data/lib/deltacloud/base_driver.rb +0 -2
  12. data/lib/deltacloud/base_driver/base_driver.rb +85 -89
  13. data/lib/deltacloud/base_driver/features.rb +61 -7
  14. data/lib/deltacloud/base_driver/mock_driver.rb +42 -43
  15. data/lib/deltacloud/core_ext.rb +18 -0
  16. data/lib/deltacloud/core_ext/integer.rb +31 -0
  17. data/lib/deltacloud/core_ext/string.rb +50 -0
  18. data/lib/deltacloud/drivers/azure/azure_driver.rb +71 -22
  19. data/lib/deltacloud/drivers/ec2/ec2_driver.rb +641 -584
  20. data/lib/deltacloud/drivers/ec2/ec2_mock_driver.rb +0 -2
  21. data/lib/deltacloud/drivers/eucalyptus/eucalyptus_driver.rb +167 -0
  22. data/lib/deltacloud/drivers/gogrid/gogrid_client.rb +39 -1
  23. data/lib/deltacloud/drivers/gogrid/gogrid_driver.rb +41 -25
  24. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob1.yml +6 -3
  25. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob2.yml +6 -3
  26. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob3.yml +4 -2
  27. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob4.yml +5 -2
  28. data/lib/deltacloud/drivers/mock/data/buckets/blobs/blob5.yml +4 -2
  29. data/lib/deltacloud/drivers/mock/data/instances/inst0.yml +1 -0
  30. data/lib/deltacloud/drivers/mock/data/instances/inst1.yml +1 -0
  31. data/lib/deltacloud/drivers/mock/data/instances/inst2.yml +1 -0
  32. data/lib/deltacloud/drivers/mock/data/storage_volumes/vol1.yml +1 -0
  33. data/lib/deltacloud/drivers/mock/data/storage_volumes/vol2.yml +1 -0
  34. data/lib/deltacloud/drivers/mock/data/storage_volumes/vol3.yml +1 -0
  35. data/lib/deltacloud/drivers/mock/mock_driver.rb +138 -30
  36. data/lib/deltacloud/drivers/opennebula/cloud_client.rb +13 -15
  37. data/lib/deltacloud/drivers/opennebula/occi_client.rb +13 -15
  38. data/lib/deltacloud/drivers/opennebula/opennebula_driver.rb +13 -15
  39. data/lib/deltacloud/drivers/rackspace/rackspace_driver.rb +224 -113
  40. data/lib/deltacloud/drivers/rhevm/rhevm_client.rb +332 -0
  41. data/lib/deltacloud/drivers/rhevm/rhevm_driver.rb +221 -170
  42. data/lib/deltacloud/drivers/rimuhosting/rimuhosting_driver.rb +0 -1
  43. data/lib/deltacloud/drivers/sbc/sbc_client.rb +247 -0
  44. data/lib/deltacloud/drivers/sbc/sbc_driver.rb +297 -0
  45. data/lib/deltacloud/drivers/terremark/terremark_driver.rb +0 -2
  46. data/lib/deltacloud/hardware_profile.rb +1 -3
  47. data/lib/deltacloud/helpers.rb +0 -2
  48. data/lib/deltacloud/helpers/application_helper.rb +86 -12
  49. data/lib/deltacloud/helpers/blob_stream.rb +19 -2
  50. data/lib/deltacloud/helpers/conversion_helper.rb +0 -2
  51. data/lib/deltacloud/helpers/hardware_profiles_helper.rb +0 -2
  52. data/lib/deltacloud/method_serializer.rb +0 -2
  53. data/lib/deltacloud/models/base_model.rb +0 -2
  54. data/lib/deltacloud/models/blob.rb +1 -2
  55. data/lib/deltacloud/models/bucket.rb +0 -2
  56. data/lib/deltacloud/models/image.rb +0 -2
  57. data/lib/deltacloud/models/instance.rb +19 -2
  58. data/lib/deltacloud/models/instance_profile.rb +4 -2
  59. data/lib/deltacloud/models/key.rb +0 -2
  60. data/lib/deltacloud/models/load_balancer.rb +0 -2
  61. data/lib/deltacloud/models/realm.rb +0 -2
  62. data/lib/deltacloud/models/storage_snapshot.rb +0 -2
  63. data/lib/deltacloud/models/storage_volume.rb +4 -2
  64. data/lib/deltacloud/runner.rb +132 -0
  65. data/lib/deltacloud/state_machine.rb +0 -2
  66. data/lib/deltacloud/validation.rb +9 -7
  67. data/lib/drivers.rb +36 -48
  68. data/lib/sinatra/accept_media_types.rb +26 -0
  69. data/lib/sinatra/lazy_auth.rb +16 -0
  70. data/lib/sinatra/rabbit.rb +112 -54
  71. data/lib/sinatra/rack_driver_select.rb +50 -16
  72. data/lib/sinatra/rack_etag.rb +79 -0
  73. data/lib/sinatra/rack_matrix_params.rb +84 -0
  74. data/lib/sinatra/rack_runtime.rb +47 -0
  75. data/lib/sinatra/static_assets.rb +16 -0
  76. data/lib/sinatra/url_for.rb +31 -4
  77. data/public/favicon.ico +0 -0
  78. data/public/images/bread-bg.png +0 -0
  79. data/public/images/error.png +0 -0
  80. data/public/images/pending.png +0 -0
  81. data/public/images/running.png +0 -0
  82. data/public/images/stopped.png +0 -0
  83. data/public/javascripts/application.js +35 -0
  84. data/public/stylesheets/compiled/application.css +59 -5
  85. data/public/stylesheets/compiled/screen.css +1 -1
  86. data/server.rb +293 -29
  87. data/support/fedora/deltacloud-core +78 -0
  88. data/support/fedora/deltacloud-core.spec +143 -0
  89. data/support/fedora/deltacloudd +78 -18
  90. data/support/fedora/rubygem-deltacloud-core.spec +76 -40
  91. data/tests/common.rb +172 -0
  92. data/tests/drivers/mock/api_test.rb +133 -0
  93. data/tests/drivers/mock/hardware_profiles_test.rb +134 -0
  94. data/tests/drivers/mock/images_test.rb +126 -0
  95. data/tests/drivers/mock/instance_states_test.rb +71 -0
  96. data/tests/drivers/mock/instances_test.rb +236 -0
  97. data/tests/drivers/mock/realms_test.rb +93 -0
  98. data/tests/drivers/mock/setup.rb +3 -0
  99. data/tests/drivers/mock/url_for_test.rb +67 -0
  100. data/tests/drivers/rackspace/api_test.rb +41 -0
  101. data/tests/drivers/rackspace/hardware_profiles_test.rb +53 -0
  102. data/tests/drivers/rackspace/images_test.rb +40 -0
  103. data/tests/drivers/rackspace/instances_test.rb +161 -0
  104. data/tests/drivers/rackspace/realms_test.rb +36 -0
  105. data/tests/drivers/rackspace/setup.rb +14 -0
  106. data/tests/drivers/rhevm/api_test.rb +39 -0
  107. data/tests/drivers/rhevm/hardware_profiles_test.rb +53 -0
  108. data/tests/drivers/rhevm/images_test.rb +42 -0
  109. data/tests/drivers/rhevm/instances_test.rb +179 -0
  110. data/tests/drivers/rhevm/realms_test.rb +35 -0
  111. data/tests/drivers/rhevm/setup.rb +14 -0
  112. data/tests/rabbit_test.rb +52 -0
  113. data/views/api/show.html.haml +2 -5
  114. data/views/blobs/new.html.haml +17 -1
  115. data/views/blobs/show.html.haml +6 -0
  116. data/views/blobs/show.xml.haml +5 -1
  117. data/views/buckets/index.html.haml +1 -12
  118. data/views/buckets/index.xml.haml +3 -5
  119. data/views/docs/operation.html.haml +23 -11
  120. data/views/drivers/index.html.haml +15 -0
  121. data/views/drivers/index.xml.haml +7 -0
  122. data/views/drivers/show.html.haml +20 -0
  123. data/views/drivers/show.xml.haml +7 -0
  124. data/views/error.html.haml +31 -0
  125. data/views/errors/auth_exception.xml.haml +2 -1
  126. data/views/errors/backend_capability_failure.xml.haml +2 -1
  127. data/views/errors/backend_error.html.haml +3 -0
  128. data/views/errors/backend_error.xml.haml +2 -2
  129. data/views/errors/validation_failure.xml.haml +3 -2
  130. data/views/images/index.html.haml +1 -6
  131. data/views/images/index.xml.haml +2 -0
  132. data/views/images/new.html.haml +14 -0
  133. data/views/images/show.xml.haml +2 -0
  134. data/views/instances/index.html.haml +8 -6
  135. data/views/instances/index.xml.haml +4 -0
  136. data/views/instances/new.html.haml +40 -11
  137. data/views/instances/run.html.haml +9 -0
  138. data/views/instances/run.xml.haml +7 -0
  139. data/views/instances/run_command.html.haml +16 -0
  140. data/views/instances/show.html.haml +14 -0
  141. data/views/instances/show.xml.haml +12 -4
  142. data/views/layout.html.haml +7 -2
  143. data/views/load_balancers/index.html.haml +1 -1
  144. data/views/load_balancers/new.html.haml +2 -2
  145. data/views/load_balancers/show.html.haml +1 -1
  146. data/views/storage_snapshots/index.html.haml +3 -0
  147. data/views/storage_snapshots/new.html.haml +9 -0
  148. data/views/storage_volumes/attach.html.haml +20 -0
  149. data/views/storage_volumes/index.html.haml +16 -1
  150. data/views/storage_volumes/index.xml.haml +1 -10
  151. data/views/storage_volumes/new.html.haml +17 -0
  152. data/views/storage_volumes/show.html.haml +8 -0
  153. data/views/storage_volumes/show.xml.haml +25 -3
  154. metadata +197 -127
  155. data/lib/deltacloud/drivers/rackspace/rackspace_client.rb +0 -130
  156. data/parse.rb +0 -7
  157. data/test.rb +0 -3
  158. data/views/api/drivers.xml.haml +0 -6
@@ -0,0 +1,7 @@
1
+ %drivers
2
+ - @drivers.each do |id, details|
3
+ %driver{ :href => driver_url(id), :id => id }
4
+ %name<
5
+ =details[:name]
6
+ - driver_provider(details).keys.each do |prov|
7
+ %provider{ :id => prov }
@@ -0,0 +1,20 @@
1
+ %h1
2
+ Details for driver #{@name}
3
+
4
+ %dl
5
+ %di
6
+ %dt ID
7
+ %dd= @name
8
+ %di
9
+ %dt Name
10
+ %dd= @driver[:name]
11
+ %di
12
+ %dt Provider
13
+ %dd
14
+ - providers = driver_provider(@driver).keys.collect { |k| k.to_s }.sort
15
+ - if providers.empty?
16
+ None
17
+ - else
18
+ %ol
19
+ - providers.each do |k|
20
+ %li= k
@@ -0,0 +1,7 @@
1
+ %driver{ :href => driver_url(@name), :id => @name }
2
+ %name<
3
+ = @driver[:name]
4
+ - driver_provider(@driver).each do |prov, details|
5
+ %provider{ :id => prov }
6
+ - details.each do |kind, url|
7
+ %entrypoint{ :kind => kind }<=cdata(url)
@@ -0,0 +1,31 @@
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{:class => :error}
19
+ = yield
20
+ #footer
21
+ #formats
22
+ Format:
23
+ =link_to_format(:xml)
24
+ |
25
+ =link_to_format(:json)
26
+ #driver_info
27
+ Driver: #{driver_symbol} | API version: #{settings.version}
28
+ #copyright
29
+ Copyright 2009-2011
30
+ %a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
31
+ and individual contributors.
@@ -1,2 +1,3 @@
1
1
  %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
- %message #{@error.message}
2
+ %message< #{cdata @error.message}
3
+
@@ -1,4 +1,5 @@
1
1
  %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
2
  %capability #{@error.capability}
3
- %message #{@error.message}
3
+ %message< #{cdata @error.message}
4
+
4
5
 
@@ -6,6 +6,9 @@
6
6
  %di
7
7
  %dt Request URL
8
8
  %dd= request.env['REQUEST_URI']
9
+ %di
10
+ %dt Parameters
11
+ %dd= params.inspect
9
12
  %di
10
13
  %dt Code
11
14
  %dd= @error.code
@@ -4,5 +4,5 @@
4
4
  %code= @error.code
5
5
  %cause= @error.cause
6
6
  - if @error.details
7
- %details #{@error.details}
8
- %message #{@error.message}
7
+ %details< #{cdata @error.details.join("\n")}
8
+ %message< #{cdata @error.message}
@@ -1,7 +1,8 @@
1
1
  %error{:url => "#{request.env['REQUEST_URI']}", :status => "#{response.status}"}
2
2
  %parameter #{@error.name}
3
- %message #{@error.message}
3
+ %message< #{cdata @error.message}
4
4
  - unless @error.param.options.empty?
5
5
  %valid_options
6
6
  - @error.param.options.each do |v|
7
- %value #{v}
7
+ %value< #{cdata v}
8
+
@@ -1,5 +1,4 @@
1
- %h1
2
- Images
1
+ %h1 Images
3
2
 
4
3
  %table.display
5
4
  %thead
@@ -10,8 +9,6 @@
10
9
  Name
11
10
  %th
12
11
  Owner
13
- %th
14
- Architecture
15
12
  %th
16
13
  Description
17
14
  %tbody
@@ -23,8 +20,6 @@
23
20
  = image.name
24
21
  %td
25
22
  = link_to image.owner_id, images_url
26
- %td
27
- = image.architecture
28
23
  %td
29
24
  = image.description
30
25
 
@@ -9,4 +9,6 @@
9
9
  - haml_concat image.send(attribute)
10
10
  - else
11
11
  - haml_concat image.send(attribute)
12
+ %actions
13
+ %link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{image.id}"}
12
14
 
@@ -0,0 +1,14 @@
1
+ %h1 Create image from #{@instance.id}
2
+
3
+ %form{ :action => images_url, :method => :post, :class => :new_instance }
4
+ %input{ :name => :instance_id, :type => :hidden, :value => @instance.id }/
5
+ %p
6
+ %label
7
+ Name:
8
+ %input{ :name => :name, :size => 30, :type => :text }/
9
+ %p
10
+ %label
11
+ Description:
12
+ %textarea{ :name => :description, :cols => 70, :rows => 20}
13
+ %p
14
+ %input{ :type => :submit, :value => 'Create' }
@@ -3,3 +3,5 @@
3
3
  - @image.attributes.select{ |attr| attr!=:id }.each do |attribute|
4
4
  - haml_tag(attribute, :<) do
5
5
  - haml_concat @image.send(attribute)
6
+ %actions
7
+ %link{ :rel => 'create_instance', :method => :post, :href => "#{instances_url};image_id=#{@image.id}"}
@@ -7,24 +7,26 @@
7
7
  %th Owner
8
8
  %th Name
9
9
  %th Image
10
- %th Realm
10
+ %th Profile
11
11
  %th State
12
12
  %th Actions
13
13
  %tbody
14
14
  - @instances.each do |instance|
15
15
  %tr
16
16
  %td
17
- = link_to instance.id, instance_url( instance.id )
17
+ = link_to truncate_words(instance.id), instance_url( instance.id )
18
18
  %td
19
- = link_to instance.owner_id, images_url
19
+ = link_to instance.owner_id, "#{instances_url}?owner_id=#{instance.owner_id}"
20
20
  %td
21
21
  = instance.name
22
22
  %td
23
- = link_to instance.image_id, image_url( instance.image_id )
23
+ = link_to truncate_words(instance.image_id), image_url( instance.image_id )
24
24
  %td
25
- = instance.realm_id ? link_to(instance.realm_id, realm_url( instance.realm_id )) : 'default'
25
+ = instance.hardware_profile ? link_to(instance.hardware_profile, hardware_profile_url( instance.instance_profile.id )) : 'default'
26
26
  %td
27
- = instance.state
27
+ = image_for_state(instance.state)
28
28
  %td
29
29
  -instance.actions.each do |action|
30
30
  =link_to_action action, self.send(:"#{action}_instance_url", instance.id), instance_action_method(action)
31
+ - if driver.respond_to?(:run_on_instance) and instance.state=="RUNNING"
32
+ =link_to_action "Run command", url_for("/api/instances/#{instance.id}/run"), :get
@@ -13,6 +13,10 @@
13
13
  %actions
14
14
  - instance.actions.compact.each do |action|
15
15
  %link{:rel => action, :href => self.send("#{action}_instance_url", instance.id), :method => instance_action_method(action)}
16
+ - if driver.respond_to?(:run_on_instance)
17
+ %link{:rel => 'run', :method => :post, :href => run_instance_url(instance.id)}
18
+ - if instance.can_create_image?
19
+ %link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{instance.id}"}
16
20
  %public_addresses
17
21
  - instance.public_addresses.each do |address|
18
22
  %address #{address}
@@ -1,27 +1,40 @@
1
- %h1 New Instance
1
+ %h1 Launch new Instance
2
2
 
3
+ %h3{:class => "description"}= @image.description
3
4
  %h2= @image.id
4
- %h3= @image.description
5
5
 
6
- %form{ :action => instances_url, :method => :post }
6
+ %form{ :action => instances_url, :method => :post, :class => :new_instance }
7
7
  %input{ :name => :image_id, :type => :hidden, :value => @instance.image_id }/
8
8
  %p
9
9
  %label
10
- Instance Name:
11
- %input{ :name => 'name', :size => 30 }/
10
+ Name:
11
+ %input{ :name => 'name', :size => 30, :type => :text }/
12
+ -if driver_has_feature?(:instance_count)
13
+ %p
14
+ %label
15
+ Number of instances:
16
+ %input{ :type => :text, :value => "1", :name => :instance_count }
17
+ -if driver_has_feature?(:sandboxing)
18
+ %p
19
+ %label
20
+ Sandbox?:
21
+ %input{ :type => :checkbox, :value => "1", :name => :sandbox }
12
22
  -if driver_has_feature?(:register_to_load_balancer)
13
23
  %p
14
24
  %label
15
- Assign to load balancer:
16
- %select{:name => 'load_balancer_id'}
17
- %option{:value => ""}
18
- - @load_balancers.each do |load_balancer|
19
- %option{:value => load_balancer.id} #{load_balancer.id}
25
+ Load balancer to assign:
26
+ %select{:name => 'load_balancer_id'}
27
+ %option
28
+ - @load_balancers.each do |load_balancer|
29
+ %option{:value => load_balancer.id} #{load_balancer.id}
20
30
  -if driver_has_feature?(:authentication_key)
21
31
  %p
22
32
  %label
23
33
  Instance Keyname:
24
- %input{:name => 'keyname', :size => 30 }
34
+ %select{:name => 'keyname'}
35
+ %option
36
+ - @keys.each do |key|
37
+ %option{ :value => key.id } #{key.id}
25
38
  - if !@hardware_profiles.empty?
26
39
  %h3 What size machine?
27
40
  - for hwp in @hardware_profiles
@@ -60,4 +73,20 @@
60
73
  %br/
61
74
  %span.radio-group-details
62
75
  = "#{realm.name}, #{realm.limit}"
76
+ - if driver_has_feature?(:user_files, :instances)
77
+ %h2 User-supplied files
78
+ %table
79
+ %thead
80
+ %tr
81
+ %th
82
+ %th Path
83
+ %th Content (must be base64 encoded)
84
+ %tbody
85
+ - 1.upto(5) do |i|
86
+ %tr
87
+ %td #{i.ordinalize} File:
88
+ %td
89
+ %input{ :name => "path#{i}", :size => 20 }
90
+ %td
91
+ %input{ :name => "content#{i}", :size => 50 }
63
92
  %input{ :type => :submit, :name => "commit", :value => "create" }/
@@ -0,0 +1,9 @@
1
+ %h1 Run command on instance #{params[:id]}
2
+
3
+ %p
4
+ %label Command:
5
+ %em #{@output.ssh.command}
6
+ %p
7
+ %strong Command output
8
+ %pre
9
+ =@output.body
@@ -0,0 +1,7 @@
1
+ %instance{:id => params[:id], :href=> instance_url(params[:id])}
2
+ %public_address
3
+ =@output.ssh.network.ip
4
+ %command
5
+ =@output.ssh.command
6
+ %output<
7
+ =@output.body
@@ -0,0 +1,16 @@
1
+ %h1
2
+ Run command on
3
+ = @instance.id
4
+
5
+ %form{ :action => run_instance_url(@instance.id), :method => :post }
6
+ %p
7
+ %label{ :for => :cmd } Desired command:
8
+ %input{ :name => :cmd, :value => "", :type => :text}
9
+ %p
10
+ %label{ :for => :private_key } Private key:
11
+ %p
12
+ %small Leave private key blank if using password authentication method
13
+ %p
14
+ %textarea{ :name => :private_key, :cols => 65, :rows => 20 }
15
+ %p
16
+ %input{ :type => :submit, :value => "Execute" }
@@ -36,8 +36,22 @@
36
36
  %dt Private Addresses
37
37
  %dd
38
38
  = @instance.private_addresses.collect { |address| "<div>#{address}</div>" }.join
39
+ - if @instance.password
40
+ %di
41
+ %dt Username
42
+ %dd
43
+ = @instance.username
44
+ %di
45
+ %dt Password
46
+ %dd
47
+ = @instance.password
39
48
  %di
40
49
  %dt
41
50
  %dd
42
51
  -@instance.actions.each do |action|
43
52
  =link_to_action action, self.send(:"#{action}_instance_url", @instance.id), instance_action_method(action)
53
+ %dt
54
+ %dd
55
+ - if @instance.can_create_image?
56
+ =link_to_action 'Create Image', url_for("/api/images/new?instance_id=#{@instance.id}"), :get
57
+
@@ -21,16 +21,24 @@
21
21
  %actions
22
22
  - @instance.actions.compact.each do |instance_action|
23
23
  %link{:rel => instance_action, :method => instance_action_method(instance_action), :href => self.send("#{instance_action}_instance_url", @instance.id)}
24
+ - if driver.respond_to?(:run_on_instance)
25
+ %link{:rel => 'run', :method => :post, :href => "#{run_instance_url(@instance.id)};id=#{@instance.id}"}
26
+ - if @instance.can_create_image?
27
+ %link{:rel => 'create_image', :method => :post, :href => "#{create_image_url};instance_id=#{@instance.id}"}
24
28
  - if @instance.instance_variables.include?("@launch_time")
25
29
  %launch_time<
26
30
  =@instance.launch_time
27
31
  - if @instance.public_addresses
28
- %public_addresses
32
+ %public_addresses<
29
33
  - @instance.public_addresses.each do |address|
30
- %address<
31
- =address
34
+ - if address.class.eql?(Hash) and address[:address]!=""
35
+ %address{ :port => address[:port], :type => address[:type], :mac => address[:mac] }<
36
+ =address[:address]
37
+ - elsif address.class.eql?(String)
38
+ %address<
39
+ =address
32
40
  - if @instance.private_addresses
33
- %private_addresses
41
+ %private_addresses<
34
42
  - @instance.private_addresses.each do |address|
35
43
  %address<
36
44
  =address
@@ -18,9 +18,14 @@
18
18
  #content
19
19
  = yield
20
20
  #footer
21
+ #formats
22
+ Format:
23
+ =link_to_format(:xml)
24
+ |
25
+ =link_to_format(:json)
21
26
  #driver_info
22
27
  Driver: #{driver_symbol} | API version: #{settings.version}
23
28
  #copyright
24
- Copyright 2009, 2010
25
- %a{:href => 'http://redhat.com'} Red Hat
29
+ Copyright 2009-2011
30
+ %a{:href => 'http://incubator.apache.org/deltacloud/'} The Apache Software Foundation
26
31
  and individual contributors.
@@ -17,7 +17,7 @@
17
17
  %td
18
18
  = balancer.public_addresses.first
19
19
  %td
20
- = link_to balancer.realms.first.id, realm_url( balancer.realms.first.id )
20
+ =link_to balancer.realms.first.id, realm_url( balancer.realms.first.id )
21
21
  %td
22
22
  - balancer.listeners.each do |listener|
23
23
  ="#{listener.protocol}[#{listener.load_balancer_port}]<br/>"
@@ -28,11 +28,11 @@
28
28
  %p
29
29
  %label
30
30
  Load balancer port:
31
- %input{ :name => "listener_lbr_port", :size => 30}
31
+ %input{ :name => "listener_balancer_port", :size => 30}
32
32
  %p
33
33
  %label
34
34
  Instances port:
35
- %input{ :name => "listener_inst_port", :size => 30}
35
+ %input{ :name => "listener_instance_port", :size => 30}
36
36
  %p
37
37
  %input{ :type => :submit, :name => "commit", :value => "create" }/
38
38
 
@@ -25,7 +25,7 @@
25
25
  - @load_balancer.instances.each do |inst|
26
26
  %dd
27
27
  =inst.id
28
- =link_to_action, 'Delete', unregister_load_balancer_url(@load_balancer.id, :instance_id => inst.id), :post
28
+ =link_to_action 'Delete', unregister_load_balancer_url(@load_balancer.id, :instance_id => inst.id), :post
29
29
 
30
30
  %form{:action => url_for("/api/load_balancers/#{@load_balancer.id}/register"), :method => :post}
31
31
  %p
@@ -7,6 +7,7 @@
7
7
  %th Volume
8
8
  %th Created
9
9
  %th State
10
+ %th Actions
10
11
  %tbody
11
12
  - @storage_snapshots.each do |snapshot|
12
13
  %tr
@@ -18,3 +19,5 @@
18
19
  = snapshot.created
19
20
  %td
20
21
  = snapshot.state
22
+ %td
23
+ = link_to_action "Delete", destroy_storage_snapshot_url(snapshot.id), :delete