1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|dns] Updates reference to service

This commit is contained in:
Paul Thornthwaite 2012-12-22 23:31:20 +00:00
parent 1cb5a45b3e
commit 95d8da053b
4 changed files with 12 additions and 12 deletions

View file

@ -29,7 +29,7 @@ module Fog
def destroy
options = attributes_to_options('DELETE')
connection.change_resource_record_sets(zone.id, [options])
service.change_resource_record_sets(zone.id, [options])
true
end
@ -39,7 +39,7 @@ module Fog
def save
options = attributes_to_options('CREATE')
data = connection.change_resource_record_sets(zone.id, [options]).body
data = service.change_resource_record_sets(zone.id, [options]).body
merge_attributes(data)
true
end
@ -54,7 +54,7 @@ module Fog
merge_attributes(new_attributes)
options << attributes_to_options('CREATE')
data = connection.change_resource_record_sets(zone.id, options).body
data = service.change_resource_record_sets(zone.id, options).body
merge_attributes(data)
true
end
@ -69,7 +69,7 @@ module Fog
def reload
# If we have a change_id (newly created or modified), then reload performs a get_change to update status.
if change_id
data = connection.get_change(change_id).body
data = service.get_change(change_id).body
merge_attributes(data)
self
else

View file

@ -28,7 +28,7 @@ module Fog
options[:identifier] ||= identifier
options.delete_if {|key, value| value.nil?}
data = connection.list_resource_record_sets(zone.id, options).body
data = service.list_resource_record_sets(zone.id, options).body
# NextRecordIdentifier is completely absent instead of nil, so set to nil, or iteration breaks.
data['NextRecordIdentifier'] = nil unless data.has_key?('NextRecordIdentifier')
@ -57,7 +57,7 @@ module Fog
}
options.delete_if {|key, value| value.nil?}
batch = connection.list_resource_record_sets(zone.id, options).body
batch = service.list_resource_record_sets(zone.id, options).body
# NextRecordIdentifier is completely absent instead of nil, so set to nil, or iteration breaks.
batch['NextRecordIdentifier'] = nil unless batch.has_key?('NextRecordIdentifier')
@ -92,7 +92,7 @@ module Fog
}
options.delete_if {|key, value| value.nil?}
data = connection.list_resource_record_sets(zone.id, options).body
data = service.list_resource_record_sets(zone.id, options).body
# Get first record
data = data['ResourceRecordSets'].shift

View file

@ -17,7 +17,7 @@ module Fog
def destroy
requires :identity
connection.delete_hosted_zone(identity)
service.delete_hosted_zone(identity)
true
end
@ -25,7 +25,7 @@ module Fog
@records ||= begin
Fog::DNS::AWS::Records.new(
:zone => self,
:connection => connection
:service => service
)
end
end
@ -35,7 +35,7 @@ module Fog
options = {}
options[:caller_ref] = caller_reference if caller_reference
options[:comment] = description if description
data = connection.create_hosted_zone(domain, options).body
data = service.create_hosted_zone(domain, options).body
merge_attributes(data)
true
end

View file

@ -15,12 +15,12 @@ module Fog
def all(options = {})
options['marker'] ||= marker
options['maxitems'] ||= max_items
data = connection.list_hosted_zones(options).body['HostedZones']
data = service.list_hosted_zones(options).body['HostedZones']
load(data)
end
def get(zone_id)
data = connection.get_hosted_zone(zone_id).body
data = service.get_hosted_zone(zone_id).body
new(data)
rescue Excon::Errors::NotFound
nil