Class: DnsMadeEasy::CLI::Commands::Zone::Apply
- Defined in:
- lib/dnsmadeeasy/cli/commands/zone.rb
Overview
Applies a reviewed zone plan safely.
Constant Summary
Constants inherited from Base
Base::DEFAULT_CREDENTIAL_PATHS, Base::SUPPORTED_FORMATS
Constants included from MessageHelpers
Instance Method Summary collapse
Methods included from MessageHelpers
error, included, info, print_box, success, warn
Instance Method Details
#call(**options) ⇒ Object
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/dnsmadeeasy/cli/commands/zone.rb', line 241 def call(**) configure_authentication(credentials: [:credentials], api_key: [:api_key], api_secret: [:api_secret]) plan_context = build_plan_context(.fetch(:file), [:domain], compare_ttl: [:diff_ttl]) return fail_with('Zone apply failed', plan_context.failure) if plan_context.failure? mode = apply_mode() executor = DnsMadeEasy::Zone::ApplyExecutor.new( client: DnsMadeEasy.client, domain: plan_context.value!.fetch(:domain), plan: plan_context.value!.fetch(:plan), remote_records: plan_context.value!.fetch(:remote_records), mode: mode, spinner_output: @err ) executable_count = executor.executable_action_count confirm!(executable_count) unless [:yes] result = executor.call return fail_with('Zone apply failed', result.failure) if result.failure? print_apply_summary(plan_context.value!.fetch(:domain), result.value!) end |