Class: Jackal::Stacks::Wrecker
- Inherits:
-
Callback
- Object
- Callback
- Jackal::Stacks::Wrecker
- Includes:
- StackCommon
- Defined in:
- lib/jackal-stacks/wrecker.rb
Overview
Stack destroyer
Instance Method Summary collapse
-
#execute(message) ⇒ Object
Build or update stacks.
-
#setup(*_) ⇒ Object
Setup callback.
-
#valid?(message) ⇒ Truthy, Falsey
Determine validity of message.
Methods included from StackCommon
#api_config, #determine_namespace, #stack_name, #stacks_api
Instance Method Details
#execute(message) ⇒ Object
Build or update stacks
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/jackal-stacks/wrecker.rb', line 28 def execute() failure_wrap() do |payload| s_name = stack_name(payload) stack = stacks_api.stacks.get(s_name) if(stack) info "Stack currently exists. Destroying. [#{stack.name}]" stack.destroy payload.set(:data, :stacks, :destroyed, true) job_completed(:stacks, payload, ) else error "Failed to locate requested stack for destruction [#{s_name}]" failed(payload, , 'Requested stack does not exist') end end end |
#setup(*_) ⇒ Object
Setup callback
11 12 13 |
# File 'lib/jackal-stacks/wrecker.rb', line 11 def setup(*_) stacks_api end |
#valid?(message) ⇒ Truthy, Falsey
Determine validity of message
19 20 21 22 23 |
# File 'lib/jackal-stacks/wrecker.rb', line 19 def valid?() super do |payload| payload.get(:data, :stacks, :wrecker) end end |