Sha256: f38cce0317253ce821f5fef6338244064f5c408eabdd3c3f0c1568b2e534e8c3

Contents?: true

Size: 607 Bytes

Versions: 10

Compression:

Stored size: 607 Bytes

Contents

require_relative 'services_helper'

module Kontena::Cli::Services
  class ScaleCommand < Clamp::Command
    include Kontena::Cli::Common
    include ServicesHelper

    parameter "NAME", "Service name"
    parameter "INSTANCES", "Scales service to given number of instances"
    option '--strategy', 'STRATEGY', 'Define deploy strategy (ha / random)'

    def execute
      token = require_token
      client(token).put("services/#{parse_service_id(name)}", {container_count: instances})
      opts = {}
      opts[:strategy] = strategy if strategy
      deploy_service(token, name, opts)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kontena-cli-0.9.3 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.9.2 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.9.1 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.9.0 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.8.4 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.8.3 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.8.2 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.8.1 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.8.0.1 lib/kontena/cli/services/scale_command.rb
kontena-cli-0.8.0 lib/kontena/cli/services/scale_command.rb