From d6ed720b7f2794698e2f0713dc6d80432be08ba6 Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Wed, 15 Jun 2011 18:00:05 -0400 Subject: [PATCH] Add implementation for #put_object method. --- lib/fog/storage/requests/hp/put_object.rb | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/fog/storage/requests/hp/put_object.rb diff --git a/lib/fog/storage/requests/hp/put_object.rb b/lib/fog/storage/requests/hp/put_object.rb new file mode 100644 index 000000000..88a5fc1bf --- /dev/null +++ b/lib/fog/storage/requests/hp/put_object.rb @@ -0,0 +1,27 @@ +module Fog + module HP + class Storage + class Real + + # Create a new object + # + # ==== Parameters + # * container<~String> - Name for container, should be < 256 bytes and must not contain '/' + # + def put_object(container, object, data, options = {}) + data = Fog::Storage.parse_data(data) + headers = data[:headers].merge!(options) + response = request( + :body => data[:body], + :expects => 201, + :headers => headers, + :method => 'PUT', + :path => "#{URI.escape(container)}/#{URI.escape(object)}" + ) + response + end + + end + end + end +end