Sha256: 67dc43a68be9d100977b1df1b71a6a3194fa0dc663c8c8c7b6af80e05f1e1615
Contents?: true
Size: 1.28 KB
Versions: 61
Compression:
Stored size: 1.28 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 = {}) read_h = options['X-Container-Read'] || '' write_h = options['X-Container-Write'] || '' unless options read_acl, write_acl = self.class.header_to_perm_acl(read_h, write_h) self.data[:acls][:container][container_name] = {:read_acl => read_acl, :write_acl => write_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
61 entries across 61 versions & 6 rubygems