You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/07/09 01:45:44 UTC
svn commit: r962315 - in /incubator/deltacloud/trunk/server:
features/instances.feature lib/deltacloud/helpers/application_helper.rb
views/instances/index.xml.haml views/instances/show.xml.haml
Author: lutter
Date: Thu Jul 8 23:45:44 2010
New Revision: 962315
URL: http://svn.apache.org/viewvc?rev=962315&view=rev
Log:
Added HTTP method reporting for instance actions
Modified:
incubator/deltacloud/trunk/server/features/instances.feature
incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb
incubator/deltacloud/trunk/server/views/instances/index.xml.haml
incubator/deltacloud/trunk/server/views/instances/show.xml.haml
Modified: incubator/deltacloud/trunk/server/features/instances.feature
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/features/instances.feature?rev=962315&r1=962314&r2=962315&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/features/instances.feature (original)
+++ incubator/deltacloud/trunk/server/features/instances.feature Thu Jul 8 23:45:44 2010
@@ -85,6 +85,7 @@ Feature: Managing instances
And each instance should have actions
And each actions should have some links
And each link should have valid href attribute
+ And each link should have valid method attribute
And each link should have valid rel attribute
Scenario: Reboot instance
Modified: incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb?rev=962315&r1=962314&r2=962315&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/helpers/application_helper.rb Thu Jul 8 23:45:44 2010
@@ -35,4 +35,13 @@ module ApplicationHelper
end
s+="</ul>"
end
+
+ def instance_action_method(action)
+ collections[:instances].operations[action.to_sym].method
+ end
+
+ def driver_has_feature?(feature_name)
+ not driver.features(:instances).select{ |f| f.name.eql?(feature_name) }.empty?
+ end
+
end
Modified: incubator/deltacloud/trunk/server/views/instances/index.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instances/index.xml.haml?rev=962315&r1=962314&r2=962315&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instances/index.xml.haml (original)
+++ incubator/deltacloud/trunk/server/views/instances/index.xml.haml Thu Jul 8 23:45:44 2010
@@ -14,10 +14,10 @@
%property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
%actions
- instance.actions.compact.each do |action|
- %link{:rel => action, :href => self.send("#{action}_instance_url", instance.id)}
- - haml_tag :"public-addresses" do
+ %link{:rel => action, :href => self.send("#{action}_instance_url", instance.id), :method => instance_action_method(action)}
+ %public-addresses
- instance.public_addresses.each do |address|
%address #{address}
- - haml_tag :"private-addresses" do
+ %private-addresses
- instance.private_addresses.each do |address|
%address #{address}
Modified: incubator/deltacloud/trunk/server/views/instances/show.xml.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instances/show.xml.haml?rev=962315&r1=962314&r2=962315&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instances/show.xml.haml (original)
+++ incubator/deltacloud/trunk/server/views/instances/show.xml.haml Thu Jul 8 23:45:44 2010
@@ -17,12 +17,12 @@
%property{:kind => 'fixed', :name => p, :value => v, :unit => Deltacloud::HardwareProfile::unit(p)}
%actions
- @instance.actions.compact.each do |instance_action|
- %link{:rel => instance_action, :href => self.send("#{instance_action}_instance_url", @instance.id)}
- - haml_tag :"public-addresses" do
+ %link{:rel => instance_action, :method => instance_action_method(instance_action), :href => self.send("#{instance_action}_instance_url", @instance.id)}
+ %public-addresses
- @instance.public_addresses.each do |address|
%address<
=address
- - haml_tag :"private-addresses" do
+ %private-addresses
- @instance.private_addresses.each do |address|
%address<
=address