incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1149234 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
Date Thu, 21 Jul 2011 15:45:31 GMT
Author: marios
Date: Thu Jul 21 15:45:31 2011
New Revision: 1149234

URL: http://svn.apache.org/viewvc?rev=1149234&view=rev
Log:
Adds get and update blob metadata for ec2 driver

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb?rev=1149234&r1=1149233&r2=1149234&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/ec2/ec2_driver.rb Thu Jul 21
15:45:31 2011
@@ -424,6 +424,23 @@ module Deltacloud
           end
         end
 
+        def blob_metadata(credentials, opts={})
+          s3_client = new_client(credentials, :s3)
+          blob_meta = {}
+          safely do
+            the_blob = s3_client.bucket(opts['bucket']).key(opts[:id], true)
+            blob_meta = the_blob.meta_headers
+          end
+        end
+
+        def update_blob_metadata(credentials, opts={})
+          s3_client = new_client(credentials, :s3)
+          meta_hash = BlobHelper::rename_metadata_headers(opts['meta_hash'], '')
+          safely do
+            the_blob = s3_client.bucket(opts['bucket']).key(opts[:id])
+            the_blob.save_meta(meta_hash)
+          end
+        end
 
         def blob_data(credentials, bucket_id, blob_id, opts={})
           s3_client = new_client(credentials, :s3)



Mime
View raw message