mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
27f3eda915
Support for CRUD on latency/weighted resource sets for AWS Route 53. Updated to latest API version.
33 lines
703 B
Ruby
33 lines
703 B
Ruby
require 'fog/core/collection'
|
|
require 'fog/aws/models/dns/zone'
|
|
|
|
module Fog
|
|
module DNS
|
|
class AWS
|
|
|
|
class Zones < Fog::Collection
|
|
|
|
attribute :marker, :aliases => 'Marker'
|
|
attribute :max_items, :aliases => 'MaxItems'
|
|
|
|
model Fog::DNS::AWS::Zone
|
|
|
|
def all(options = {})
|
|
options['marker'] ||= marker
|
|
options['maxitems'] ||= max_items
|
|
data = connection.list_hosted_zones(options).body['HostedZones']
|
|
load(data)
|
|
end
|
|
|
|
def get(zone_id)
|
|
data = connection.get_hosted_zone(zone_id).body
|
|
new(data)
|
|
rescue Excon::Errors::NotFound
|
|
nil
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|