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

Public Instance Methods

__aws_elasticsearch_service_setting(host, &block) click to toggle source
# File lib/fluent/plugin/out_aws-elasticsearch-service.rb, line 179
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_connections() click to toggle source

Builds and returns a collection of connections.

@return [Connections::Collection] @override

# File lib/fluent/plugin/out_aws-elasticsearch-service.rb, line 157
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_output()
Alias for: __build_connections