Class: ZerigoDNS::ZoneTemplate
- Includes:
- Resource
- Defined in:
- lib/zerigodns/zone_template.rb
Constant Summary
Constants inherited from Client
Client::ACTIONS, Client::ResponseError
Instance Attribute Summary
Attributes inherited from Client
Class Method Summary collapse
-
.count ⇒ Fixnum
Get count of zone templates.
Instance Method Summary collapse
-
#count_host_templates ⇒ Fixnum
Get count of host templates.
-
#create_host_template(attrs = {}) ⇒ Object
Create a host template for this template.
-
#create_zone(attrs) ⇒ Zone
Create a zone using the zone template.
-
#host_templates ⇒ Array
List all host templates of this zone template.
Methods included from Resource
Methods inherited from Client
Class Method Details
.count ⇒ Fixnum
Get count of zone templates
7 8 9 |
# File 'lib/zerigodns/zone_template.rb', line 7 def self.count get('zone_templates/count.xml').body['count'].to_i end |
Instance Method Details
#count_host_templates ⇒ Fixnum
Get count of host templates
13 14 15 |
# File 'lib/zerigodns/zone_template.rb', line 13 def count_host_templates get("zone_templates/#{id}/host_templates/count.xml").body['count'].to_i end |
#create_host_template(attrs = {}) ⇒ Object
Create a host template for this template
38 39 40 |
# File 'lib/zerigodns/zone_template.rb', line 38 def create_host_template attrs={} ZerigoDNS::HostTemplate.create(attrs.merge(zone_template_id: id)) end |
#create_zone(attrs) ⇒ Zone
Create a zone using the zone template
26 27 28 |
# File 'lib/zerigodns/zone_template.rb', line 26 def create_zone attrs ZerigoDNS::Zone.create({follow_template: 'follow', zone_template_id: id}.merge(attrs)) end |
#host_templates ⇒ Array
List all host templates of this zone template
32 33 34 |
# File 'lib/zerigodns/zone_template.rb', line 32 def host_templates @host_templates ||= ZerigoDNS::HostTemplate.all(zone_template_id: id) end |