Class: Fog::Linode::DNS::Zone
- Defined in:
- lib/fog/dns/models/linode/zone.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Zone
constructor
“STATUS”:1, “RETRY_SEC”:0, “MASTER_IPS”:“”, “EXPIRE_SEC”:0, “REFRESH_SEC”:0, “TTL_SEC”:0.
- #nameservers ⇒ Object
- #records ⇒ Object
- #save ⇒ Object
Methods inherited from Model
#inspect, #reload, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires
Constructor Details
#initialize(attributes = {}) ⇒ Zone
“STATUS”:1, “RETRY_SEC”:0, “MASTER_IPS”:“”, “EXPIRE_SEC”:0, “REFRESH_SEC”:0, “TTL_SEC”:0
25 26 27 28 29 |
# File 'lib/fog/dns/models/linode/zone.rb', line 25 def initialize(attributes={}) self.type ||= 'master' self.ttl ||= 3600 super end |
Instance Method Details
#destroy ⇒ Object
31 32 33 34 35 |
# File 'lib/fog/dns/models/linode/zone.rb', line 31 def destroy requires :identity connection.domain_delete(identity) true end |
#nameservers ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/fog/dns/models/linode/zone.rb', line 46 def nameservers [ 'ns1.linode.com', 'ns2.linode.com', 'ns3.linode.com', 'ns4.linode.com', 'ns5.linode.com' ] end |
#records ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/fog/dns/models/linode/zone.rb', line 37 def records @records ||= begin Fog::Linode::DNS::Records.new( :zone => self, :connection => connection ) end end |
#save ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/fog/dns/models/linode/zone.rb', line 56 def save requires :domain, :type requires :email if type == 'master' = {} # * options<~Hash> # * refresh_sec<~Integer> numeric, default: '0' # * retry_sec<~Integer> numeric, default: '0' # * expire_sec<~Integer> numeric, default: '0' # * status<~Integer> 0, 1, or 2 (disabled, active, edit mode), default: 1 # * master_ips<~String> When type=slave, the zone's master DNS servers list, semicolon separated [:description] = description if description [:soa_email] = email if email [:ttl_sec] = ttl if ttl response = unless identity connection.domain_create(domain, type, ) else [:domain] = domain if domain [:type] = type if type connection.domain_update(identity, ) end merge_attributes(response.body['DATA']) true end |