Class: Fluent::Plugin::ElasticsearchOutput::Elasticsearch::Transport::Transport::HTTP::Faraday

Inherits:
Elasticsearch::Transport::Transport::HTTP::Faraday
  • Object
show all
Defined in:
lib/fluent/plugin/out_aws-elasticsearch-service.rb

Instance Method Summary collapse

Instance Method Details

#__aws_elasticsearch_service_setting(host, &block) ⇒ Object



182
183
184
185
186
187
188
189
190
191
192
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 182

def __aws_elasticsearch_service_setting(host, &block)
  lambda do |faraday|
    if host[:aws_elasticsearch_service]
      faraday.request :aws_sigv4,
                      credentials: host[:aws_elasticsearch_service][:credentials],
                      service_name: 'es',
                      region: host[:aws_elasticsearch_service][:region]
    end
    block.call faraday
  end
end

#__build_connectionsConnections::Collection

Builds and returns a collection of connections.

Returns:

  • (Connections::Collection)


160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 160

def __build_connections
  ::Elasticsearch::Transport::Transport::Connections::Collection.new(
    :connections => hosts.map { |host|
      host[:protocol]   = host[:scheme] || DEFAULT_PROTOCOL
      host[:port]     ||= DEFAULT_PORT
      url               = __full_url(host)

      ::Elasticsearch::Transport::Transport::Connections::Connection.new(
        :host => host,
        :connection => ::Faraday::Connection.new(
          url,
          (options[:transport_options] || {}),
          &__aws_elasticsearch_service_setting(host, &@block)
        ),
        :options => host[:connection_options]
      )
    },
    :selector_class => options[:selector_class],
    :selector => options[:selector]
  )
end

#__build_connections_origin_from_aws_elasticsearch_service_outputObject



153
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 153

alias :__build_connections_origin_from_aws_elasticsearch_service_output :__build_connections