Sha256: b7fd5c7a116bd727af3b0fead793522cf97455cb9dda9531da9a2132823cae7b

Contents?: true

Size: 927 Bytes

Versions: 99

Compression:

Stored size: 927 Bytes

Contents

module Fog
  module DNS
    class Zerigo
      class Real

        # Delete a host record 
        #
        # ==== Parameters
        # * host_id<~Integer> - Id of host record to delete
        # ==== Returns
        # * response<~Excon::Response>: 
        #   * 'status'<~Integer> - 200 indicates success
        def delete_host(host_id)
          request(
            :expects  => 200,
            :method   => 'DELETE',
            :path     => "/api/1.1/hosts/#{host_id}.xml"
          )
        end

      end

      class Mock # :nodoc:all
        def delete_host(host_id)
          host = find_host(host_id)

          response = Excon::Response.new

          if host
            zone = find_by_zone_id(host['zone-id'])
            zone['hosts'].delete(host)

            response.status = 200
          else
            response.status = 404
          end

          response
        end
      end
    end
  end
end

Version data entries

99 entries across 99 versions & 18 rubygems

Version Path
fog-test-again-1.6.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-test-me-1.10.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-parser-fix-1.6.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-1.10.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-1.9.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/zerigo/requests/dns/delete_host.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/zerigo/requests/dns/delete_host.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/zerigo/requests/dns/delete_host.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/zerigo/requests/dns/delete_host.rb
fog-sgonyea-1.8.1 lib/fog/zerigo/requests/dns/delete_host.rb
fog-1.8.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/zerigo/requests/dns/delete_host.rb
fog-1.7.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-1.6.0 lib/fog/zerigo/requests/dns/delete_host.rb
fog-1.5.0 lib/fog/zerigo/requests/dns/delete_host.rb
rackspace-fog-1.4.2 lib/rackspace-fog/zerigo/requests/dns/delete_host.rb
fog-1.4.0 lib/fog/zerigo/requests/dns/delete_host.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/zerigo/requests/dns/delete_host.rb
michiels-fog-1.3.1 lib/fog/zerigo/requests/dns/delete_host.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/zerigo/requests/dns/delete_host.rb