mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Add request layer method for put_shared_container.
This commit is contained in:
parent
98413b3e87
commit
3274dc6b7c
2 changed files with 41 additions and 0 deletions
40
lib/fog/hp/requests/storage/put_shared_container.rb
Normal file
40
lib/fog/hp/requests/storage/put_shared_container.rb
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
module Fog
|
||||||
|
module Storage
|
||||||
|
class HP
|
||||||
|
class Real
|
||||||
|
|
||||||
|
# Update a shared container
|
||||||
|
#
|
||||||
|
# ==== Parameters
|
||||||
|
# * shared_container_url<~String> - Shared url for the container
|
||||||
|
# * options<~Hash> - header options
|
||||||
|
#
|
||||||
|
def put_shared_container(shared_container_url, options = {})
|
||||||
|
# split up the shared container url
|
||||||
|
uri = URI.parse(shared_container_url)
|
||||||
|
path = uri.path
|
||||||
|
|
||||||
|
response = shared_request(
|
||||||
|
:expects => [201, 202],
|
||||||
|
:headers => options,
|
||||||
|
:method => 'PUT',
|
||||||
|
:path => path
|
||||||
|
)
|
||||||
|
response
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Mock # :nodoc:all
|
||||||
|
|
||||||
|
def put_shared_container(shared_container_url, options = {})
|
||||||
|
response = Excon::Response.new
|
||||||
|
response.status = 201
|
||||||
|
response.headers.merge!(options)
|
||||||
|
response
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -33,6 +33,7 @@ module Fog
|
||||||
request :head_shared_container
|
request :head_shared_container
|
||||||
request :head_shared_object
|
request :head_shared_object
|
||||||
request :put_container
|
request :put_container
|
||||||
|
request :put_shared_container
|
||||||
request :put_object
|
request :put_object
|
||||||
request :put_shared_object
|
request :put_shared_object
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue