Sha256: e6eee2748078cd9b868c54ebb8b616d7f8eafe78dcb3d71a29c9ca75b50d0a51
Contents?: true
Size: 923 Bytes
Versions: 18
Compression:
Stored size: 923 Bytes
Contents
# frozen_string_literal: true require_relative "base" module Neetob class CLI module Cloudflare class DnsProxyStatus < Base attr_accessor :domain def initialize(domain) super() @domain = domain end def run zone_id = ZONE_IDS[domain.to_sym] raise(StandardError, "Domain '#{domain}' not found.") if zone_id.nil? url = create_url(zone_id, "dns_records") response = get(url) raise(StandardError, "No DNS records found") if response[:result].empty? response[:result].each do |record| if record[:proxiable] ui.info( "DNS proxy is turned #{record[:proxied] ? print_success("on") : print_failure("off")} " \ "for #{record[:type]} record #{record[:name]}") end end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems