Sha256: 5f89b85c422d5f40fb018f075185a5bec54012fcfd1286d1898dfbcf430192d1
Contents?: true
Size: 1.02 KB
Versions: 46
Compression:
Stored size: 1.02 KB
Contents
require_relative 'common' module Kontena::Cli::Grids class CreateCommand < Kontena::Command include Kontena::Cli::Common include Common parameter "NAME", "Grid name" option "--initial-size", "INITIAL_SIZE", "Initial grid size (number of nodes)", default: 1 option "--silent", :flag, "Reduce output verbosity" option "--token", "[TOKEN]", "Set grid token" requires_current_master_token def execute payload = { name: name } payload[:token] = self.token if self.token payload[:initial_size] = initial_size if initial_size grid = nil if initial_size == 1 warning "Option --initial-size=1 is only recommended for test/dev usage" unless running_silent? end spinner "Creating #{pastel.cyan(name)} grid " do grid = client.post('grids', payload) end if grid spinner "Switching scope to #{pastel.cyan(name)} grid " do config.current_grid = grid['name'] config.write end end end end end
Version data entries
46 entries across 46 versions & 1 rubygems