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\Replication\AutofollowStats;
19: use OpenSearch\Endpoints\Replication\CreateReplicationRule;
20: use OpenSearch\Endpoints\Replication\DeleteReplicationRule;
21: use OpenSearch\Endpoints\Replication\FollowerStats;
22: use OpenSearch\Endpoints\Replication\LeaderStats;
23: use OpenSearch\Endpoints\Replication\Pause;
24: use OpenSearch\Endpoints\Replication\Resume;
25: use OpenSearch\Endpoints\Replication\Start;
26: use OpenSearch\Endpoints\Replication\Status;
27: use OpenSearch\Endpoints\Replication\Stop;
28: use OpenSearch\Endpoints\Replication\UpdateSettings;
29:
30: /**
31: * Class ReplicationNamespace
32: *
33: * NOTE: This file is autogenerated using util/GenerateEndpoints.php
34: */
35: class ReplicationNamespace extends AbstractNamespace
36: {
37: /**
38: * Retrieves information about any auto-follow activity and any replication rules configured on the specified cluster.
39: *
40: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
41: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
42: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
43: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
44: * $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 "-".
45: *
46: * @param array $params Associative array of parameters
47: * @return array
48: */
49: public function autofollowStats(array $params = [])
50: {
51: $endpoint = $this->endpointFactory->getEndpoint(AutofollowStats::class);
52: $endpoint->setParams($params);
53:
54: return $this->performRequest($endpoint);
55: }
56:
57: /**
58: * Automatically starts the replication on indexes matching a specified pattern.
59: *
60: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
61: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
62: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
63: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
64: * $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 "-".
65: *
66: * @param array $params Associative array of parameters
67: * @return array
68: */
69: public function createReplicationRule(array $params = [])
70: {
71: $body = $this->extractArgument($params, 'body');
72:
73: $endpoint = $this->endpointFactory->getEndpoint(CreateReplicationRule::class);
74: $endpoint->setParams($params);
75: $endpoint->setBody($body);
76:
77: return $this->performRequest($endpoint);
78: }
79:
80: /**
81: * Deletes the specified replication rule.
82: *
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 deleteReplicationRule(array $params = [])
93: {
94: $body = $this->extractArgument($params, 'body');
95:
96: $endpoint = $this->endpointFactory->getEndpoint(DeleteReplicationRule::class);
97: $endpoint->setParams($params);
98: $endpoint->setBody($body);
99:
100: return $this->performRequest($endpoint);
101: }
102:
103: /**
104: * Retrieves information about any follower (syncing) indexes on a specified cluster.
105: *
106: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
107: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
108: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
109: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
110: * $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 "-".
111: *
112: * @param array $params Associative array of parameters
113: * @return array
114: */
115: public function followerStats(array $params = [])
116: {
117: $endpoint = $this->endpointFactory->getEndpoint(FollowerStats::class);
118: $endpoint->setParams($params);
119:
120: return $this->performRequest($endpoint);
121: }
122:
123: /**
124: * Retrieves information about any replicated leader indexes on a specified cluster.
125: *
126: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
127: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
128: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
129: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
130: * $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 "-".
131: *
132: * @param array $params Associative array of parameters
133: * @return array
134: */
135: public function leaderStats(array $params = [])
136: {
137: $endpoint = $this->endpointFactory->getEndpoint(LeaderStats::class);
138: $endpoint->setParams($params);
139:
140: return $this->performRequest($endpoint);
141: }
142:
143: /**
144: * Pauses the replication of the leader index.
145: *
146: * $params['index'] = (string) The name of the data stream, index, or index alias to perform bulk actions on.
147: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
148: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
149: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
150: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
151: * $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 "-".
152: *
153: * @param array $params Associative array of parameters
154: * @return array
155: */
156: public function pause(array $params = [])
157: {
158: $index = $this->extractArgument($params, 'index');
159: $body = $this->extractArgument($params, 'body');
160:
161: $endpoint = $this->endpointFactory->getEndpoint(Pause::class);
162: $endpoint->setParams($params);
163: $endpoint->setIndex($index);
164: $endpoint->setBody($body);
165:
166: return $this->performRequest($endpoint);
167: }
168:
169: /**
170: * Resumes replication of the leader index.
171: *
172: * $params['index'] = (string) The name of the data stream, index, or index alias to perform bulk actions on.
173: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
174: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
175: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
176: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
177: * $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 "-".
178: *
179: * @param array $params Associative array of parameters
180: * @return array
181: */
182: public function resume(array $params = [])
183: {
184: $index = $this->extractArgument($params, 'index');
185: $body = $this->extractArgument($params, 'body');
186:
187: $endpoint = $this->endpointFactory->getEndpoint(Resume::class);
188: $endpoint->setParams($params);
189: $endpoint->setIndex($index);
190: $endpoint->setBody($body);
191:
192: return $this->performRequest($endpoint);
193: }
194:
195: /**
196: * Initiates the replication of an index from the leader cluster to the follower cluster.
197: *
198: * $params['index'] = (string) The name of the data stream, index, or index alias to perform bulk actions on.
199: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
200: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
201: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
202: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
203: * $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 "-".
204: *
205: * @param array $params Associative array of parameters
206: * @return array
207: */
208: public function start(array $params = [])
209: {
210: $index = $this->extractArgument($params, 'index');
211: $body = $this->extractArgument($params, 'body');
212:
213: $endpoint = $this->endpointFactory->getEndpoint(Start::class);
214: $endpoint->setParams($params);
215: $endpoint->setIndex($index);
216: $endpoint->setBody($body);
217:
218: return $this->performRequest($endpoint);
219: }
220:
221: /**
222: * Retrieves the the status of an index replication.
223: *
224: * $params['index'] = (string) The name of the data stream, index, or index alias to perform bulk actions on.
225: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
226: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
227: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
228: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
229: * $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 "-".
230: *
231: * @param array $params Associative array of parameters
232: * @return array
233: */
234: public function status(array $params = [])
235: {
236: $index = $this->extractArgument($params, 'index');
237:
238: $endpoint = $this->endpointFactory->getEndpoint(Status::class);
239: $endpoint->setParams($params);
240: $endpoint->setIndex($index);
241:
242: return $this->performRequest($endpoint);
243: }
244:
245: /**
246: * Terminates the replication and converts the follower index to a standard index.
247: *
248: * $params['index'] = (string) The name of the data stream, index, or index alias to perform bulk actions on.
249: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
250: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
251: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
252: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
253: * $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 "-".
254: *
255: * @param array $params Associative array of parameters
256: * @return array
257: */
258: public function stop(array $params = [])
259: {
260: $index = $this->extractArgument($params, 'index');
261: $body = $this->extractArgument($params, 'body');
262:
263: $endpoint = $this->endpointFactory->getEndpoint(Stop::class);
264: $endpoint->setParams($params);
265: $endpoint->setIndex($index);
266: $endpoint->setBody($body);
267:
268: return $this->performRequest($endpoint);
269: }
270:
271: /**
272: * Updates any settings on the follower index.
273: *
274: * $params['index'] = (string) The name of the data stream, index, or index alias to perform bulk actions on.
275: * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false)
276: * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true)
277: * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false)
278: * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
279: * $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 "-".
280: *
281: * @param array $params Associative array of parameters
282: * @return array
283: */
284: public function updateSettings(array $params = [])
285: {
286: $index = $this->extractArgument($params, 'index');
287: $body = $this->extractArgument($params, 'body');
288:
289: $endpoint = $this->endpointFactory->getEndpoint(UpdateSettings::class);
290: $endpoint->setParams($params);
291: $endpoint->setIndex($index);
292: $endpoint->setBody($body);
293:
294: return $this->performRequest($endpoint);
295: }
296:
297: }
298: