Sha256: 605c2b83a482131fa77e76e18fb85bf1c6839e018f618873c49bac84bf0b2800

Contents?: true

Size: 1.07 KB

Versions: 60

Compression:

Stored size: 1.07 KB

Contents

module Fog
  module Storage
    class Softlayer
      class Mock
        def delete_container(name)
          response = Excon::Response.new
          if @containers[name].nil? # Container doesn't exist.
            response.body = '<html><h1>Not Found</h1><p>The resource could not be found.</p></html>'
            response.status = 404
          elsif @containers[name].length > 0  # Container not empty
            response.body = '<html><h1>Conflict</h1><p>There was a conflict when trying to complete your request.</p></html>'
            response.status = 409
          else # Success
            response.body = ''
            response.status = 204
          end
          response
        end
      end

      class Real
        # Delete an existing container
        #
        # ==== Parameters
        # * name<~String> - Name of container to delete
        #
        def delete_container(name)
          request(
            :expects  => 204,
            :method   => 'DELETE',
            :path     => Fog::Softlayer.escape(name)
          )
        end

      end
    end
  end
end

Version data entries

60 entries across 58 versions & 3 rubygems

Version Path
fog-softlayer-0.3.12 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.11 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.10 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.9 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.8 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.7 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.6 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.6.pre.f82ffe9 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.6.pre.f7e3358 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.5 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.4.pre lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.3.pre lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.2 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.3.1 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.2.1 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.1.1 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.1.0 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.0.9 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.0.8 lib/fog/softlayer/requests/storage/delete_container.rb
fog-softlayer-0.0.7 lib/fog/softlayer/requests/storage/delete_container.rb