Class: Logcli::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/cli.rb

Instance Method Summary collapse

Instance Method Details

#elasticsearchObject



38
39
40
41
42
# File 'lib/cli.rb', line 38

def elasticsearch
  params = Logcli::Params::Elasticsearch.new options
  json = Logcli::Actions::Elasticsearch.new(params.parse_params)
  json.call
end

#extract_jsonObject



27
28
29
30
31
# File 'lib/cli.rb', line 27

def extract_json
  params = Logcli::Params::Json.new options
  json = Logcli::Actions::ExtractJson.new(params.parse_params)
  json.call
end

#fetchObject



13
14
15
16
17
18
19
20
21
# File 'lib/cli.rb', line 13

def fetch
  params = Logcli::Params::Session.new options
  ssh = Logcli::SSH.new params
  grep = Logcli::Actions::Grep.new params.action_params
  grep.call ssh
  scp = Logcli::SCP.new params
  download = Logcli::Actions::Download.new({remote_path: grep.tmp_path, local_path: params.local_path })
  download.call scp
end