2010-03-19 21:29:42 -04:00
|
|
|
module Fog
|
|
|
|
module Rackspace
|
2010-09-08 16:50:23 -04:00
|
|
|
class Storage
|
2010-03-19 21:29:42 -04:00
|
|
|
class Real
|
2009-10-31 13:59:50 -04:00
|
|
|
|
|
|
|
# Create a new object
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * container<~String> - Name for container, should be < 256 bytes and must not contain '/'
|
|
|
|
#
|
2010-10-07 14:10:01 -04:00
|
|
|
def put_object(container, object, data, options = {})
|
2011-03-10 16:04:42 -05:00
|
|
|
data = Fog::Storage.parse_data(data)
|
2010-10-07 14:10:01 -04:00
|
|
|
headers = data[:headers].merge!(options)
|
2010-11-01 14:50:30 -04:00
|
|
|
response = request(
|
2009-10-31 13:59:50 -04:00
|
|
|
:body => data[:body],
|
|
|
|
:expects => 201,
|
2010-10-07 14:10:01 -04:00
|
|
|
:headers => headers,
|
2009-10-31 13:59:50 -04:00
|
|
|
:method => 'PUT',
|
|
|
|
:path => "#{CGI.escape(container)}/#{CGI.escape(object)}"
|
|
|
|
)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|