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 '/'
|
|
|
|
#
|
|
|
|
def put_object(container, object, data)
|
2010-06-12 18:31:17 -04:00
|
|
|
data = parse_data(data)
|
2009-10-31 13:59:50 -04:00
|
|
|
response = storage_request(
|
|
|
|
:body => data[:body],
|
|
|
|
:expects => 201,
|
2009-11-04 00:46:27 -05:00
|
|
|
:headers => data[:headers],
|
2009-10-31 13:59:50 -04:00
|
|
|
:method => 'PUT',
|
|
|
|
:path => "#{CGI.escape(container)}/#{CGI.escape(object)}"
|
|
|
|
)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2010-03-19 21:29:42 -04:00
|
|
|
class Mock
|
2009-10-31 13:59:50 -04:00
|
|
|
|
2010-02-02 01:53:18 -05:00
|
|
|
def put_object(container, object, data)
|
2010-05-26 20:38:23 -04:00
|
|
|
Fog::Mock.not_implemented
|
2009-10-31 13:59:50 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|