Module: GClouder::Resources::DNS::Remote

Defined in:
lib/gclouder/resources/dns.rb

Class Method Summary collapse

Class Method Details

.listObject



379
380
381
382
383
# File 'lib/gclouder/resources/dns.rb', line 379

def self.list
  zones.each_with_object({ "global" => [] }) do |zone, collection|
    collection["global"] << { "name" => zone["name"], "records" => records(zone["name"]) }
  end.delete_if { |_k, v| v.empty? }
end

.records(zone_name) ⇒ Object



385
386
387
# File 'lib/gclouder/resources/dns.rb', line 385

def self.records(zone_name)
  Resource.list("dns record-sets", "--zone #{zone_name}")
end

.zonesObject



389
390
391
# File 'lib/gclouder/resources/dns.rb', line 389

def self.zones
  Resource.list("dns managed-zones").map { |zone| zone }
end