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\Namespaces\AbstractNamespace; |
19: | |
20: | /** |
21: | * Class TransformsNamespace |
22: | * |
23: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
24: | */ |
25: | class TransformsNamespace extends AbstractNamespace |
26: | { |
27: | /** |
28: | * Delete an index transform. |
29: | * |
30: | * $params['id'] = (string) Transform to delete |
31: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
32: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
33: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
34: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
35: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
36: | * |
37: | * @param array $params Associative array of parameters |
38: | * @return array |
39: | */ |
40: | public function delete(array $params = []) |
41: | { |
42: | $id = $this->extractArgument($params, 'id'); |
43: | |
44: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Delete::class); |
45: | $endpoint->setParams($params); |
46: | $endpoint->setId($id); |
47: | |
48: | return $this->performRequest($endpoint); |
49: | } |
50: | |
51: | /** |
52: | * Returns the status and metadata of a transform job. |
53: | * |
54: | * $params['id'] = (string) Transform to explain |
55: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
56: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
57: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
58: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
59: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
60: | * |
61: | * @param array $params Associative array of parameters |
62: | * @return array |
63: | */ |
64: | public function explain(array $params = []) |
65: | { |
66: | $id = $this->extractArgument($params, 'id'); |
67: | |
68: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Explain::class); |
69: | $endpoint->setParams($params); |
70: | $endpoint->setId($id); |
71: | |
72: | return $this->performRequest($endpoint); |
73: | } |
74: | |
75: | /** |
76: | * Returns the status and metadata of a transform job. |
77: | * |
78: | * $params['id'] = (string) Transform to access |
79: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
80: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
81: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
82: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
83: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
84: | * |
85: | * @param array $params Associative array of parameters |
86: | * @return array |
87: | */ |
88: | public function get(array $params = []) |
89: | { |
90: | $id = $this->extractArgument($params, 'id'); |
91: | |
92: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Get::class); |
93: | $endpoint->setParams($params); |
94: | $endpoint->setId($id); |
95: | |
96: | return $this->performRequest($endpoint); |
97: | } |
98: | |
99: | /** |
100: | * Returns a preview of what a transformed index would look like. |
101: | * |
102: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
103: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
104: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
105: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
106: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
107: | * |
108: | * @param array $params Associative array of parameters |
109: | * @return array |
110: | */ |
111: | public function preview(array $params = []) |
112: | { |
113: | $body = $this->extractArgument($params, 'body'); |
114: | |
115: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Preview::class); |
116: | $endpoint->setParams($params); |
117: | $endpoint->setBody($body); |
118: | |
119: | return $this->performRequest($endpoint); |
120: | } |
121: | |
122: | /** |
123: | * Create an index transform, or update a transform if if_seq_no and if_primary_term are provided. |
124: | * |
125: | * $params['id'] = (string) Transform to create/update |
126: | * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term. |
127: | * $params['if_seq_no'] = (integer) Only perform the operation if the document has this sequence number. |
128: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
129: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
130: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
131: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
132: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
133: | * |
134: | * @param array $params Associative array of parameters |
135: | * @return array |
136: | */ |
137: | public function put(array $params = []) |
138: | { |
139: | $id = $this->extractArgument($params, 'id'); |
140: | $body = $this->extractArgument($params, 'body'); |
141: | |
142: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Put::class); |
143: | $endpoint->setParams($params); |
144: | $endpoint->setId($id); |
145: | $endpoint->setBody($body); |
146: | |
147: | return $this->performRequest($endpoint); |
148: | } |
149: | |
150: | /** |
151: | * Returns the details of all transform jobs. |
152: | * |
153: | * $params['from'] = (number) The starting transform to return. Default is `0`. |
154: | * $params['search'] = (string) The search term to use to filter results. |
155: | * $params['size'] = (number) Specifies the number of transforms to return. Default is `10`. |
156: | * $params['sortDirection'] = (string) Specifies the direction to sort results in. Can be `ASC` or `DESC`. Default is `ASC`. |
157: | * $params['sortField'] = (string) The field to sort results with. |
158: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
159: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
160: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
161: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
162: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
163: | * |
164: | * @param array $params Associative array of parameters |
165: | * @return array |
166: | */ |
167: | public function search(array $params = []) |
168: | { |
169: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Search::class); |
170: | $endpoint->setParams($params); |
171: | |
172: | return $this->performRequest($endpoint); |
173: | } |
174: | |
175: | /** |
176: | * Start transform. |
177: | * |
178: | * $params['id'] = (string) Transform to start |
179: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
180: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
181: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
182: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
183: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
184: | * |
185: | * @param array $params Associative array of parameters |
186: | * @return array |
187: | */ |
188: | public function start(array $params = []) |
189: | { |
190: | $id = $this->extractArgument($params, 'id'); |
191: | |
192: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Start::class); |
193: | $endpoint->setParams($params); |
194: | $endpoint->setId($id); |
195: | |
196: | return $this->performRequest($endpoint); |
197: | } |
198: | |
199: | /** |
200: | * Stop transform. |
201: | * |
202: | * $params['id'] = (string) Transform to stop |
203: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
204: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
205: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
206: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
207: | * $params['filter_path'] = (any) Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with "-". |
208: | * |
209: | * @param array $params Associative array of parameters |
210: | * @return array |
211: | */ |
212: | public function stop(array $params = []) |
213: | { |
214: | $id = $this->extractArgument($params, 'id'); |
215: | |
216: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Transforms\Stop::class); |
217: | $endpoint->setParams($params); |
218: | $endpoint->setId($id); |
219: | |
220: | return $this->performRequest($endpoint); |
221: | } |
222: | |
223: | } |
224: |