Sha256: 14573ab2fc5060975ec1980e12ffd1664c1dcc383b3a3e333f89cd9f21198909

Contents?: true

Size: 636 Bytes

Versions: 34

Compression:

Stored size: 636 Bytes

Contents

module Kontena::Cli::Nodes
  class CreateCommand < Kontena::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    requires_current_master
    requires_current_master_token
    requires_current_grid

    parameter "NAME", "Node name"
    option ["--token"], "TOKEN", "Node token"
    option ["-l", "--label"], "LABEL", "Node label", multivalued: true

    def execute
      data = { name: name }

      data[:token] = token if token
      data[:labels] = label_list

      spinner "Creating #{pastel.cyan(name)} node " do
        client.post("grids/#{current_grid}/nodes", data)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/nodes/create_command.rb
krates-1.7.10 lib/kontena/cli/nodes/create_command.rb
krates-1.7.9 lib/kontena/cli/nodes/create_command.rb
krates-1.7.8 lib/kontena/cli/nodes/create_command.rb
krates-1.7.7 lib/kontena/cli/nodes/create_command.rb
krates-1.7.6 lib/kontena/cli/nodes/create_command.rb
krates-1.7.5 lib/kontena/cli/nodes/create_command.rb
krates-1.7.4 lib/kontena/cli/nodes/create_command.rb
krates-1.7.3 lib/kontena/cli/nodes/create_command.rb
krates-1.7.2 lib/kontena/cli/nodes/create_command.rb
krates-1.7.1 lib/kontena/cli/nodes/create_command.rb
krates-1.7.0 lib/kontena/cli/nodes/create_command.rb
krates-1.6.9 lib/kontena/cli/nodes/create_command.rb
krates-1.6.8 lib/kontena/cli/nodes/create_command.rb
krates-1.6.7 lib/kontena/cli/nodes/create_command.rb
krates-1.6.6 lib/kontena/cli/nodes/create_command.rb
krates-1.6.5 lib/kontena/cli/nodes/create_command.rb
krates-1.6.4 lib/kontena/cli/nodes/create_command.rb
krates-1.6.3 lib/kontena/cli/nodes/create_command.rb
krates-1.6.2 lib/kontena/cli/nodes/create_command.rb