2013-04-23 22:41:51 -04:00
|
|
|
module Fog
|
|
|
|
module Storage
|
|
|
|
class HP
|
|
|
|
class Real
|
|
|
|
|
2013-04-24 11:24:01 -04:00
|
|
|
# Create or update metadata for an existing container
|
2013-04-23 22:41:51 -04:00
|
|
|
#
|
|
|
|
# ==== Parameters
|
2013-04-24 11:24:01 -04:00
|
|
|
# * container<~String> - Name for existing container, should be < 256 bytes and must not contain '/'
|
|
|
|
# * headers<~Hash> - Hash of metadata name/value pairs
|
2013-04-23 22:41:51 -04:00
|
|
|
def post_container(container, headers = {})
|
|
|
|
response = request(
|
|
|
|
:expects => 204,
|
|
|
|
:headers => headers,
|
|
|
|
:method => 'POST',
|
2013-04-24 11:24:01 -04:00
|
|
|
:path => Fog::HP.escape(container)
|
2013-04-23 22:41:51 -04:00
|
|
|
)
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock # :nodoc:all
|
|
|
|
|
2013-04-24 11:24:01 -04:00
|
|
|
def post_container(container_name, headers = {})
|
2013-04-23 22:41:51 -04:00
|
|
|
if self.data[:containers][container_name].nil?
|
|
|
|
raise Fog::Storage::HP::NotFound
|
|
|
|
end
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 204
|
|
|
|
response
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|