Sha256: 93740341613dbaff6435509851297b4ed8d274cc5e3aa88adc318e4e04bc52ae

Contents?: true

Size: 621 Bytes

Versions: 54

Compression:

Stored size: 621 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Grids
  class CreateCommand < Clamp::Command
    include Kontena::Cli::Common
    include Common

    parameter "NAME", "Grid name"
    option "--initial-size", "INITIAL_SIZE", "Initial grid size (number of nodes)", default: 1

    def execute
      require_api_url

      token = require_token
      payload = {
        name: name
      }
      payload[:initial_size] = initial_size if initial_size
      grid = client(token).post('grids', payload)
      if grid
        self.current_grid = grid
        puts "Using grid: #{grid['name'].cyan}"
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.4 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.3 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.2 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.1 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.0 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.14.7 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.14.6 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.14.5 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.14.4 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.14.3 lib/kontena/cli/grids/create_command.rb
kontena-cli-0.14.2 lib/kontena/cli/grids/create_command.rb