Class: Stackit::StackCli

Inherits:
BaseCli
  • Object
show all
Defined in:
lib/stackit/cli/stack_cli.rb

Direct Known Subclasses

StackitCli

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseCli

banner, exit_on_failure?, subcommand_prefix

Constructor Details

#initialize(*args) ⇒ StackCli

Returns a new instance of StackCli.



10
11
12
13
# File 'lib/stackit/cli/stack_cli.rb', line 10

def initialize(*args)
  super(*args)
  self.notifier = Stackit::ThorNotifier.new(*args)
end

Instance Attribute Details

#notifierObject

Returns the value of attribute notifier.



8
9
10
# File 'lib/stackit/cli/stack_cli.rb', line 8

def notifier
  @notifier
end

Instance Method Details

#create_stackObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/stackit/cli/stack_cli.rb', line 27

def create_stack
  ManagedStack.new({
    template: options[:template],
    stack_name: options[:stack_name],
    stack_policy: options[:stack_policy],
    depends: options[:depends],
    user_defined_parameters: options[:parameters],
    parameters_file: options[:parameters_file],
    parameter_map: options[:parameter_map],
    wait: options[:wait],
    force: options[:force],
    dry_run: options[:dry_run],
    debug: !!options[:debug]
  }).create!
end

#delete_stackObject



78
79
80
81
82
83
84
85
# File 'lib/stackit/cli/stack_cli.rb', line 78

def delete_stack
  ManagedStack.new({
    stack_name: options[:stack_name],
    wait: options[:wait],
    dry_run: options[:dry_run],
    debug: !!options[:debug]
  }).delete!
end

#update_stackObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/stackit/cli/stack_cli.rb', line 56

def update_stack
  ManagedStack.new({
    template: options[:template],
    stack_name: options[:stack_name],
    stack_policy: options[:stack_policy],
    stack_policy_during_update: options[:stack_policy_during_update],
    depends: options[:depends],
    user_defined_parameters: options[:parameters],
    parameters_file: options[:parameters_file],
    parameter_map: options[:parameter_map],
    wait: options[:wait],
    force: options[:force],
    dry_run: options[:dry_run],
    debug: !!options[:debug]
  }).update!
end