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
Instance Method Summary collapse
Instance Method Details
#call(**options) ⇒ Object
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/dnsmadeeasy/cli/commands/zone.rb', line 228 def call(**) configure_authentication(credentials: [:credentials], api_key: [:api_key], api_secret: [:api_secret]) plan_context = build_plan_context(.fetch(:file), [:domain]) 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(result.value!) end |