.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Search::Elasticsearch::Cxn::LWP 3pm" .TH Search::Elasticsearch::Cxn::LWP 3pm "2016-12-17" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Search::Elasticsearch::Cxn::LWP \- A Cxn implementation which uses LWP .SH "VERSION" .IX Header "VERSION" version 5.01 .SH "DESCRIPTION" .IX Header "DESCRIPTION" Provides an \s-1HTTP\s0 Cxn class and based on \s-1LWP\s0. The \s-1LWP\s0 backend uses pure Perl and persistent connections. .PP This class does Search::Elasticsearch::Role::Cxn, whose documentation provides more information, and Search::Elasticsearch::Role::Is_Sync. .SH "CONFIGURATION" .IX Header "CONFIGURATION" .SS "Inherited configuration" .IX Subsection "Inherited configuration" From Search::Elasticsearch::Role::Cxn .IP "\(bu" 4 node .IP "\(bu" 4 max_content_length .IP "\(bu" 4 deflate .IP "\(bu" 4 deflate .IP "\(bu" 4 request_timeout .IP "\(bu" 4 ping_timeout .IP "\(bu" 4 dead_timeout .IP "\(bu" 4 max_dead_timeout .IP "\(bu" 4 sniff_request_timeout .IP "\(bu" 4 sniff_timeout .IP "\(bu" 4 handle_args .IP "\(bu" 4 handle_args .SH "SSL/TLS" .IX Header "SSL/TLS" Search::Elasticsearch::Cxn::LWP uses IO::Socket::SSL to support \&\s-1HTTPS. \s0 By default, no validation of the remote host is performed. .PP This behaviour can be changed by passing the \f(CW\*(C`ssl_options\*(C'\fR 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: .PP .Vb 1 \& use Search::Elasticsearch; \& \& my $es = Search::Elasticsearch\->new( \& cxn => \*(AqLWP\*(Aq, \& nodes => [ \& "https://node1.mydomain.com:9200", \& "https://node2.mydomain.com:9200", \& ], \& ssl_options => { \& verify_hostname => 1, \& SSL_ca_file => \*(Aq/path/to/cacert.pem\*(Aq \& } \& ); .Ve .PP If the remote server cannot be verified, an Search::Elasticsearch::Error will be thrown \- \s-1LWP\s0 does not allow us to detect that the connection error was due to invalid \s-1SSL.\s0 .PP If you want your client to present its own certificate to the remote server, then use: .PP .Vb 1 \& use Search::Elasticsearch; \& \& my $es = Search::Elasticsearch\->new( \& cxn => \*(AqLWP\*(Aq, \& nodes => [ \& "https://node1.mydomain.com:9200", \& "https://node2.mydomain.com:9200", \& ], \& ssl_options => { \& verify_hostname => 1, \& SSL_ca_file => \*(Aq/path/to/cacert.pem\*(Aq, \& SSL_use_cert => 1, \& SSL_cert_file => \*(Aq/path/to/client.pem\*(Aq, \& SSL_key_file => \*(Aq/path/to/client.pem\*(Aq, \& } \& ); .Ve .SH "METHODS" .IX Header "METHODS" .ie n .SS """perform_request()""" .el .SS "\f(CWperform_request()\fP" .IX Subsection "perform_request()" .Vb 5 \& ($status,$body) = $self\->perform_request({ \& # required \& method => \*(AqGET|HEAD|POST|PUT|DELETE\*(Aq, \& path => \*(Aq/path/of/request\*(Aq, \& qs => \e%query_string_params, \& \& # optional \& data => $body_as_string, \& mime_type => \*(Aqapplication/json\*(Aq, \& timeout => $timeout \& }); .Ve .PP Sends the request to the associated Elasticsearch node and returns a \f(CW$status\fR code and the decoded response \f(CW$body\fR, or throws an error if the request failed. .SS "Inherited methods" .IX Subsection "Inherited methods" From Search::Elasticsearch::Role::Cxn .IP "\(bu" 4 \&\fIscheme()\fR .IP "\(bu" 4 \&\fIis_https()\fR .IP "\(bu" 4 \&\fIuserinfo()\fR .IP "\(bu" 4 \&\fIdefault_headers()\fR .IP "\(bu" 4 \&\fImax_content_length()\fR .IP "\(bu" 4 \&\fIbuild_uri()\fR .IP "\(bu" 4 \&\fIhost()\fR .IP "\(bu" 4 \&\fIport()\fR .IP "\(bu" 4 \&\fIuri()\fR .IP "\(bu" 4 \&\fIis_dead()\fR .IP "\(bu" 4 \&\fIis_live()\fR .IP "\(bu" 4 \&\fInext_ping()\fR .IP "\(bu" 4 \&\fIping_failures()\fR .IP "\(bu" 4 \&\fImark_dead()\fR .IP "\(bu" 4 \&\fImark_live()\fR .IP "\(bu" 4 \&\fIforce_ping()\fR .IP "\(bu" 4 \&\fIpings_ok()\fR .IP "\(bu" 4 \&\fIsniff()\fR .IP "\(bu" 4 \&\fIprocess_response()\fR .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 Search::Elasticsearch::Role::Cxn .IP "\(bu" 4 Search::Elasticsearch::Cxn::HTTPTiny .IP "\(bu" 4 Search::Elasticsearch::Cxn::Hijk .IP "\(bu" 4 Search::Elasticsearch::Cxn::NetCurl .SH "AUTHOR" .IX Header "AUTHOR" Clinton Gormley .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2016 by Elasticsearch \s-1BV.\s0 .PP This is free software, licensed under: .PP .Vb 1 \& The Apache License, Version 2.0, January 2004 .Ve