Sha256: f113b6c74220680c4ab48a33ccb9259c779a4fc295bf22e297b07fd734c87a20

Contents?: true

Size: 645 Bytes

Versions: 8

Compression:

Stored size: 645 Bytes

Contents

module Kontena::Cli::Nodes::Packet
  class TerminateCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "NAME", "Node name"
    option "--token", "TOKEN", "Packet API token", required: true
    option "--project", "PROJECT ID", "Packet project id", required: true

    def execute
      require_api_url
      require_current_grid

      require 'kontena/machine/packet'
      grid = client(require_token).get("grids/#{current_grid}")
      destroyer = Kontena::Machine::Packet::NodeDestroyer.new(client(require_token), token)
      destroyer.run!(grid, project, name)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
kontena-cli-0.14.7 lib/kontena/cli/nodes/packet/terminate_command.rb
kontena-cli-0.14.6 lib/kontena/cli/nodes/packet/terminate_command.rb
kontena-cli-0.14.5 lib/kontena/cli/nodes/packet/terminate_command.rb
kontena-cli-0.14.4 lib/kontena/cli/nodes/packet/terminate_command.rb
kontena-cli-0.14.3 lib/kontena/cli/nodes/packet/terminate_command.rb
kontena-cli-0.14.2 lib/kontena/cli/nodes/packet/terminate_command.rb
kontena-cli-0.14.1 lib/kontena/cli/nodes/packet/terminate_command.rb
kontena-cli-0.14.0 lib/kontena/cli/nodes/packet/terminate_command.rb