Sha256: ffb98fa65cb53e9a05d06b85990d2901ccdcf6e51ac826514d48515c2509a891

Contents?: true

Size: 493 Bytes

Versions: 4

Compression:

Stored size: 493 Bytes

Contents

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

    parameter "KEY", "Etcd key"

    def execute
      require_api_url
      token = require_token
      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

4 entries across 4 versions & 1 rubygems

Version Path
kontena-cli-0.9.3 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.9.2 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.9.1 lib/kontena/cli/etcd/get_command.rb
kontena-cli-0.9.0 lib/kontena/cli/etcd/get_command.rb