Class: Kontena::Plugin::Packet::Nodes::TerminateCommand
- Inherits:
-
Command
- Object
- Command
- Kontena::Plugin::Packet::Nodes::TerminateCommand
- Includes:
- Cli::Common, Cli::GridOptions, ProjectOption, TokenOption
- Defined in:
- lib/kontena/plugin/packet/nodes/terminate_command.rb
Instance Method Summary collapse
Methods included from ProjectOption
Methods included from TokenOption
Instance Method Details
#destroyer(client, token) ⇒ Object
28 29 30 |
# File 'lib/kontena/plugin/packet/nodes/terminate_command.rb', line 28 def destroyer(client, token) Kontena::Machine::Packet::NodeDestroyer.new(client, token) end |
#execute ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/kontena/plugin/packet/nodes/terminate_command.rb', line 16 def execute confirm_command(name) unless force? require_api_url require_current_grid require 'kontena/machine/packet' grid = client(require_token).get("grids/#{current_grid}") destroyer = destroyer(client(require_token), token) destroyer.run!(grid, project, name) end |