Method: Nettica::Client#create_domain_record
- Defined in:
- lib/nettica/client.rb
#create_domain_record(domainName = nil, hostName = nil, recordType = nil, data = nil, ttl = 0, priority = 0) ⇒ Object
domainName - SOAP::SOAPString
hostName - SOAP::SOAPString
recordType - SOAP::SOAPString
data - SOAP::SOAPString
ttl - SOAP::SOAPInt
priority - SOAP::SOAPInt
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/nettica/client.rb', line 29 def create_domain_record(domainName = nil, hostName = nil, recordType = nil, data = nil, ttl = 0, priority = 0) valid_ttls = [0, 1, 60, 300, 600, 900, 1800, 2700, 3600, 7200, 14400, 28800, 43200, 64800, 86400, 172800] raise "Ttl must be one of #{valid_ttls.join(',')}" if ttl && ! valid_ttls.include?(ttl) mx_prio = [5, 10, 20, 30, 40, 50, 60, 70, 80, 90] f_prio = [1, 2, 3] raise "MX priority must be one of #{mx_prio.join(',')}" if recordType == "MX" and ! mx_prio.include?(priority) raise "F priority must be one of #{f_prio.join(',')}" if recordType == "F" and ! f_prio.include?(priority) valid_types = ["A", "CNAME", "MX", "F", "TXT", "SRV"] raise "Record type must be one of #{valid_types.join(',')}" if recordType && ! valid_types.include?(recordType) DomainRecord.new(domainName, hostName, recordType, data, ttl, priority) end |