deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [1/2] git commit: Various fixes in Deltacloud collection.
Date Thu, 27 Sep 2012 07:18:24 GMT
Updated Branches:
  refs/heads/master 97db199f9 -> e6cdb2184


Various fixes in Deltacloud collection.

Having documentation generator reveals that many
collection that has 'not standard' methods, does
not define the :id parameters.

Since this parameter is part of the URI it is not
a big problem, but for completeness of API we should
have them defined.


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/6bf6c48a
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/6bf6c48a
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/6bf6c48a

Branch: refs/heads/master
Commit: 6bf6c48ad464cb5f41150158dccded2bac77418f
Parents: 97db199
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Mon Sep 24 14:16:14 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Thu Sep 27 09:18:45 2012 +0200

----------------------------------------------------------------------
 server/lib/deltacloud/collections/addresses.rb     |    2 ++
 server/lib/deltacloud/collections/buckets.rb       |   12 +++++++++++-
 server/lib/deltacloud/collections/instances.rb     |    4 ++++
 .../lib/deltacloud/collections/load_balancers.rb   |    2 ++
 .../lib/deltacloud/collections/storage_volumes.rb  |    6 ++----
 5 files changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6bf6c48a/server/lib/deltacloud/collections/addresses.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/addresses.rb b/server/lib/deltacloud/collections/addresses.rb
index 664b80d..aa51abe 100644
--- a/server/lib/deltacloud/collections/addresses.rb
+++ b/server/lib/deltacloud/collections/addresses.rb
@@ -60,6 +60,7 @@ module Deltacloud::Collections
 
       action :associate, :with_capability => :associate_address do
         description "Associate an IP address to an instance"
+        param :id, :string, :required
         param :instance_id, :string, :required
         control do
           driver.associate_address(credentials, { :id => params[:id], :instance_id =>
params[:instance_id]})
@@ -74,6 +75,7 @@ module Deltacloud::Collections
 
       action :disassociate, :with_capability => :associate_address do
         description "Disassociate an IP address from an instance"
+        param :id, :string, :required
         control do
           driver.disassociate_address(credentials, { :id => params[:id] })
           status 202   # Accepted

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6bf6c48a/server/lib/deltacloud/collections/buckets.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/buckets.rb b/server/lib/deltacloud/collections/buckets.rb
index 1b00033..c503926 100644
--- a/server/lib/deltacloud/collections/buckets.rb
+++ b/server/lib/deltacloud/collections/buckets.rb
@@ -120,6 +120,7 @@ module Deltacloud::Collections
       collection :blobs, :with_id => :blob_id, :no_member => true do
 
         operation :show, :with_capability => :blob do
+          param :blob_id, :string, :required
           control do
             @blob = driver.blob(credentials, { :id => params[:blob_id], 'bucket' =>
params[:id]} )
             if @blob
@@ -137,6 +138,7 @@ module Deltacloud::Collections
 
         operation :create, :with_capability => :create_blob do
           description "Create new blob"
+          param :id, :string, :required, 'The bucket ID'
           param :blob_id,  :string,  :required
           param :blob_data, :hash, :required
           control do
@@ -165,6 +167,7 @@ module Deltacloud::Collections
         end
 
         operation :destroy, :with_capability => :delete_blob do
+          param :blob_id, :string, :required, 'The id of the blob to destroy'
           control do
             bucket_id = params[:id]
             blob_id = params[:blob_id]
@@ -180,6 +183,8 @@ module Deltacloud::Collections
 
         action :stream, :http_method => :put, :with_capability => :create_blob do
           description "Stream new blob data into the blob"
+          param :id, :string, :required
+          param :blob_id, :string, :required
           control do
             if(env["BLOB_SUCCESS"]) #ie got a 200ok after putting blob
               content_type = env["CONTENT_TYPE"]
@@ -215,6 +220,8 @@ module Deltacloud::Collections
         end
 
         action :metadata, :http_method => :head, :with_capability => :blob_metadata
do
+          param :id, :string, :required
+          param :blob_id, :string, :required
           control do
             @blob_id = params[:blob_id]
             @blob_metadata = driver.blob_metadata(credentials, {:id => params[:blob_id],
'bucket' => params[:id]})
@@ -234,10 +241,11 @@ module Deltacloud::Collections
         end
 
         action :update, :http_method => :post, :with_capability => :update_blob_metadata
