Permalink
Browse files

adding dns_zone commands

  • Loading branch information...
1 parent b094442 commit 793f9f546aa167b3e2f23c35c1b036c7ba1e4056 @cmartyn cmartyn committed Apr 15, 2012
Showing with 57 additions and 0 deletions.
  1. +1 −0 lib/moo_moo.rb
  2. +45 −0 lib/moo_moo/dns_zone.rb
  3. +11 −0 spec/moo_moo/dns_zone_spec.rb
View
@@ -10,6 +10,7 @@ module MooMoo
autoload :Nameserver, 'moo_moo/nameserver'
autoload :Provisioning, 'moo_moo/provisioning'
autoload :Transfer, 'moo_moo/transfer'
+ autoload :DnsZone, 'moo_moo/dns_zone'
autoload :Cookie, 'moo_moo/cookie'
autoload :OpenSRSErrors, 'moo_moo/middleware/open_srs_errors'
autoload :ParseOpenSRS, 'moo_moo/middleware/parse_open_srs'
View
@@ -0,0 +1,45 @@
+module MooMoo
+ class DnsZone < Base
+
+ ##
+ # Creates a custom DNS zone for managed DNS service.
+ #
+ # http://www.opensrs.com/docs/apidomains/create_dns_zone_request.htm
+ register_service :create_dns_zone, :domain
+
+ ##
+ # Deletes the DNS zones for the specified domain.
+ #
+ # http://www.opensrs.com/docs/apidomains/delete_dns_zone_request.htm
+ register_service :delete_dns_zone, :domain
+
+ ##
+ # Changes the nameservers on your domain to use the
+ # nameservers for managed DNS service.
+ #
+ # http://www.opensrs.com/docs/apidomains/Request_parameters_for_force_dns_nameservers.htm
+ register_service :force_dns_nameservers, :domain
+
+ ##
+ # View the DNS records for a specified domain.
+ #
+ # http://www.opensrs.com/docs/apidomains/get_dns_zone_request.htm
+ register_service :get_dns_zone, :domain
+
+ ##
+ # Sets the DNS zone to the values in the specified template.
+ # If a template is not specified in the command, the records
+ # are set to what was in the template that was used to enable
+ # the DNS service.
+ #
+ # http://www.opensrs.com/docs/apidomains/reset_dns_zone_request.htm
+ register_service :reset_dns_zone, :domain
+
+ ##
+ # Set the records for a domain's DNS zone.
+ #
+ # http://www.opensrs.com/docs/apidomains/set_dns_zone_request.htm
+ register_service :set_dns_zone, :domain
+
+ end
+end
@@ -0,0 +1,11 @@
+require 'spec_helper'
+require 'date'
+
+describe MooMoo::DnsZone do
+ it { should have_registered_service(:create_dns_zone, :domain) }
+ it { should have_registered_service(:delete_dns_zone, :domain) }
+ it { should have_registered_service(:force_dns_nameservers, :domain) }
+ it { should have_registered_service(:get_dns_zone, :domain) }
+ it { should have_registered_service(:reset_dns_zone, :domain) }
+ it { should have_registered_service(:set_dns_zone, :domain) }
+end

0 comments on commit 793f9f5

Please sign in to comment.