Sha256: 38007a5995742975093f4765adc37abeb024d37a6e6a7b753e7d92821a5997b5

Contents?: true

Size: 639 Bytes

Versions: 25

Compression:

Stored size: 639 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 #{name.colorize(:cyan)} node " do
        client.post("grids/#{current_grid}/nodes", data)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
kontena-cli-1.4.3 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.2 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.1 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.1.rc1 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.1.pre1 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.rc2 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.rc1 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre14 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre13 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre12 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre11 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre10 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre9 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre8 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre7 lib/kontena/cli/nodes/create_command.rb
kontena-cli-1.4.0.pre6 lib/kontena/cli/nodes/create_command.rb