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

[dynect|dns] Updates reference to service

This commit is contained in:
Paul Thornthwaite 2012-12-22 23:27:58 +00:00
parent 322cf0c56a
commit 0c5395b0d6
4 changed files with 11 additions and 11 deletions

View file

@ -16,7 +16,7 @@ module Fog
def destroy
requires :identity, :name, :type, :zone
connection.delete_record(type, zone.identity, name, identity)
service.delete_record(type, zone.identity, name, identity)
true
end
@ -28,13 +28,13 @@ module Fog
}
options.delete_if {|key, value| value.nil?}
data = connection.post_record(type, zone.identity, name, rdata, options).body['data']
data = service.post_record(type, zone.identity, name, rdata, options).body['data']
# avoid overwriting zone object with zone string
data = data.reject {|key, value| key == 'zone'}
merge_attributes(data)
zone.publish
records = connection.get_record(type, zone.identity, name).body['data']
records = service.get_record(type, zone.identity, name).body['data']
# data in format ['/REST/xRecord/domain/fqdn/identity]
records.map! do |record|
tokens = record.split('/')

View file

@ -14,8 +14,8 @@ module Fog
def all(options = {})
requires :zone
data = []
connection.get_node_list(zone.domain, options).body['data'].each do |fqdn|
records = connection.get_record('ANY', zone.domain, fqdn).body['data']
service.get_node_list(zone.domain, options).body['data'].each do |fqdn|
records = service.get_record('ANY', zone.domain, fqdn).body['data']
# data in format ['/REST/xRecord/domain/fqdn/identity]
records.map! do |record|

View file

@ -23,7 +23,7 @@ module Fog
def destroy
requires :domain
connection.delete_zone(domain)
service.delete_zone(domain)
true
end
@ -34,12 +34,12 @@ module Fog
def publish
requires :identity
data = connection.put_zone(identity, 'publish' => true)
data = service.put_zone(identity, 'publish' => true)
true
end
def records
@records ||= Fog::DNS::Dynect::Records.new(:zone => self, :connection => connection)
@records ||= Fog::DNS::Dynect::Records.new(:zone => self, :service => service)
end
def nameservers
@ -48,7 +48,7 @@ module Fog
def save
requires :domain, :email, :ttl
data = connection.post_zone(email, ttl, domain).body['data']
data = service.post_zone(email, ttl, domain).body['data']
merge_attributes(data)
true
end

View file

@ -10,14 +10,14 @@ module Fog
model Fog::DNS::Dynect::Zone
def all
data = connection.get_zone.body['data'].map do |zone|
data = service.get_zone.body['data'].map do |zone|
{ :domain => zone }
end
load(data)
end
def get(zone_id)
new(connection.get_zone('zone' => zone_id).body['data'])
new(service.get_zone('zone' => zone_id).body['data'])
rescue Excon::Errors::NotFound
nil
end