mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[zerigo|dns] Updates reference to service
This commit is contained in:
parent
0c674865d6
commit
a510d34982
4 changed files with 13 additions and 13 deletions
|
@ -29,7 +29,7 @@ module Fog
|
|||
|
||||
def destroy
|
||||
requires :identity
|
||||
connection.delete_host(identity)
|
||||
service.delete_host(identity)
|
||||
true
|
||||
end
|
||||
|
||||
|
@ -48,9 +48,9 @@ module Fog
|
|||
if persisted?
|
||||
options[:host_type] = type
|
||||
options[:data] = value
|
||||
connection.update_host(identity, options)
|
||||
service.update_host(identity, options)
|
||||
else
|
||||
data = connection.create_host(@zone.id, type, value, options)
|
||||
data = service.create_host(@zone.id, type, value, options)
|
||||
merge_attributes(data.body)
|
||||
end
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ module Fog
|
|||
end
|
||||
|
||||
def get(record_id)
|
||||
data = connection.get_host(record_id).body
|
||||
data = service.get_host(record_id).body
|
||||
new(data)
|
||||
rescue Fog::Service::NotFound
|
||||
nil
|
||||
|
@ -35,7 +35,7 @@ module Fog
|
|||
end
|
||||
|
||||
def find(fqdn)
|
||||
hosts = connection.find_hosts(fqdn, zone.id).body['hosts']
|
||||
hosts = service.find_hosts(fqdn, zone.id).body['hosts']
|
||||
hosts.collect { |host| new(host) }
|
||||
end
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ module Fog
|
|||
attribute :updated_at, :aliases => 'updated-at'
|
||||
|
||||
# <custom-nameservers>ns1.example.com,ns2.example.com</custom-nameservers>
|
||||
# <custom-ns type="boolean">true</custom-ns>
|
||||
# <hostmaster>dnsadmin@example.com</hostmaster>
|
||||
# <custom-ns type="boolean">true</custom-ns>
|
||||
# <hostmaster>dnsadmin@example.com</hostmaster>
|
||||
# <notes nil="true"/>
|
||||
# <ns1 nil="true"/>
|
||||
# <nx-ttl nil="true"></nx-ttl>
|
||||
|
@ -33,7 +33,7 @@ module Fog
|
|||
|
||||
def destroy
|
||||
requires :identity
|
||||
connection.delete_zone(identity)
|
||||
service.delete_zone(identity)
|
||||
true
|
||||
end
|
||||
|
||||
|
@ -41,7 +41,7 @@ module Fog
|
|||
@records ||= begin
|
||||
Fog::DNS::Zerigo::Records.new(
|
||||
:zone => self,
|
||||
:connection => connection
|
||||
:service => service
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -71,11 +71,11 @@ module Fog
|
|||
# * restrict_axfr<~String> - indicates if AXFR transfers should be restricted to IPs in axfr-ips
|
||||
# * tag_list<~String> - List of all tags associated with this domain
|
||||
data = unless identity
|
||||
connection.create_zone(domain, ttl, type, options)
|
||||
service.create_zone(domain, ttl, type, options)
|
||||
else
|
||||
options[:default_ttl] = ttl
|
||||
options[:ns_type] = type
|
||||
connection.update_zone(identity, options)
|
||||
service.update_zone(identity, options)
|
||||
end
|
||||
merge_attributes(data.body)
|
||||
true
|
||||
|
|
|
@ -10,12 +10,12 @@ module Fog
|
|||
model Fog::DNS::Zerigo::Zone
|
||||
|
||||
def all
|
||||
data = connection.list_zones.body['zones']
|
||||
data = service.list_zones.body['zones']
|
||||
load(data)
|
||||
end
|
||||
|
||||
def get(zone_id_or_domain)
|
||||
data = connection.get_zone(zone_id_or_domain).body
|
||||
data = service.get_zone(zone_id_or_domain).body
|
||||
zone = new(data)
|
||||
zone.records.load(data['hosts'])
|
||||
zone
|
||||
|
|
Loading…
Reference in a new issue