Sha256: a07558d4a6fb2054c6dfc8a86027f9fd76a6c37f3b91937d64c68e8ece0e5d6f

Contents?: true

Size: 596 Bytes

Versions: 32

Compression:

Stored size: 596 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Etcd
  class GetCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions
    include Common

    parameter "KEY", "Etcd key"

    def execute
      require_api_url
      token = require_token
      validate_key

      response = client(token).get("etcd/#{current_grid}/#{key}")
      if response['value']
        puts response['value']
      elsif response['children']
        abort "Cannot get value from a directory"
      elsif response['error']
        abort response['error']
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.4 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.3 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.2 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.0 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.14.7 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.14.6 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.14.5 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.14.4 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.14.3 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.14.2 lib/kontena/cli/etcd/get_command.rb