-
Notifications
You must be signed in to change notification settings - Fork 4
/
README
44 lines (38 loc) · 2.16 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
See http://www.dnsmadeeasy.com/enterprisedns/api.html for API documentation. Please note this ruby script is based off the sample perl script provided by DNS Made Easy
For testing, DNS Made Easy is offering sandbox accounts: http://sandbox.dnsmadeeasy.com/
Config File: a file named dnsmeapi.properties must exist in your current directory, with the following contents:
apiKey=ReplaceWithYourAPIKey
secretKey=ReplaceWithYourSecretKey
Files:
------
README - This document
LICENSE - GPLv2 License
dnsmeapi.rb - Ruby port of DNS Made Easy's sample perl script
dme.rb - Sample script accessing DNS Made Easy's API using entirely native Ruby methods
ec2-set-dme-dns.rb - Registers an EC2 hosts name with DNS Made Easy, if it doesn't exist or if it is set incorrectly
Gemfile.rb - Bundler Gemfile sets up dependencies for ec2-set-dme-dns.rb ("bundle install" to pull in deps)
Usage Examples:
Get a list of domains:
dnsmeapi.rb http://api.dnsmadeeasy.com/V1.2/domains --header \
accept:application/json
Get a list of records in a single zone:
dnsmeapi.rb http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records \
--header accept:application/json
Get a list of records of a specific record type in a single zone (e.g. - CNAME):
dnsmeapi.rb \
http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records?type=cname \
--header accept:application/json
Get the details of a single record:
dnsmeapi.rb \
http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records/recordidnumber \
--header accept:application/json
Create a new RECORD, where the contents of the file record.txt contains a JSON
representation of the record (this call will return with the full JSON
including the new recordid):
dnsmeapi.rb -d @record.txt \
http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records -X POST \
--header content-type:application/json
Please note the output JSON is dense. If you would like to make it easier to read you can pipe the output to one of the following tools:
| prettify_json.rb # comes with the json ruby gem ("gem install json")
| python -mjson.tool # comes standard with Python 2.6+
| jazor # A simple commandline JSON parsing tool written in Ruby ("gem install jazor" to install)