Class: ThreeScaleToolbox::Commands::PlansCommand::Export::ExportSubcommand

Inherits:
Cri::CommandRunner
  • Object
show all
Includes:
ThreeScaleToolbox::Command
Defined in:
lib/3scale_toolbox/commands/plans_command/export_command.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ThreeScaleToolbox::Command

#config, #config_file, #exit_with_message, #fetch_required_option, included, #remotes, #threescale_client, #verbose, #verify_ssl

Class Method Details

.commandObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/3scale_toolbox/commands/plans_command/export_command.rb', line 17

def self.command
  Cri::Command.define do
    name        'export'
    usage       'export [opts] <remote> <service_system_name> <plan_system_name>'
    summary     'export application plan'
    description 'Export application plan, limits, pricing rules and features'

    option      :f, :file, 'Write to file instead of stdout', argument: :required
    param       :remote
    param       :service_system_name
    param       :plan_system_name

    runner ExportSubcommand
  end
end

Instance Method Details

#runObject



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/3scale_toolbox/commands/plans_command/export_command.rb', line 33

def run
  tasks = []
  tasks << ReadAppPlanStep.new(context)
  tasks << ReadPlanLimitsStep.new(context)
  tasks << ReadPlanPricingRulesStep.new(context)
  tasks << ReadPlanFeaturesStep.new(context)
  tasks << ReadPlanMethods.new(context)
  tasks << ReadPlanMetrics.new(context)
  tasks << WriteArtifactsStep.new(context)

  # run tasks
  tasks.each(&:call)
end