Class: ThreeScaleToolbox::Commands::ProductCommand::CopySubcommand
- Inherits:
-
Cri::CommandRunner
- Object
- Cri::CommandRunner
- ThreeScaleToolbox::Commands::ProductCommand::CopySubcommand
show all
- Includes:
- ThreeScaleToolbox::Command
- Defined in:
- lib/3scale_toolbox/commands/product_command/copy_command.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#config, #config_file, #exit_with_message, #fetch_required_option, included, #remotes, #threescale_client, #verbose, #verify_ssl
Class Method Details
.command ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/3scale_toolbox/commands/product_command/copy_command.rb', line 10
def self.command
Cri::Command.define do
name 'copy'
usage 'copy [opts] -s <source-remote> -d <target-remote> <source-product>'
summary 'Copy product'
description " This command makes a copy of the referenced product.\n Target product will be searched by source product system name. System name can be overriden with `--target-system-name` option.\n If a product with the selected `system_name` is not found, it will be created.\n \\n Components of the product being copied:\n \\nproduct configuration\n \\nproduct settings\n \\nproduct methods&metrics: Only missing metrics&methods will be created.\n \\nproduct mapping rules: Only missing mapping rules will be created.\n \\nproduct application plans & pricing rules & limits: Only missing application plans & pricing rules & limits will be created.\n \\nproduct application usage rules\n \\nproduct policies\n \\nproduct backends: Only missing backends will be created.\n \\nproduct activedocs: Only missing activedocs will be created.\n HEREDOC\n\n option :s, :source, '3scale source instance. Url or remote name', argument: :required\n option :d, :destination, '3scale target instance. Url or remote name', argument: :required\n option :t, 'target-system-name', 'Target system name. Default to source system name', argument: :required\n param :source_product\n\n runner CopySubcommand\n end\nend\n"
|
.workflow(context) ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/3scale_toolbox/commands/product_command/copy_command.rb', line 40
def self.workflow(context)
tasks = []
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CreateOrUpdateTargetServiceTask.new(context)
tasks << CopyCommand::DeleteExistingTargetBackendUsagesTask.new(context)
tasks << CopyCommand::CopyBackendsTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyServiceProxyTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyMethodsTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyMetricsTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::DestroyMappingRulesTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyMappingRulesTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyApplicationPlansTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyLimitsTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyPoliciesTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyPricingRulesTask.new(context)
tasks << ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::CopyActiveDocsTask.new(context)
tasks.each(&:call)
ThreeScaleToolbox::Commands::ServiceCommand::CopyCommand::BumpProxyVersionTask.new(service: context[:target]).call
end
|
Instance Method Details
#run ⇒ Object
61
62
63
|
# File 'lib/3scale_toolbox/commands/product_command/copy_command.rb', line 61
def run
self.class.workflow(context)
end
|