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.6.1 lib/kontena/cli/grids/update_command.rb
krates-1.6.0 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.4 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.4.rc1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.3 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.2 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.0 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.0.rc1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.0.pre5 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.0.pre4 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.0.pre3 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.0.pre2 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.5.0.pre1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.4.3 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.4.3.rc1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.4.2 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.4.2.rc1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.4.2.pre1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.4.1 lib/kontena/cli/grids/update_command.rb