Sha256: 56dd3a96485c117914f6d5b25b65be6b92bc2de36de49f66563548d489d1776e

Contents?: true

Size: 832 Bytes

Versions: 16

Compression:

Stored size: 832 Bytes

Contents

require_relative 'common'

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

    parameter "NAME", "Grid name"
    option "--statsd-server", "STATSD_SERVER", "Statsd server address (host:port)"
    option "--default-affinity", "[AFFINITY]", "Default affinity rule for the grid", multivalued: true

    def execute
      require_api_url
      token = require_token
      payload = {}
      if statsd_server
        server, port = statsd_server.split(':')
        payload[:stats] = {
          statsd: {
            server: server,
            port: port || 8125
          }
        }
      end
      if default_affinity_list
        payload[:default_affinity] = default_affinity_list
      end
      client(token).put("grids/#{name}", payload)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
kontena-cli-1.1.6 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.5 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.5.rc3 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.5.rc2 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.5.rc1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.4 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.2.0.dev1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.3 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.2 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.2.rc2 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.2.rc1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.1.rc1 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.0 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.0.rc2 lib/kontena/cli/grids/update_command.rb
kontena-cli-1.1.0.rc1 lib/kontena/cli/grids/update_command.rb