Initialize connection to DNS Made Easy
options parameter must include values for :dnsmadeeasy_api_key and :dnsmadeeasy_secret_key in order to create a connection
dns = Fog::DNS::DNSMadeEasy.new( :dnsmadeeasy_api_key => your_dnsmadeeasy_api_key, :dnsmadeeasy_secret_key => your_dnsmadeeasy_secret_key )
options<~Hash> - config arguments for connection. Defaults to {}.
dns object with connection to aws.
# File lib/fog/dnsmadeeasy/dns.rb, line 81 def initialize(options={}) require 'fog/core/parser' @dnsmadeeasy_api_key = options[:dnsmadeeasy_api_key] @dnsmadeeasy_secret_key = options[:dnsmadeeasy_secret_key] @connection_options = options[:connection_options] || {} @host = options[:host] || 'api.dnsmadeeasy.com' @persistent = options.fetch(:persistent, true) @port = options[:port] || 80 #443 Not yet @scheme = options[:scheme] || 'http' #'https Not yet @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) end
Creates a domain entry with the specified name. Returns errors if name is not valid or conflicts with another domain.
domain<~String> - domain name
response<~Excon::Response>:
body<~Hash>:
name<~String> The domain name.
nameServer<~Array> List of strings, Name servers associated with this domain e.g. ["ns1.dnsmadeeasy.com", "ns2.dnsmadeeasy.com"]
gtdEnabled<~Boolean> true | false - Indicator of whether or not this domain uses the Global Traffic Director.
status<~Integer> - 201 - domain successfully created, 400 - domain name not valid, see errors in response content
# File lib/fog/dnsmadeeasy/requests/dns/create_domain.rb, line 18 def create_domain(domain) request( :expects => 201, :method => 'PUT', :path => "/V1.2/domains/#{domain}" ) end
Creates a record with the representation specified in the request content. Returns errors if record is not valid. Note that a record ID will be generated by the system with this request and any ID that is sent will be ignored. Records are not modifiable for domains that are locked to a template.
domain<~String> Domain name.
name<~String> Record name.
type<~String> Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT
data<~String> Record data
options<~Hash> - optional
ttl<~Integer> Time to live. The amount of time a record will be cached before being refreshed. Default: 1800 (30 mins)
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
password<~String> For A records. Password used to authenticate for dynamic DNS.
description<~String> For HTTPRED records. A description of the HTTPRED record.
keywords<~String> For HTTPRED records. Keywords associated with the HTTPRED record.
title<~String> For HTTPRED records. The title of the HTTPRED record.
redirectType<~String> For HTTPRED records. Type of redirection performed. Values: Hidden Frame Masked, Standard - 302, Standard - 301
hardLink<~Boolean> For HTTPRED records.
response<~Excon::Response>:
body<~Hash>:
id<~Integer> Unique record identifier
name<~String>
type<~String>
data<~String>
ttl<~Integer>
gtdLocation<~String>
password<~String>
description<~String>
keywords<~String>
title<~String>
redirectType<~String>
hardLink<~Boolean>
'status'<~Integer> - 201 - record successfully created, 400 - record not valid, see errors in response content, 404 - domain not found
# File lib/fog/dnsmadeeasy/requests/dns/create_record.rb, line 40 def create_record(domain, name, type, data, options = {}) body = { "name" => name, "type" => type, "data" => data, "ttl" => 1800 } body.merge!(options) request( :expects => 201, :method => "POST", :path => "/V1.2/domains/#{domain}/records", :body => Fog::JSON.encode(body) ) end
Creates a secondary entry with the specified name. Returns errors if name is not valid or conflicts with another domain.
secondary_name<~String> - secondary name
ip_addresses<~Array> - List of secondary ip addresses
response<~Excon::Response>:
body<~Hash>:
name<~String> Secondary name.
ip<~Array> List of strings, IP addresses for your master nameserver associated with this secondary entry. e.g. ["10.10.10.10", "10.10.10.11"]
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
status<~Integer> - 201 - secondary entry successfully created or modified, 400 - secondary entry name or IP addresses not valid, see errors in response content
# File lib/fog/dnsmadeeasy/requests/dns/create_secondary.rb, line 19 def create_secondary(secondary_name, ip_addresses) body = { "ip" => [*ip_addresses] } request( :expects => 201, :method => 'PUT', :path => "/V1.2/secondary/#{secondary_name}", :body => Fog::JSON.encode(body) ) end
Deletes all domains for your account.
response<~Excon::Response>:
body<~Hash>:
status<~Integer> - 200 - OK
# File lib/fog/dnsmadeeasy/requests/dns/delete_all_domains.rb, line 12 def delete_all_domains request( :expects => 200, :method => 'DELETE', :path => '/V1.2/domains' ) end
Deletes all secondary entries for your account.
response<~Excon::Response>:
status<~Integer> 200 - OK
# File lib/fog/dnsmadeeasy/requests/dns/delete_all_secondary.rb, line 11 def delete_all_secondary request( :expects => 200, :method => 'DELETE', :path => '/V1.2/secondary' ) end
Delete the given domain from your account.
domain<~String> - domain name
response<~Excon::Response>:
status<~Integer> 200 - OK, 404 - specified domain name is not found
# File lib/fog/dnsmadeeasy/requests/dns/delete_domain.rb, line 14 def delete_domain(domain) request( :expects => 200, :method => 'DELETE', :path => "/V1.2/domains/#{domain}" ) end
Deletes the record with the specified id. Note that records are not modifiable for domains that are locked to a template.
domain<~String> - domain name
record_id<~String> - record id
response<~Excon::Response>:
status<~Integer> 200 - OK, 404 - specified domain name or record id is not found
# File lib/fog/dnsmadeeasy/requests/dns/delete_record.rb, line 15 def delete_record(domain, record_id) request( :expects => 200, :method => 'DELETE', :path => "/V1.2/domains/#{domain}/records/#{record_id}" ) end
Deletes the specified secondary entry.
secondary_name<~String> - secondary domain name
response<~Excon::Response>:
status<~Integer> 200 - OK, 404 - specified secondary entry name is not found
# File lib/fog/dnsmadeeasy/requests/dns/delete_secondary.rb, line 14 def delete_secondary(secondary_name) request( :expects => 200, :method => 'DELETE', :path => "/V1.2/secondary/#{secondary_name}" ) end
Get the details for a specific domain in your account.
domain<~String> - domain name
response<~Excon::Response>:
body<~Hash>:
name<~String> The domain name.
nameServer<~Array> List of strings, Name servers associated with this domain e.g. ["ns1.dnsmadeeasy.com", "ns2.dnsmadeeasy.com"]
gtdEnabled<~Boolean> Indicator of whether or not this domain uses the Global Traffic Director.
status<~Integer> 200 - OK, 404 - specified domain name is not found
# File lib/fog/dnsmadeeasy/requests/dns/get_domain.rb, line 18 def get_domain(domain) request( :expects => 200, :method => "GET", :path => "/V1.2/domains/#{domain}" ) end
Returns a record object representing the record with the specified id.
domain<~String>
record_id<~Integer>
response<~Excon::Response>:
body<~Hash>:
id<~Integer> Unique record identifier
name<~String> Record name.
type<~String> Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT
data<~String> Record data
ttl<~Integer> Time to live. The amount of time a record will be cached before being refreshed. Default: 1800
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
password<~String> For A records. Password used to authenticate for dynamic DNS.
description<~String> For HTTPRED records. A description of the HTTPRED record.
keywords<~String> For HTTPRED records. Keywords associated with the HTTPRED record.
title<~String> For HTTPRED records. The title of the HTTPRED record.
redirectType<~String> For HTTPRED records. Type of redirection performed. Values: Hidden Frame Masked, Standard - 302, Standard - 301
hardLink<~Boolean> For HTTPRED records.
status<~Integer> - 200 - OK, 404 - specified domain name or record id is not found
# File lib/fog/dnsmadeeasy/requests/dns/get_record.rb, line 27 def get_record(domain, record_id) request( :expects => 200, :method => "GET", :path => "/V1.2/domains/#{domain}/records/#{record_id}" ) end
Returns the secondary entry object representation of the specified secondary entry.
secondary_name<~String> - secondary name
response<~Excon::Response>:
body<~Hash>:
name<~String> Secondary name.
ip<~Array> List of strings, IP addresses for your master nameserver associated with this secondary entry. e.g. ["10.10.10.10", "10.10.10.11"]
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
status<~Integer> - 200 - OK, 404 - specified secondary entry name is not found
# File lib/fog/dnsmadeeasy/requests/dns/get_secondary.rb, line 18 def get_secondary(secondary_name) request( :expects => 200, :method => "GET", :path => "/V1.2/secondary/#{secondary_name}" ) end
Returns a list of all domain names for your account.
response<~Excon::Response>:
body<~Hash>:
list<~Array> e.g. ["domain1.com","domain2.com", "domain3.com"]
status<~Integer> - 200 - OK
# File lib/fog/dnsmadeeasy/requests/dns/list_domains.rb, line 13 def list_domains request( :expects => 200, :method => 'GET', :path => '/V1.2/domains' ) end
Returns a list of record objects containing all records for the specified domain
domain<~String>
options<~Hash>
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
type<~String> Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT
response<~Excon::Response>:
body<~Hash>:
id<~Integer> Unique record identifier
name<~String> Record name.
type<~String> Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT
data<~String>
ttl<~Integer> Time to live. The amount of time a record will be cached before being refreshed.
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
password<~String> For A records. Password used to authenticate for dynamic DNS.
description<~String> For HTTPRED records. A description of the HTTPRED record.
keywords<~String> For HTTPRED records. Keywords associated with the HTTPRED record.
title<~String> For HTTPRED records. The title of the HTTPRED record.
redirectType<~String> For HTTPRED records. Type of redirection performed. Values: Hidden Frame Masked, Standard - 302, Standard - 301
hardLink<~Boolean> For HTTPRED records.
status<~Integer> - 200 - OK, 404 - specified domain name is not found
# File lib/fog/dnsmadeeasy/requests/dns/list_records.rb, line 30 def list_records(domain, options = {}) request( :expects => 200, :method => "GET", :path => "/V1.2/domains/#{domain}/records", :query => options ) end
Returns a list of all secondary entry names for your account.
response<~Excon::Response>:
body<~Hash>:
list<~Array> e.g. ["xxx.domain.com", "xxx.domain.com"]
status<~Integer> 200 - OK
# File lib/fog/dnsmadeeasy/requests/dns/list_secondary.rb, line 13 def list_secondary request( :expects => 200, :method => 'GET', :path => '/V1.2/secondary' ) end
# File lib/fog/dnsmadeeasy/dns.rb, line 94 def reload @connection.reset end
Updates a record with the representation specified in the request content. Returns errors if record is not valid. Note that a record ID will be generated by the system with this request and any ID that is sent will be ignored. Records are not modifiable for domains that are locked to a template.
DNS Made Easy has no update record method but they plan to add it in the next update! They sent a reponse suggesting, there going to internaly delete/create a new record when we make update record call, so I've done the same here for now! If want to update a record, it might be better to manually destroy and then create a new record
domain<~String> Domain name.
record_id<~Integer> Record id.
options<~Hash>
name<~String> Record name.
type<~String> Record type. Values: A, AAAA, CNAME, HTTPRED, MX, NS, PTR, SRV, TXT
ttl<~Integer> Time to live. The amount of time a record will be cached before being refreshed. Default: 1800 (30 mins)
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
password<~String> For A records. Password used to authenticate for dynamic DNS.
description<~String> For HTTPRED records. A description of the HTTPRED record.
keywords<~String> For HTTPRED records. Keywords associated with the HTTPRED record.
title<~String> For HTTPRED records. The title of the HTTPRED record.
redirectType<~String> For HTTPRED records. Type of redirection performed. Values: Hidden Frame Masked, Standard - 302, Standard - 301
hardLink<~Boolean> For HTTPRED records.
response<~Excon::Response>:
body<~Hash>:
id<~Integer> Unique record identifier
name<~String>
type<~String>
data<~String>
ttl<~Integer>
gtdLocation<~String>
password<~String>
description<~String>
keywords<~String>
title<~String>
redirectType<~String>
hardLink<~Boolean>
'status'<~Integer> - 201 - record successfully created, 400 - record not valid, see errors in response content, 404 - domain not found
# File lib/fog/dnsmadeeasy/requests/dns/update_record.rb, line 44 def update_record(domain, record_id, options = {}) request( :expects => 200, :method => "PUT", :path => "/V1.2/domains/#{domain}/records/#{record_id}", :body => Fog::JSON.encode(options) ) end
Modifies a secondary entry with the specified name. Returns errors if name is not valid or conflicts with another domain.
secondary_name<~String> - secondary name
ip_addresses<~Array> - List of secondary ip addresses
response<~Excon::Response>:
body<~Hash>:
name<~String> Secondary name.
ip<~Array> List of strings, IP addresses for your master nameserver associated with this secondary entry. e.g. ["10.10.10.10", "10.10.10.11"]
gtdLocation<~String> Global Traffic Director location. Values: DEFAULT, US_EAST, US_WEST, EUROPE
status<~Integer> - 201 - secondary entry successfully created or modified, 400 - secondary entry name or IP addresses not valid, see errors in response content
# File lib/fog/dnsmadeeasy/requests/dns/update_secondary.rb, line 19 def update_secondary(secondary_name, ip_addresses) body = { "ip" => [*ip_addresses] } request( :expects => 201, :method => 'PUT', :path => "/V1.2/secondary/#{secondary_name}", :body => Fog::JSON.encode(body) ) end
Generated with the Darkfish Rdoc Generator 2.