Class: LogStash::ElasticsearchClient

Inherits:
Object
  • Object
show all
Includes:
Util::Loggable
Defined in:
lib/logstash/elasticsearch_client.rb

Defined Under Namespace

Classes: Response, RubyClient

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util::Loggable

included, #logger, #slow_logger

Constructor Details

#initialize(client) ⇒ ElasticsearchClient

Returns a new instance of ElasticsearchClient.



119
120
121
# File 'lib/logstash/elasticsearch_client.rb', line 119

def initialize(client)
  @client = client
end

Class Method Details

.build(settings) ⇒ Object



20
21
22
# File 'lib/logstash/elasticsearch_client.rb', line 20

def self.build(settings)
  new(RubyClient.new(settings, logger))
end

Instance Method Details

#can_connect?Boolean

Returns:

  • (Boolean)


135
136
137
# File 'lib/logstash/elasticsearch_client.rb', line 135

def can_connect?
  @client.can_connect?
end

#delete(path) ⇒ Object



123
124
125
# File 'lib/logstash/elasticsearch_client.rb', line 123

def delete(path)
  @client.delete(path)
end

#head(path) ⇒ Object



131
132
133
# File 'lib/logstash/elasticsearch_client.rb', line 131

def head(path)
  @client.head(path)
end

#host_settingsObject



139
140
141
# File 'lib/logstash/elasticsearch_client.rb', line 139

def host_settings
  @client.host_settings
end

#put(path, content) ⇒ Object



127
128
129
# File 'lib/logstash/elasticsearch_client.rb', line 127

def put(path, content)
  @client.put(path, content)
end