Sha256: b496387c8a4c6e838bfdc4bd79e536a3a79206d86c400e76c0da0942515eee13
Contents?: true
Size: 1.25 KB
Versions: 18
Compression:
Stored size: 1.25 KB
Contents
module Fog module Storage class HP class Real # Create a new container # # ==== Parameters # * name<~String> - Name for container, should be < 256 bytes and must not contain '/' # def put_container(name, options = {}) response = request( :expects => [201, 202], :headers => options, :method => 'PUT', :path => Fog::HP.escape(name) ) response end end class Mock # :nodoc:all def put_container(container_name, options = {}) acl = options['X-Container-Read'] || 'private' if !['private', 'public-read'].include?(acl) #raise Excon::Errors::BadRequest.new('invalid X-Container-Read') else self.data[:acls][:container][container_name] = self.class.acls(acl) end response = Excon::Response.new container = { :objects => {}, } if self.data[:containers][container_name] response.status = 202 else response.status = 201 self.data[:containers][container_name] = container end response end end end end end
Version data entries
18 entries across 18 versions & 8 rubygems