mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add implementation for #put_object method.
This commit is contained in:
parent
127484adbf
commit
d6ed720b7f
1 changed files with 27 additions and 0 deletions
27
lib/fog/storage/requests/hp/put_object.rb
Normal file
27
lib/fog/storage/requests/hp/put_object.rb
Normal file
|
@ -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
|
Loading…
Reference in a new issue