diff --git a/lib/fog/rage4/models/dns/record.rb b/lib/fog/rage4/models/dns/record.rb index c1efacb04..a463246e3 100644 --- a/lib/fog/rage4/models/dns/record.rb +++ b/lib/fog/rage4/models/dns/record.rb @@ -23,6 +23,7 @@ module Fog attribute :geo_long attribute :geo_lock attribute :is_active + attribute :udp_limit def initialize(attributes={}) @@ -51,6 +52,7 @@ module Fog options[:geolock] = geo_lock if geo_lock options[:geolat] = geo_lat if geo_lat options[:geolong] = geo_long if geo_long + options[:udplimit] = udp_limit if udp_limit # decide whether its a new record or update of an existing if id.nil? diff --git a/lib/fog/rage4/requests/dns/create_record.rb b/lib/fog/rage4/requests/dns/create_record.rb index 9b4690778..710b81e99 100644 --- a/lib/fog/rage4/requests/dns/create_record.rb +++ b/lib/fog/rage4/requests/dns/create_record.rb @@ -17,6 +17,7 @@ module Fog # * geolock <~Boolean> Lock geo coordinates, default false # * geolat <~Double> Geo latitude, (nullable) # * geolong <~Double> Geo longitude, (nullable) + # * udplimit <~Boolean> Limit number of records returned, (nullable, default false) # # ==== Returns # * response<~Excon::Response>: @@ -49,6 +50,7 @@ module Fog path << "&geolock=#{options[:geolock]}" if options[:geolock] path << "&geolat=#{options[:geolat]}" if options[:geolat] path << "&geolong=#{options[:geolong]}" if options[:geolong] + path << "&udplimit=#{options[:udplimit]}" if options[:udplimit] request( :expects => 200, diff --git a/lib/fog/rage4/requests/dns/update_record.rb b/lib/fog/rage4/requests/dns/update_record.rb index bebd311ae..33db82bee 100644 --- a/lib/fog/rage4/requests/dns/update_record.rb +++ b/lib/fog/rage4/requests/dns/update_record.rb @@ -17,6 +17,7 @@ module Fog # * geolock <~Boolean> Lock geo coordinates, default false # * geolat <~Double> Geo latitude, (nullable) # * geolong <~Double> Geo longitude, (nullable) + # * udplimit <~Boolean> Limit number of records returned, (nullable, default false) # # ==== Returns # * response<~Excon::Response>: @@ -48,6 +49,7 @@ module Fog path << "&geolock=#{options[:geolock]}" if options[:geolock] path << "&geolat=#{options[:geolat]}" if options[:geolat] path << "&geolong=#{options[:geolong]}" if options[:geolong] + path << "&udplimit=#{options[:udplimit]}" if options[:udplimit] request( :expects => 200, diff --git a/tests/rage4/requests/dns/dns_tests.rb b/tests/rage4/requests/dns/dns_tests.rb index 02436427f..357caeb1a 100644 --- a/tests/rage4/requests/dns/dns_tests.rb +++ b/tests/rage4/requests/dns/dns_tests.rb @@ -167,6 +167,23 @@ Shindo.tests('Fog::DNS[:rage4] | DNS requests', ['rage4', 'dns']) do response.body['status'] && !@record_id.nil? end + test("create_record with options") do + pending if Fog.mocking? + + name = "www." + @domain + type = 2 #"A" + data = "1.2.3.5" + options = { udplimit: true } + response = Fog::DNS[:rage4].create_record(@domain_id, name , data, type, options) + + if response.status == 200 + @record_id = response.body['id'] + end + + response.status == 200 && response.body['error'] == "" && + response.body['status'] && !@record_id.nil? + end + test("update_record") do pending if Fog.mocking? @@ -181,6 +198,21 @@ Shindo.tests('Fog::DNS[:rage4] | DNS requests', ['rage4', 'dns']) do response.body['status'] end + test("update_record with options") do + pending if Fog.mocking? + + name = "www." + @domain + type = 2 #"A" + data = "4.3.2.1" + options = { udplimit: true } + response = Fog::DNS[:rage4].update_record(@record_id, name, data, type, options) + + returns(@record_id) { response.body['id'] } + + response.status == 200 && response.body['error'] == "" && + response.body['status'] + end + test("list_records") do pending if Fog.mocking?