do
+          param :blob_id, :string, :required
           control do
             meta_hash = BlobHelper::extract_blob_metadata_hash(request.env)
             success = driver.update_blob_metadata(credentials, {'bucket'=>params[:id],
:id =>params[:blob_id], 'meta_hash' => meta_hash})
-           if(success)
+            if(success)
               meta_hash.each do |k,v|
                 headers["X-Deltacloud-Blobmeta-#{k}"] = v
               end
@@ -254,6 +262,8 @@ module Deltacloud::Collections
 
         action :content, :http_method => :get, :with_capability => :blob do
           description "Download blob content"
+          param :id, :string, :required
+          param :blob_id, :string, :required
           control do
             @blob = driver.blob(credentials, { :id => params[:blob_id], 'bucket' =>
params[:id]})
             if @blob

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6bf6c48a/server/lib/deltacloud/collections/instances.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/instances.rb b/server/lib/deltacloud/collections/instances.rb
index f7d2646..ce536ce 100644
--- a/server/lib/deltacloud/collections/instances.rb
+++ b/server/lib/deltacloud/collections/instances.rb
@@ -77,16 +77,19 @@ module Deltacloud::Collections
 
       action :reboot, :with_capability => :reboot_instance do
         description "Reboot a running instance."
+        param :id, :string, :required
         control { instance_action(:reboot) }
       end
 
       action :start, :with_capability => :start_instance do
         description "Start an instance."
+        param :id, :string, :required
         control { instance_action(:start) }
       end
 
       action :stop, :with_capability => :stop_instance do
         description "Stop a running instance."
+        param :id, :string, :required
         control { instance_action(:stop) }
       end
 
@@ -95,6 +98,7 @@ module Deltacloud::Collections
       end
 
       action :run, :with_capability => :run_on_instance do
+        param :id,          :string,  :required
         param :cmd,         :string,  :required, [], "Shell command to run on instance"
         param :private_key, :string,  :optional, [], "Private key in PEM format for authentication"
         param :password,    :string,  :optional, [], "Password used for authentication"

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6bf6c48a/server/lib/deltacloud/collections/load_balancers.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/load_balancers.rb b/server/lib/deltacloud/collections/load_balancers.rb
index c26db91..b2c7023 100644
--- a/server/lib/deltacloud/collections/load_balancers.rb
+++ b/server/lib/deltacloud/collections/load_balancers.rb
@@ -60,6 +60,7 @@ module Deltacloud::Collections
       end
 
       action :register, :with_capability => :lb_register_instance do
+        param :id, :string, :required
         param :instance_id, :string,  :required
         control do
           driver.lb_register_instance(credentials, params)
@@ -73,6 +74,7 @@ module Deltacloud::Collections
       end
 
       action :unregister, :with_capability => :lb_unregister_instance do
+        param :id, :string, :required
         param :instance_id, :string,  :required
         control do
           driver.lb_unregister_instance(credentials, params)

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/6bf6c48a/server/lib/deltacloud/collections/storage_volumes.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/collections/storage_volumes.rb b/server/lib/deltacloud/collections/storage_volumes.rb
index 53d646d..0b52045 100644
--- a/server/lib/deltacloud/collections/storage_volumes.rb
+++ b/server/lib/deltacloud/collections/storage_volumes.rb
@@ -33,10 +33,6 @@ module Deltacloud::Collections
       standard_index_operation
       standard_show_operation
 
-      operation :show, :with_capability => :storage_volume do
-        control { show(:storage_volume) }
-      end
-
       operation :create, :with_capability => :create_storage_volume do
         param :snapshot_id, :string,  :optional
         param :capacity,    :string,  :optional
@@ -54,6 +50,7 @@ module Deltacloud::Collections
       end
 
       action :attach, :with_capability => :attach_storage_volume do
+        param :id, :string, :required
         param :instance_id,:string,  :required
         param :device,     :string,  :required
         control do
@@ -68,6 +65,7 @@ module Deltacloud::Collections
       end
 
       action :detach, :with_capability => :detach_storage_volume do
+        param :id, :string, :required
         control do
           volume = driver.storage_volume(credentials, :id => params[:id])
           @storage_volume =  driver.detach_storage_volume(credentials, :id => volume.id,


Mime
View raw message