mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[dnsimple] Updates reference to service
This commit is contained in:
parent
245c3452a2
commit
3daa602f5f
4 changed files with 11 additions and 11 deletions
|
@ -26,7 +26,7 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
connection.delete_record(zone.domain, identity)
|
service.delete_record(zone.domain, identity)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -42,12 +42,12 @@ module Fog
|
||||||
|
|
||||||
# decide whether its a new record or update of an existing
|
# decide whether its a new record or update of an existing
|
||||||
if id.nil?
|
if id.nil?
|
||||||
data = connection.create_record(zone.domain, name, type, value, options)
|
data = service.create_record(zone.domain, name, type, value, options)
|
||||||
else
|
else
|
||||||
options[:name] = name if name
|
options[:name] = name if name
|
||||||
options[:content] = value if value
|
options[:content] = value if value
|
||||||
options[:type] = type if type
|
options[:type] = type if type
|
||||||
data = connection.update_record(zone.domain, id, options)
|
data = service.update_record(zone.domain, id, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
merge_attributes(data.body["record"])
|
merge_attributes(data.body["record"])
|
||||||
|
|
|
@ -14,13 +14,13 @@ module Fog
|
||||||
def all
|
def all
|
||||||
requires :zone
|
requires :zone
|
||||||
clear
|
clear
|
||||||
data = connection.list_records(zone.id).body.map {|record| record['record']}
|
data = service.list_records(zone.id).body.map {|record| record['record']}
|
||||||
load(data)
|
load(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(record_id)
|
def get(record_id)
|
||||||
requires :zone
|
requires :zone
|
||||||
data = connection.get_record(zone.id, record_id).body["record"]
|
data = service.get_record(zone.id, record_id).body["record"]
|
||||||
new(data)
|
new(data)
|
||||||
rescue Excon::Errors::NotFound
|
rescue Excon::Errors::NotFound
|
||||||
nil
|
nil
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Fog
|
||||||
attribute :updated_at
|
attribute :updated_at
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
connection.delete_domain(identity)
|
service.delete_domain(identity)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ module Fog
|
||||||
@records ||= begin
|
@records ||= begin
|
||||||
Fog::DNS::DNSimple::Records.new(
|
Fog::DNS::DNSimple::Records.new(
|
||||||
:zone => self,
|
:zone => self,
|
||||||
:connection => connection
|
:service => service
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -38,7 +38,7 @@ module Fog
|
||||||
|
|
||||||
def save
|
def save
|
||||||
requires :domain
|
requires :domain
|
||||||
data = connection.create_domain(domain).body["domain"]
|
data = service.create_domain(domain).body["domain"]
|
||||||
merge_attributes(data)
|
merge_attributes(data)
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,12 +11,12 @@ module Fog
|
||||||
|
|
||||||
def all
|
def all
|
||||||
clear
|
clear
|
||||||
data = connection.list_domains.body.map {|zone| zone['domain']}
|
data = service.list_domains.body.map {|zone| zone['domain']}
|
||||||
load(data)
|
load(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
def get(zone_id)
|
def get(zone_id)
|
||||||
data = connection.get_domain(zone_id).body['domain']
|
data = service.get_domain(zone_id).body['domain']
|
||||||
new(data)
|
new(data)
|
||||||
rescue Excon::Errors::NotFound
|
rescue Excon::Errors::NotFound
|
||||||
nil
|
nil
|
||||||
|
|
Loading…
Reference in a new issue