incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@redhat.com
Subject [PATCH] Adds get and update blob metadata for ec2 driver:
Date Thu, 14 Jul 2011 14:58:33 GMT
From: marios <marios@redhat.com>


Signed-off-by: marios <marios@redhat.com>
---
 server/lib/deltacloud/drivers/ec2/ec2_driver.rb |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
index 45032d6..175e4ca 100644
--- a/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
+++ b/server/lib/deltacloud/drivers/ec2/ec2_driver.rb
@@ -415,6 +415,24 @@ 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
+          blob_meta
+        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)
-- 
1.7.3.4


Mime
View raw message