deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core] Core: Added missing :with_capability options (DTACLOUD-298)
Date Wed, 01 Aug 2012 12:37:45 GMT
From: Michal Fojtik <mfojtik@redhat.com>

Without this option the DC will fail to check required capability
and end with exception.

Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/collections/load_balancers.rb  |    8 ++++----
 server/lib/deltacloud/collections/storage_volumes.rb |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/server/lib/deltacloud/collections/load_balancers.rb b/server/lib/deltacloud/collections/load_balancers.rb
index 2a10311..f560f16 100644
--- a/server/lib/deltacloud/collections/load_balancers.rb
+++ b/server/lib/deltacloud/collections/load_balancers.rb
@@ -41,7 +41,7 @@ module Deltacloud::Collections
         end
       end
 
-      operation :create do
+      operation :create, :with_capability => :create_load_balancer do
         param :name,  :string,  :required
         param :realm_id,  :string,  :required
         param :listener_protocol,  :string,  :required, ['HTTP', 'TCP']
@@ -59,7 +59,7 @@ module Deltacloud::Collections
         end
       end
 
-      action :register do
+      action :register, :with_capability => :lb_register_instance do
         param :instance_id, :string,  :required
         control do
           driver.lb_register_instance(credentials, params)
@@ -72,7 +72,7 @@ module Deltacloud::Collections
         end
       end
 
-      action :unregister do
+      action :unregister, :with_capability => :lb_unregister_instance do
         param :instance_id, :string,  :required
         control do
           driver.lb_unregister_instance(credentials, params)
@@ -85,7 +85,7 @@ module Deltacloud::Collections
         end
       end
 
-      operation :destroy do
+      operation :destroy, :with_capability => :destroy_load_balancer do
         control do
           driver.destroy_load_balancer(credentials, params[:id])
           status 204
diff --git a/server/lib/deltacloud/collections/storage_volumes.rb b/server/lib/deltacloud/collections/storage_volumes.rb
index 147c4c1..dde5e32 100644
--- a/server/lib/deltacloud/collections/storage_volumes.rb
+++ b/server/lib/deltacloud/collections/storage_volumes.rb
@@ -37,7 +37,7 @@ module Deltacloud::Collections
         control { show(:storage_volume) }
       end
 
-      operation :create do
+      operation :create, :with_capability => :create_storage_volume do
         param :snapshot_id, :string,  :optional
         param :capacity,    :string,  :optional
         param :realm_id,    :string,  :optional
-- 
1.7.10.2


Mime
View raw message