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



157
158
159
160
161
162
163
164
165
166
167
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 157

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)


135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/fluent/plugin/out_aws-elasticsearch-service.rb', line 135

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



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

alias :__build_connections_origin_from_aws_elasticsearch_service_output :__build_connections