Sha256: 7d19f8551f28dbc4d33c1656b67ee3c7fec7476a930f2c441f56ead390b67a3d

Contents?: true

Size: 564 Bytes

Versions: 12

Compression:

Stored size: 564 Bytes

Contents

require_relative 'common'

module Kontena::Cli::Etcd
  class GetCommand < Clamp::Command
    include Kontena::Cli::Common
    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

12 entries across 12 versions & 1 rubygems

Version Path
kontena-cli-0.11.7 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.11.6 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.11.5 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.11.4 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.11.3 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.11.2 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.11.1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.11.0 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.10.3 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.10.2 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.10.1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.10.0 lib/kontena/cli/etcd/get_command.rb