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 IsmNamespace
22: *
23: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
24: */
25: class IsmNamespace extends AbstractNamespace
26: {
27: /**
28: * Adds a policy to an index.
29: *
30: * $params['index'] = (string) Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`).
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 addPolicy(array $params = [])
41: {
42: $index = $this->extractArgument($params, 'index');
43: $body = $this->extractArgument($params, 'body');
44:
45: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\AddPolicy::class);
46: $endpoint->setParams($params);
47: $endpoint->setIndex($index);
48: $endpoint->setBody($body);
49:
50: return $this->performRequest($endpoint);
51: }
52:
53: /**
54: * Updates the managed index policy to a new policy.
55: *
56: * $params['index'] = (string) Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`).
57: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
58: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
59: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
60: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
61: * $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 "-".
62: *
63: * @param array $params Associative array of parameters
64: * @return array
65: */
66: public function changePolicy(array $params = [])
67: {
68: $index = $this->extractArgument($params, 'index');
69: $body = $this->extractArgument($params, 'body');
70:
71: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\ChangePolicy::class);
72: $endpoint->setParams($params);
73: $endpoint->setIndex($index);
74: $endpoint->setBody($body);
75:
76: return $this->performRequest($endpoint);
77: }
78:
79: /**
80: * Deletes a policy.
81: *
82: * $params['policy_id'] = (string) (Required)
83: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
84: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
85: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
86: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
87: * $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 "-".
88: *
89: * @param array $params Associative array of parameters
90: * @return array
91: */
92: public function deletePolicy(array $params = [])
93: {
94: $policy_id = $this->extractArgument($params, 'policy_id');
95:
96: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\DeletePolicy::class);
97: $endpoint->setParams($params);
98: $endpoint->setPolicyId($policy_id);
99:
100: return $this->performRequest($endpoint);
101: }
102:
103: /**
104: * Checks whether the policy exists.
105: *
106: * $params['policy_id'] = (string) (Required)
107: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
108: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
109: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
110: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
111: * $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 "-".
112: *
113: * @param array $params Associative array of parameters
114: * @return bool
115: */
116: public function existsPolicy(array $params = []): bool
117: {
118: $policy_id = $this->extractArgument($params, 'policy_id');
119:
120: // manually make this verbose so we can check status code
121: $params['client']['verbose'] = true;
122:
123: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\ExistsPolicy::class);
124: $endpoint->setParams($params);
125: $endpoint->setPolicyId($policy_id);
126:
127: return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
128: }
129:
130: /**
131: * Gets the currently applied policy on indices.
132: *
133: * $params['index'] = (string) Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`).
134: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
135: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
136: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
137: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
138: * $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 "-".
139: *
140: * @param array $params Associative array of parameters
141: * @return array
142: */
143: public function explainPolicy(array $params = [])
144: {
145: $index = $this->extractArgument($params, 'index');
146: $body = $this->extractArgument($params, 'body');
147:
148: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\ExplainPolicy::class);
149: $endpoint->setParams($params);
150: $endpoint->setIndex($index);
151: $endpoint->setBody($body);
152:
153: return $this->performRequest($endpoint);
154: }
155:
156: /**
157: * Gets the policies.
158: *
159: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
160: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
161: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
162: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
163: * $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 "-".
164: *
165: * @param array $params Associative array of parameters
166: * @return array
167: */
168: public function getPolicies(array $params = [])
169: {
170: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\GetPolicies::class);
171: $endpoint->setParams($params);
172:
173: return $this->performRequest($endpoint);
174: }
175:
176: /**
177: * Gets a policy.
178: *
179: * $params['policy_id'] = (string) (Required)
180: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
181: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
182: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
183: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
184: * $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 "-".
185: *
186: * @param array $params Associative array of parameters
187: * @return array
188: */
189: public function getPolicy(array $params = [])
190: {
191: $policy_id = $this->extractArgument($params, 'policy_id');
192:
193: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\GetPolicy::class);
194: $endpoint->setParams($params);
195: $endpoint->setPolicyId($policy_id);
196:
197: return $this->performRequest($endpoint);
198: }
199:
200: /**
201: * Gets the policies.
202: *
203: * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term.
204: * $params['if_seq_no'] = (integer) Only perform the operation if the document has this sequence number.
205: * $params['policyID'] = (string)
206: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
207: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
208: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
209: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
210: * $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 "-".
211: *
212: * @param array $params Associative array of parameters
213: * @return array
214: */
215: public function putPolicies(array $params = [])
216: {
217: $body = $this->extractArgument($params, 'body');
218:
219: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\PutPolicies::class);
220: $endpoint->setParams($params);
221: $endpoint->setBody($body);
222:
223: return $this->performRequest($endpoint);
224: }
225:
226: /**
227: * Creates or updates a policy.
228: *
229: * $params['policy_id'] = (string) (Required)
230: * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term.
231: * $params['if_seq_no'] = (integer) Only perform the operation if the document has this sequence number.
232: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
233: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
234: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
235: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
236: * $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 "-".
237: *
238: * @param array $params Associative array of parameters
239: * @return array
240: */
241: public function putPolicy(array $params = [])
242: {
243: $policy_id = $this->extractArgument($params, 'policy_id');
244: $body = $this->extractArgument($params, 'body');
245:
246: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\PutPolicy::class);
247: $endpoint->setParams($params);
248: $endpoint->setPolicyId($policy_id);
249: $endpoint->setBody($body);
250:
251: return $this->performRequest($endpoint);
252: }
253:
254: /**
255: * Refresh search analyzers in real time.
256: *
257: * $params['index'] = (string) Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`). (Required)
258: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
259: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
260: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
261: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
262: * $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 "-".
263: *
264: * @param array $params Associative array of parameters
265: * @return array
266: */
267: public function refreshSearchAnalyzers(array $params = [])
268: {
269: $index = $this->extractArgument($params, 'index');
270:
271: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\RefreshSearchAnalyzers::class);
272: $endpoint->setParams($params);
273: $endpoint->setIndex($index);
274:
275: return $this->performRequest($endpoint);
276: }
277:
278: /**
279: * Removes a policy from an index.
280: *
281: * $params['index'] = (string) Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`).
282: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
283: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
284: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
285: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
286: * $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 "-".
287: *
288: * @param array $params Associative array of parameters
289: * @return array
290: */
291: public function removePolicy(array $params = [])
292: {
293: $index = $this->extractArgument($params, 'index');
294:
295: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\RemovePolicy::class);
296: $endpoint->setParams($params);
297: $endpoint->setIndex($index);
298:
299: return $this->performRequest($endpoint);
300: }
301:
302: /**
303: * Retry the failed action for an index.
304: *
305: * $params['index'] = (string) Comma-separated list of data streams, indexes, and aliases. Supports wildcards (`*`).
306: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
307: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
308: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
309: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
310: * $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 "-".
311: *
312: * @param array $params Associative array of parameters
313: * @return array
314: */
315: public function retryIndex(array $params = [])
316: {
317: $index = $this->extractArgument($params, 'index');
318: $body = $this->extractArgument($params, 'body');
319:
320: $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Ism\RetryIndex::class);
321: $endpoint->setParams($params);
322: $endpoint->setIndex($index);
323: $endpoint->setBody($body);
324:
325: return $this->performRequest($endpoint);
326: }
327:
328: }
329: