1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/aws/requests/dns/delete_hosted_zone.rb

48 lines
1.3 KiB
Ruby

module Fog
module AWS
class DNS
class Real
require 'fog/aws/parsers/dns/delete_hosted_zone'
# Delete a hosted zone
#
# ==== Parameters
# * zone_id<~String> -
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'ChangeInfo'<~Hash> -
# * 'Id'<~String> The ID of the request
# * 'Status'<~String> The current state of the hosted zone
# * 'SubmittedAt'<~String> The date and time the change was made
# * status<~Integer> - 200 when successful
def delete_hosted_zone(zone_id)
# AWS methods return zone_ids that looks like '/hostedzone/id'. Let the caller either use
# that form or just the actual id (which is what this request needs)
zone_id = zone_id.sub('/hostedzone/', '')
request({
:expects => 200,
:parser => Fog::Parsers::AWS::DNS::DeleteHostedZone.new,
:method => 'DELETE',
:path => "hostedzone/#{zone_id}"
})
end
end
class Mock
def delete_hosted_zone(zone_id)
Fog::Mock.not_implemented
end
end
end
end
end