2010-03-19 21:29:42 -04:00
|
|
|
module Fog
|
2011-06-15 17:26:43 -04:00
|
|
|
module Storage
|
|
|
|
class Rackspace
|
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 '/'
|
2011-06-24 19:00:44 -04:00
|
|
|
# * object<~String> - Name for object
|
|
|
|
# * data<~String|File> - data to upload
|
|
|
|
# * options<~Hash> - config headers for object. Defaults to {}.
|
2009-10-31 13:59:50 -04:00
|
|
|
#
|
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)
|
2011-06-15 17:26:43 -04:00
|
|
|
request(
|
2012-02-14 12:29:48 -05:00
|
|
|
:body => data[:body],
|
|
|
|
:expects => 201,
|
|
|
|
:idempotent => true,
|
|
|
|
:headers => headers,
|
|
|
|
:method => 'PUT',
|
|
|
|
:path => "#{Fog::Rackspace.escape(container)}/#{Fog::Rackspace.escape(object)}"
|
2009-10-31 13:59:50 -04:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|