Module: DnsMadeEasy
- Defined in:
- lib/dnsmadeeasy/api.rb,
lib/dnsmadeeasy/exceptions.rb
Overview
DnsMadeEasy/API
Ruby client for DNSMadeEasy API.
Installation
gem install environment
Usage
require "rubygems"
require "dnsmadeeasy/api"
api_key = "your-12345-api-67890-key"
secret_key = "your-12345-secret-67890-key"
api = DnsMadeEasy::Api(api_key, secret_key)
api.list_records "sigfig.com"
To run in sandbox mode (you need an account and api key at sandbox.dnsmadeeasy.com). This is a great way to test your application without changing your production DNS entries.
api = DnsMadeEasy::Api(api_key, secret_key, true)
api.list_records "sigfig.com"
The api calls throw the following exceptions:
-
BadRequestError: For cases when there is missing information or the api limits have been exceeded
-
ResourceNotFoundError: For cases when a request is made for an unknown domain or record
-
AuthorizationFailedError: For cases when the request cannot be authorized
-
InvalidRecordError: When a record to be created or updated is not well formed
Command line tool
The client comes with a command line tool “dme”. Use “dme –help” to see how to use the command. The command line tool requires that your api credentials be stored in /etc/dnsmadeeasy/api.keys as
api_key=<api_key>
secret_key=<secret_key>
The command line tool also allows the running of queries in the sandbox mode. To do so, create /etc/dnsmadeeasy/api_sandbox.keys with your sandbox api key and secret key and use the –sandbox option with every command.
Defined Under Namespace
Classes: Api, AuthorizationFailedError, BadRequestError, InvalidRecordError, RequestFailedError, ResourceNotFoundError
Constant Summary collapse
- TTL_ONE_HOUR =
3600
- TTL_HALF_HOUR =
1800
- TTL_FIVE_MINS =
300
- TTL_ONE_DAY =
86400
- TTL_ONE_WEEK =
604800