Class: ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyApplicationPlansTask
- Inherits:
-
Object
- Object
- ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyApplicationPlansTask
- Includes:
- Task
- Defined in:
- lib/3scale_toolbox/commands/service_command/copy_command/copy_app_plans_task.rb
Instance Attribute Summary
Attributes included from Task
Instance Method Summary collapse
Methods included from Task
#delete_mapping_rules, #find_source_service, #force_delete_mapping_rules, #initialize, #invalidate_target_methods, #invalidate_target_metrics, #option_target_system_name, #source, #source_hits, #source_methods, #source_metrics, #source_metrics_and_methods, #source_remote, #source_service_ref, #target, #target=, #target_hits, #target_methods, #target_metrics, #target_metrics_and_methods, #target_remote
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/3scale_toolbox/commands/service_command/copy_command/copy_app_plans_task.rb', line 8 def call source_plans = source.plans target_plans = target.plans missing_plans = missing_app_plans(source_plans, target_plans) missing_plans.each do |plan| plan.delete('links') plan.delete('default') # TODO: handle default plan if plan.delete('custom') # TODO: what to do with custom plans? puts "skipping custom plan #{plan}" else ThreeScaleToolbox::Entities::ApplicationPlan.create(service: target, plan_attrs: plan) end end puts "target service missing #{missing_plans.size} application plans" end |