[dns_made_easy|dns] Updates reference to service

This commit is contained in:
Paul Thornthwaite 2012-12-22 23:28:14 +00:00
parent 3daa602f5f
commit 322cf0c56a
4 changed files with 12 additions and 12 deletions

View File

@ -8,7 +8,7 @@ module Fog
extend Fog::Deprecation
deprecate :ip, :value
deprecate :ip=, :value=
identity :id
attribute :name
@ -23,14 +23,14 @@ module Fog
attribute :hard_link, :aliases => "hardLink"
attribute :value, :aliases => "data"
def initialize(attributes={})
self.ttl ||= 1800
super
end
def destroy
connection.delete_record(zone.domain, identity)
service.delete_record(zone.domain, identity)
true
end
@ -57,11 +57,11 @@ module Fog
end
if id.nil?
data = connection.create_record(zone.domain, name, type, value, options).body
data = service.create_record(zone.domain, name, type, value, options).body
merge_attributes(data)
else
options.merge!(:name => name, :type => type, :data => value)
connection.update_record(zone.domain, id, options).body
service.update_record(zone.domain, id, options).body
end
true

View File

@ -13,12 +13,12 @@ module Fog
def all
requires :zone
data = connection.list_records(zone.identity).body
data = service.list_records(zone.identity).body
load(data)
end
def get(record_id)
data = connection.get_record(zone.identity, record_id).body
data = service.get_record(zone.identity, record_id).body
new(data)
rescue Fog::Service::NotFound
nil

View File

@ -14,7 +14,7 @@ module Fog
def destroy
requires :identity
connection.delete_domain(identity)
service.delete_domain(identity)
true
end
@ -22,14 +22,14 @@ module Fog
@records ||= begin
Fog::DNS::DNSMadeEasy::Records.new(
:zone => self,
:connection => connection
:service => service
)
end
end
def save
requires :domain
data = connection.create_domain(domain).body
data = service.create_domain(domain).body
self.identity = data['name']
merge_attributes(data)
true

View File

@ -11,12 +11,12 @@ module Fog
def all
clear
data = connection.list_domains.body['list'].collect{|domain| {:id => domain}}
data = service.list_domains.body['list'].collect{|domain| {:id => domain}}
load(data)
end
def get(zone_id)
data = connection.get_domain(zone_id).body
data = service.get_domain(zone_id).body
data.merge!(:id => data['name'])
new(data)
rescue Fog::Service::NotFound