Sha256: c8aed37d95185de6e94a1b5ab163b51ca2678ce61572b64e005e22a8e732de70

Contents?: true

Size: 714 Bytes

Versions: 30

Compression:

Stored size: 714 Bytes

Contents

module Kontena::Cli::Master::Config
  class GetCommand < Kontena::Command

    include Kontena::Cli::Common

    requires_current_master
    requires_current_master_token

    banner "Reads a configuration value from master"

    parameter "KEY", "Configuration key to read from master", required: true

    option ['-p', '--pair'], :flag, "Print key=value instead of only value"

    option '--return', :flag, "Return the value", hidden: true

    def execute
      if self.pair?
        puts client.get("config/#{self.key}").inspect
      elsif self.return?
        return client.get("config/#{self.key}")[self.key]
      else
        puts client.get("config/#{self.key}")[self.key]
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
kontena-cli-1.3.0.pre2 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.3.0.pre1 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.2 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.2.rc2 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.2.rc1 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.1 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.1.rc1 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.0 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.0.rc3 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.0.rc2 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.0.rc1 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.0.pre3 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.0.pre2 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.1.6 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.2.0.pre1 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.1.5 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.1.5.rc3 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.1.5.rc2 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.1.5.rc1 lib/kontena/cli/master/config/get_command.rb
kontena-cli-1.1.4 lib/kontena/cli/master/config/get_command.rb