1<?php
2/**
3 * Elasticsearch PHP client
4 *
5 * @link      https://github.com/elastic/elasticsearch-php/
6 * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
7 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
8 * @license   https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
9 *
10 * Licensed to Elasticsearch B.V under one or more agreements.
11 * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
12 * the GNU Lesser General Public License, Version 2.1, at your option.
13 * See the LICENSE file in the project root for more information.
14 */
15declare(strict_types = 1);
16
17namespace Elasticsearch\Namespaces;
18
19use Elasticsearch\Namespaces\AbstractNamespace;
20
21/**
22 * Class IngestNamespace
23 *
24 * NOTE: this file is autogenerated using util/GenerateEndpoints.php
25 * and Elasticsearch 7.16.0-SNAPSHOT (dfc9a8e7563ed5f24b5210ed21ed92ae182cd0ee)
26 */
27class IngestNamespace extends AbstractNamespace
28{
29
30    /**
31     * Deletes a pipeline.
32     *
33     * $params['id']             = (string) Pipeline ID
34     * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node
35     * $params['timeout']        = (time) Explicit operation timeout
36     *
37     * @param array $params Associative array of parameters
38     * @return array
39     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-pipeline-api.html
40     */
41    public function deletePipeline(array $params = [])
42    {
43        $id = $this->extractArgument($params, 'id');
44
45        $endpointBuilder = $this->endpoints;
46        $endpoint = $endpointBuilder('Ingest\DeletePipeline');
47        $endpoint->setParams($params);
48        $endpoint->setId($id);
49
50        return $this->performRequest($endpoint);
51    }
52    /**
53     * Returns statistical information about geoip databases
54     *
55     *
56     * @param array $params Associative array of parameters
57     * @return array
58     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/geoip-stats-api.html
59     */
60    public function geoIpStats(array $params = [])
61    {
62
63        $endpointBuilder = $this->endpoints;
64        $endpoint = $endpointBuilder('Ingest\GeoIpStats');
65        $endpoint->setParams($params);
66
67        return $this->performRequest($endpoint);
68    }
69    /**
70     * Returns a pipeline.
71     *
72     * $params['id']             = (string) Comma separated list of pipeline ids. Wildcards supported
73     * $params['summary']        = (boolean) Return pipelines without their definitions (default: false)
74     * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node
75     *
76     * @param array $params Associative array of parameters
77     * @return array
78     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/get-pipeline-api.html
79     */
80    public function getPipeline(array $params = [])
81    {
82        $id = $this->extractArgument($params, 'id');
83
84        $endpointBuilder = $this->endpoints;
85        $endpoint = $endpointBuilder('Ingest\GetPipeline');
86        $endpoint->setParams($params);
87        $endpoint->setId($id);
88
89        return $this->performRequest($endpoint);
90    }
91    /**
92     * Returns a list of the built-in patterns.
93     *
94     *
95     * @param array $params Associative array of parameters
96     * @return array
97     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/grok-processor.html#grok-processor-rest-get
98     */
99    public function processorGrok(array $params = [])
100    {
101
102        $endpointBuilder = $this->endpoints;
103        $endpoint = $endpointBuilder('Ingest\ProcessorGrok');
104        $endpoint->setParams($params);
105
106        return $this->performRequest($endpoint);
107    }
108    /**
109     * Creates or updates a pipeline.
110     *
111     * $params['id']             = (string) Pipeline ID
112     * $params['master_timeout'] = (time) Explicit operation timeout for connection to master node
113     * $params['timeout']        = (time) Explicit operation timeout
114     * $params['body']           = (array) The ingest definition (Required)
115     *
116     * @param array $params Associative array of parameters
117     * @return array
118     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/put-pipeline-api.html
119     */
120    public function putPipeline(array $params = [])
121    {
122        $id = $this->extractArgument($params, 'id');
123        $body = $this->extractArgument($params, 'body');
124
125        $endpointBuilder = $this->endpoints;
126        $endpoint = $endpointBuilder('Ingest\PutPipeline');
127        $endpoint->setParams($params);
128        $endpoint->setId($id);
129        $endpoint->setBody($body);
130
131        return $this->performRequest($endpoint);
132    }
133    /**
134     * Allows to simulate a pipeline with example documents.
135     *
136     * $params['id']      = (string) Pipeline ID
137     * $params['verbose'] = (boolean) Verbose mode. Display data output for each processor in executed pipeline (Default = false)
138     * $params['body']    = (array) The simulate definition (Required)
139     *
140     * @param array $params Associative array of parameters
141     * @return array
142     * @see https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html
143     */
144    public function simulate(array $params = [])
145    {
146        $id = $this->extractArgument($params, 'id');
147        $body = $this->extractArgument($params, 'body');
148
149        $endpointBuilder = $this->endpoints;
150        $endpoint = $endpointBuilder('Ingest\Simulate');
151        $endpoint->setParams($params);
152        $endpoint->setId($id);
153        $endpoint->setBody($body);
154
155        return $this->performRequest($endpoint);
156    }
157}
158