Sha256: 786be7576dd610b3c727f03df67143d13196b8131cf350ff49c77f68f6532835

Contents?: true

Size: 532 Bytes

Versions: 54

Compression:

Stored size: 532 Bytes

Contents

require_relative 'common'

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

    parameter "NAME", "Grid name to use"

    def execute
      require_api_url
      grid = find_grid_by_name(name)
      if !grid.nil?
        self.current_grid = grid
        puts "Using grid: #{grid['name'].cyan}"
      else
        abort "Could not resolve grid by name [#{name}]. For a list of existing grids please run: kontena grid list".colorize(:red)
      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/use_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.4 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.3 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.2 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.1 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.0 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.14.7 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.14.6 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.14.5 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.14.4 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.14.3 lib/kontena/cli/grids/use_command.rb
kontena-cli-0.14.2 lib/kontena/cli/grids/use_command.rb