2010-12-12 09:51:52 -05:00
|
|
|
module Fog
|
2011-06-15 20:25:01 -04:00
|
|
|
module DNS
|
|
|
|
class Zerigo
|
2010-12-12 09:51:52 -05:00
|
|
|
class Real
|
|
|
|
|
2014-02-19 07:30:59 -05:00
|
|
|
# Delete a host record
|
2010-12-12 21:18:21 -05:00
|
|
|
#
|
2010-12-12 09:51:52 -05:00
|
|
|
# ==== Parameters
|
2010-12-12 21:18:21 -05:00
|
|
|
# * host_id<~Integer> - Id of host record to delete
|
2010-12-12 09:51:52 -05:00
|
|
|
# ==== Returns
|
2014-02-19 07:30:59 -05:00
|
|
|
# * response<~Excon::Response>:
|
2010-12-13 08:51:04 -05:00
|
|
|
# * 'status'<~Integer> - 200 indicates success
|
2010-12-12 18:02:02 -05:00
|
|
|
def delete_host(host_id)
|
2010-12-12 09:51:52 -05:00
|
|
|
request(
|
|
|
|
:expects => 200,
|
|
|
|
:method => 'DELETE',
|
2010-12-12 18:02:02 -05:00
|
|
|
:path => "/api/1.1/hosts/#{host_id}.xml"
|
2010-12-12 09:51:52 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2011-10-08 20:19:32 -04:00
|
|
|
|
|
|
|
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
|
2010-12-12 09:51:52 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|