1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * SPDX-License-Identifier: Apache-2.0
7: *
8: * The OpenSearch Contributors require contributions made to
9: * this file be licensed under the Apache-2.0 license or a
10: * compatible open source license.
11: *
12: * Modifications Copyright OpenSearch Contributors. See
13: * GitHub history for details.
14: */
15:
16: namespace OpenSearch\Namespaces;
17:
18: use OpenSearch\Endpoints\Ingestion\GetState;
19: use OpenSearch\Endpoints\Ingestion\Pause;
20: use OpenSearch\Endpoints\Ingestion\Resume;
21:
22: /**
23: * Class IngestionNamespace
24: *
25: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
26: */
27: class IngestionNamespace extends AbstractNamespace
28: {
29: /**
30: * Use this API to retrieve the ingestion state for a given index.
31: *
32: * $params['index'] = (string) Index for which ingestion state should be retrieved.
33: * $params['next_token'] = (string) Token to retrieve the next page of results.
34: * $params['size'] = (integer) Number of results to return per page.
35: * $params['timeout'] = (string) Timeout for the request.
36: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
37: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
38: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
39: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
40: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
41: *
42: * @param array $params Associative array of parameters
43: * @return array
44: */
45: public function getState(array $params = [])
46: {
47: $index = $this->extractArgument($params, 'index');
48:
49: $endpoint = $this->endpointFactory->getEndpoint(GetState::class);
50: $endpoint->setParams($params);
51: $endpoint->setIndex($index);
52:
53: return $this->performRequest($endpoint);
54: }
55:
56: /**
57: * Use this API to pause ingestion for a given index.
58: *
59: * $params['index'] = (string) Index for which ingestion should be paused.
60: * $params['cluster_manager_timeout'] = (string) Time to wait for cluster manager connection.
61: * $params['timeout'] = (string) Timeout for the request.
62: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
63: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
64: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
65: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
66: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
67: *
68: * @param array $params Associative array of parameters
69: * @return array
70: */
71: public function pause(array $params = [])
72: {
73: $index = $this->extractArgument($params, 'index');
74:
75: $endpoint = $this->endpointFactory->getEndpoint(Pause::class);
76: $endpoint->setParams($params);
77: $endpoint->setIndex($index);
78:
79: return $this->performRequest($endpoint);
80: }
81:
82: /**
83: * Use this API to resume ingestion for the given index.
84: *
85: * $params['index'] = (string) Index for which ingestion should be resumed.
86: * $params['cluster_manager_timeout'] = (string) Time to wait for cluster manager connection.
87: * $params['timeout'] = (string) Timeout for the request.
88: * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false)
89: * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false)
90: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
91: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
92: * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
93: *
94: * @param array $params Associative array of parameters
95: * @return array
96: */
97: public function resume(array $params = [])
98: {
99: $index = $this->extractArgument($params, 'index');
100: $body = $this->extractArgument($params, 'body');
101:
102: $endpoint = $this->endpointFactory->getEndpoint(Resume::class);
103: $endpoint->setParams($params);
104: $endpoint->setIndex($index);
105: $endpoint->setBody($body);
106:
107: return $this->performRequest($endpoint);
108: }
109:
110: }
111: