1Search::Elasticsearch::URsoelre:C:oCnltireiSnbetua:tr:ecDdhi:rP:eeEcrltla(s3Dt)oiccusmeeanrtcaht:i:oRnole::Client::Direct(3)
2
3
4

NAME

6       Search::Elasticsearch::Role::Client::Direct - Request parsing for
7       Direct clients
8

VERSION

10       version 8.00
11

DESCRIPTION

13       This role provides the single parse_request() method for classes which
14       need to parse an API definition from Search::Elasticsearch::Role::API
15       and convert it into a request which can be passed to
16       "perform_request()" in Search::Elasticsearch::Transport.
17

METHODS

19   perform_request()
20           $request = $client->parse_request(\%defn,\%params);
21
22       The %defn is a definition returned by "api()" in
23       Search::Elasticsearch::Role::API with an extra key "name" which should
24       be the name of the method that was called on the client.  For instance
25       if the user calls "$client->search", then the "name" should be
26       "search".
27
28       parse_request() will turn the parameters that have been passed in into
29       a "path" (via "path_init()" in Search::Elasticsearch::Util::API::Path),
30       a query-string hash (via "qs_init" in
31       Search::Elasticsearch::Util::API::QS) and will through a "body" value
32       directly.
33
34       NOTE: If a "path" key is specified in the %params then it will be used
35       directly, instead of trying to build path from the path template.
36       Similarly, if a "params" key is specified in the %params, then it will
37       be used as a basis for the query string hash.  For instance:
38
39           $client->perform_request(
40               {
41                   method => 'GET',
42                   name   => 'new_method'
43               },
44               {
45                   path   => '/new/method',
46                   params => { foo => 'bar' },
47                   body   => \%body
48               }
49           );
50
51       This makes it easy to add support for custom plugins or new
52       functionality not yet supported by the released client.
53

AUTHOR

55       Enrico Zimuel <enrico.zimuel@elastic.co>
56
58       This software is Copyright (c) 2022 by Elasticsearch BV.
59
60       This is free software, licensed under:
61
62         The Apache License, Version 2.0, January 2004
63
64
65
66perl v5.36.0                    Se2a0r2c3h-:0:1E-l2a0sticsearch::Role::Client::Direct(3)
Impressum