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

Constructor Details

#initialize(client) ⇒ ElasticsearchClient

Returns a new instance of ElasticsearchClient.



116
117
118
# File 'lib/logstash/elasticsearch_client.rb', line 116

def initialize(client)
  @client = client
end

Class Method Details

.build(settings) ⇒ Object



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

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

Instance Method Details

#can_connect?Boolean

Returns:

  • (Boolean)


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

def can_connect?
  @client.can_connect?
end

#delete(path) ⇒ Object



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

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

#head(path) ⇒ Object



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

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

#host_settingsObject



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

def host_settings
  @client.host_settings
end

#put(path, content) ⇒ Object



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

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