Class: Fog::DNS::Google::Zone
- Inherits:
-
Model
- Object
- Model
- Fog::DNS::Google::Zone
- Defined in:
- lib/fog/dns/google/models/zone.rb
Overview
Managed Zone resource
Instance Method Summary collapse
-
#changes ⇒ Object
Enumerates the list of Changes for the Managed Zone.
-
#destroy ⇒ Boolean
Deletes a previously created Managed Zone.
-
#records ⇒ Object
Enumerates the list of Resource Record Sets for the Managed Zone.
-
#save ⇒ Fog::DNS::Google::Zone
Creates a new Managed Zone.
Instance Method Details
#changes ⇒ Object
Enumerates the list of Changes for the Managed Zone
22 23 24 25 26 27 28 29 |
# File 'lib/fog/dns/google/models/zone.rb', line 22 def changes @changes = begin Fog::DNS::Google::Changes.new( :service => service, :zone => self ) end end |
#destroy ⇒ Boolean
Deletes a previously created Managed Zone
35 36 37 38 39 40 |
# File 'lib/fog/dns/google/models/zone.rb', line 35 def destroy requires :identity service.delete_managed_zone(identity) true end |
#records ⇒ Object
Enumerates the list of Resource Record Sets for the Managed Zone
46 47 48 49 50 51 52 53 |
# File 'lib/fog/dns/google/models/zone.rb', line 46 def records @records = begin Fog::DNS::Google::Records.new( :service => service, :zone => self ) end end |
#save ⇒ Fog::DNS::Google::Zone
Creates a new Managed Zone
60 61 62 63 64 65 66 67 68 |
# File 'lib/fog/dns/google/models/zone.rb', line 60 def save requires :name, :domain, :description raise Fog::Errors::Error.new("Resaving an existing object may create a duplicate") if persisted? data = service.create_managed_zone(name, domain, description) merge_attributes(data.to_h) self end |