Sha256: 3a22d88f6b0df1298a3008cf2077cc641262a7b008310a8509da1159107c2741

Contents?: true

Size: 723 Bytes

Versions: 59

Compression:

Stored size: 723 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Grids
  class UpdateCommand < Kontena::Command
    include Kontena::Cli::Common
    include Common

    parameter "NAME", "Grid name"

    include Common::Parameters

    option "--no-default-affinity", :flag, "Unset grid default affinity"
    option "--no-statsd-server", :flag, "Unset statsd server setting"

    requires_current_master_token

    def execute
      validate_grid_parameters

      payload = {}

      build_grid_parameters(payload)

      if no_statsd_server?
        payload[:stats] = { statsd:  nil }
      end

      if no_default_affinity?
        payload[:default_affinity] = []
      end

      client.put("grids/#{name}", payload)
    end
  end
end

Version data entries

59 entries across 59 versions & 2 rubygems

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