Method: Ftl::Client#destroy

Defined in:
lib/ftl/client.rb

#destroy(args = {}) ⇒ Object Also known as: d, delete, kill, down, shutdown



163
164
165
166
167
168
169
170
171
172
173
# File 'lib/ftl/client.rb', line 163

def destroy(args={})
  guard(on_what, "Please provide the name (or partial name for the instance(s) you want to delete. For instance, like: ftl destroy ninja")
  display "Spinning down FTL..."
  instances = find_instances(on_what).select{|i| i.state == 'running' }
  if !instances.empty?
    instances.map(&:destroy)
    display "Destroyed [bold]\[#{instances.map(&:id).join(', ')}\][/]"
  else
    display "No instances found"
  end
end