From 3274dc6b7cae9f704076c542effbf5cff972e7ed Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Fri, 26 Oct 2012 01:47:48 -0400 Subject: [PATCH] Add request layer method for put_shared_container. --- .../requests/storage/put_shared_container.rb | 40 +++++++++++++++++++ lib/fog/hp/storage.rb | 1 + 2 files changed, 41 insertions(+) create mode 100644 lib/fog/hp/requests/storage/put_shared_container.rb diff --git a/lib/fog/hp/requests/storage/put_shared_container.rb b/lib/fog/hp/requests/storage/put_shared_container.rb new file mode 100644 index 000000000..571eefa6a --- /dev/null +++ b/lib/fog/hp/requests/storage/put_shared_container.rb @@ -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 diff --git a/lib/fog/hp/storage.rb b/lib/fog/hp/storage.rb index 6f964d0a8..8563af284 100644 --- a/lib/fog/hp/storage.rb +++ b/lib/fog/hp/storage.rb @@ -33,6 +33,7 @@ module Fog request :head_shared_container request :head_shared_object request :put_container + request :put_shared_container request :put_object request :put_shared_object