From 37574c2e8de5ba636429e3f4884788fd2037023c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 23 May 2013 15:30:23 +0800 Subject: [PATCH] [stormondemand|dns] Add Reverse APIs --- lib/fog/storm_on_demand/dns.rb | 4 ++++ lib/fog/storm_on_demand/models/dns/reverse.rb | 23 +++++++++++++++++++ .../requests/dns/delete_reverse.rb | 16 +++++++++++++ .../requests/dns/update_reverse.rb | 16 +++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 lib/fog/storm_on_demand/models/dns/reverse.rb create mode 100644 lib/fog/storm_on_demand/requests/dns/delete_reverse.rb create mode 100644 lib/fog/storm_on_demand/requests/dns/update_reverse.rb diff --git a/lib/fog/storm_on_demand/dns.rb b/lib/fog/storm_on_demand/dns.rb index 520ecd92e..eb9c1ec77 100644 --- a/lib/fog/storm_on_demand/dns.rb +++ b/lib/fog/storm_on_demand/dns.rb @@ -16,6 +16,7 @@ module Fog collection :domains model :record collection :records + model :reverse request_path 'fog/storm_on_demand/requests/dns' request :list_domains @@ -29,6 +30,9 @@ module Fog request :create_record_region request :delete_record_region request :update_record_region + + request :delete_reverse + request :update_reverse class Mock diff --git a/lib/fog/storm_on_demand/models/dns/reverse.rb b/lib/fog/storm_on_demand/models/dns/reverse.rb new file mode 100644 index 000000000..b925ea6db --- /dev/null +++ b/lib/fog/storm_on_demand/models/dns/reverse.rb @@ -0,0 +1,23 @@ +require 'fog/core/model' + +module Fog + module DNS + class StormOnDemand + class Reverse < Fog::Model + + def initialize(attributes={}) + super + end + + def destroy(options) + service.delete_reverse(options).body + end + + def update(options) + service.update_reverse(options).body + end + + end + end + end +end diff --git a/lib/fog/storm_on_demand/requests/dns/delete_reverse.rb b/lib/fog/storm_on_demand/requests/dns/delete_reverse.rb new file mode 100644 index 000000000..2cb243947 --- /dev/null +++ b/lib/fog/storm_on_demand/requests/dns/delete_reverse.rb @@ -0,0 +1,16 @@ +module Fog + module DNS + class StormOnDemand + class Real + + def delete_reverse(options={}) + request( + :path => '/Network/DNS/Reverse/delete', + :body => Fog::JSON.encode(:params => options) + ) + end + + end + end + end +end diff --git a/lib/fog/storm_on_demand/requests/dns/update_reverse.rb b/lib/fog/storm_on_demand/requests/dns/update_reverse.rb new file mode 100644 index 000000000..8ad4857d7 --- /dev/null +++ b/lib/fog/storm_on_demand/requests/dns/update_reverse.rb @@ -0,0 +1,16 @@ +module Fog + module DNS + class StormOnDemand + class Real + + def update_reverse(options={}) + request( + :path => '/Network/DNS/Reverse/update', + :body => Fog::JSON.encode(:params => options) + ) + end + + end + end + end +end