Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Search::Elasticsearch:User:Contributed Perl Search::Elasticsearch::Cxn::LWP(3)

NAME
       Search::Elasticsearch::Cxn::LWP - A Cxn implementation which uses LWP

VERSION
       version 5.02

DESCRIPTION
       Provides	an HTTP	Cxn class and based on LWP.  The LWP backend uses pure
       Perl and	persistent connections.

       This class does Search::Elasticsearch::Role::Cxn, whose documentation
       provides	more information, and Search::Elasticsearch::Role::Is_Sync.

CONFIGURATION
   Inherited configuration
       From Search::Elasticsearch::Role::Cxn

       o   node

       o   max_content_length

       o   deflate

       o   deflate

       o   request_timeout

       o   ping_timeout

       o   dead_timeout

       o   max_dead_timeout

       o   sniff_request_timeout

       o   sniff_timeout

       o   handle_args

       o   handle_args

SSL/TLS
       Search::Elasticsearch::Cxn::LWP uses IO::Socket::SSL to support HTTPS.
       By default, no validation of the	remote host is performed.

       This behaviour can be changed by	passing	the "ssl_options" parameter
       with any	options	accepted by IO::Socket::SSL. For instance, to check
       that the	remote host has	a trusted certificate, and to avoid man-in-
       the-middle attacks, you could do	the following:

	   use Search::Elasticsearch;

	   my $es = Search::Elasticsearch->new(
	       cxn   =>	'LWP',
	       nodes =>	[
		   "https://node1.mydomain.com:9200",
		   "https://node2.mydomain.com:9200",
	       ],
	       ssl_options => {
		   verify_hostname     => 1,
		   SSL_ca_file	       => '/path/to/cacert.pem'
	       }
	   );

       If the remote server cannot be verified,	an
       Search::Elasticsearch::Error will be thrown - LWP does not allow	us to
       detect that the connection error	was due	to invalid SSL.

       If you want your	client to present its own certificate to the remote
       server, then use:

	   use Search::Elasticsearch;

	   my $es = Search::Elasticsearch->new(
	       cxn   =>	'LWP',
	       nodes =>	[
		   "https://node1.mydomain.com:9200",
		   "https://node2.mydomain.com:9200",
	       ],
	       ssl_options => {
		   verify_hostname     => 1,
		   SSL_ca_file	       => '/path/to/cacert.pem',
		   SSL_use_cert	       => 1,
		   SSL_cert_file       => '/path/to/client.pem',
		   SSL_key_file	       => '/path/to/client.pem',
	       }
	   );

METHODS
   "perform_request()"
	   ($status,$body) = $self->perform_request({
	       # required
	       method	   => 'GET|HEAD|POST|PUT|DELETE',
	       path	   => '/path/of/request',
	       qs	   => \%query_string_params,

	       # optional
	       data	   => $body_as_string,
	       mime_type   => 'application/json',
	       timeout	   => $timeout
	   });

       Sends the request to the	associated Elasticsearch node and returns a
       $status code and	the decoded response $body, or throws an error if the
       request failed.

   Inherited methods
       From Search::Elasticsearch::Role::Cxn

       o   scheme()

       o   is_https()

       o   userinfo()

       o   default_headers()

       o   max_content_length()

       o   build_uri()

       o   host()

       o   port()

       o   uri()

       o   is_dead()

       o   is_live()

       o   next_ping()

       o   ping_failures()

       o   mark_dead()

       o   mark_live()

       o   force_ping()

       o   pings_ok()

       o   sniff()

       o   process_response()

SEE ALSO
       o   Search::Elasticsearch::Role::Cxn

       o   Search::Elasticsearch::Cxn::HTTPTiny

       o   Search::Elasticsearch::Cxn::Hijk

       o   Search::Elasticsearch::Cxn::NetCurl

AUTHOR
       Clinton Gormley <drtech@cpan.org>

COPYRIGHT AND LICENSE
       This software is	Copyright (c) 2017 by Elasticsearch BV.

       This is free software, licensed under:

	 The Apache License, Version 2.0, January 2004

perl v5.24.1			  2017-04-02Search::Elasticsearch::Cxn::LWP(3)

NAME | VERSION | DESCRIPTION | CONFIGURATION | SSL/TLS | METHODS | SEE ALSO | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Search::Elasticsearch::Cxn::LWP&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help