Class: Kontena::Plugin::Vagrant::Nodes::TerminateCommand

Inherits:
Command
  • Object
show all
Includes:
Cli::Common, Cli::GridOptions
Defined in:
lib/kontena/plugin/vagrant/nodes/terminate_command.rb

Instance Method Summary collapse

Instance Method Details

#destroyer(client) ⇒ Object

Parameters:

  • client (Kontena::Client)


22
23
24
# File 'lib/kontena/plugin/vagrant/nodes/terminate_command.rb', line 22

def destroyer(client)
  Kontena::Machine::Vagrant::NodeDestroyer.new(client)
end

#executeObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kontena/plugin/vagrant/nodes/terminate_command.rb', line 9

def execute
  require_api_url
  require_current_grid

  confirm_command("#{current_grid}/#{name}") unless forced?

  require_relative '../../../machine/vagrant'

  destroyer = destroyer(client(require_token))
  destroyer.run!(current_grid, name)
end