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\Rollups\Delete; |
19: | use OpenSearch\Endpoints\Rollups\Explain; |
20: | use OpenSearch\Endpoints\Rollups\Get; |
21: | use OpenSearch\Endpoints\Rollups\Put; |
22: | use OpenSearch\Endpoints\Rollups\Start; |
23: | use OpenSearch\Endpoints\Rollups\Stop; |
24: | |
25: | /** |
26: | * Class RollupsNamespace |
27: | * |
28: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
29: | */ |
30: | class RollupsNamespace extends AbstractNamespace |
31: | { |
32: | /** |
33: | * Delete index rollup. |
34: | * |
35: | * $params['id'] = (string) Rollup to access (Required) |
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 = true) |
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) 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 "-". |
41: | * |
42: | * @param array $params Associative array of parameters |
43: | * @return array |
44: | */ |
45: | public function delete(array $params = []) |
46: | { |
47: | $id = $this->extractArgument($params, 'id'); |
48: | |
49: | $endpoint = $this->endpointFactory->getEndpoint(Delete::class); |
50: | $endpoint->setParams($params); |
51: | $endpoint->setId($id); |
52: | |
53: | return $this->performRequest($endpoint); |
54: | } |
55: | |
56: | /** |
57: | * Get a rollup's current status. |
58: | * |
59: | * $params['id'] = (string) Rollup to access (Required) |
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 explain(array $params = []) |
70: | { |
71: | $id = $this->extractArgument($params, 'id'); |
72: | |
73: | $endpoint = $this->endpointFactory->getEndpoint(Explain::class); |
74: | $endpoint->setParams($params); |
75: | $endpoint->setId($id); |
76: | |
77: | return $this->performRequest($endpoint); |
78: | } |
79: | |
80: | /** |
81: | * Get an index rollup. |
82: | * |
83: | * $params['id'] = (string) Rollup to access (Required) |
84: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
85: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
86: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
87: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
88: | * $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 "-". |
89: | * |
90: | * @param array $params Associative array of parameters |
91: | * @return array |
92: | */ |
93: | public function get(array $params = []) |
94: | { |
95: | $id = $this->extractArgument($params, 'id'); |
96: | |
97: | $endpoint = $this->endpointFactory->getEndpoint(Get::class); |
98: | $endpoint->setParams($params); |
99: | $endpoint->setId($id); |
100: | |
101: | return $this->performRequest($endpoint); |
102: | } |
103: | |
104: | /** |
105: | * Create or update index rollup. |
106: | * |
107: | * $params['id'] = (string) Rollup to access (Required) |
108: | * $params['if_primary_term'] = (number) Only perform the operation if the document has this primary term. |
109: | * $params['if_seq_no'] = (integer) Only perform the operation if the document has this sequence number. |
110: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
111: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
112: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
113: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
114: | * $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 "-". |
115: | * |
116: | * @param array $params Associative array of parameters |
117: | * @return array |
118: | */ |
119: | public function put(array $params = []) |
120: | { |
121: | $id = $this->extractArgument($params, 'id'); |
122: | $body = $this->extractArgument($params, 'body'); |
123: | |
124: | $endpoint = $this->endpointFactory->getEndpoint(Put::class); |
125: | $endpoint->setParams($params); |
126: | $endpoint->setId($id); |
127: | $endpoint->setBody($body); |
128: | |
129: | return $this->performRequest($endpoint); |
130: | } |
131: | |
132: | /** |
133: | * Start rollup. |
134: | * |
135: | * $params['id'] = (string) Rollup to access (Required) |
136: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
137: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
138: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
139: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
140: | * $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 "-". |
141: | * |
142: | * @param array $params Associative array of parameters |
143: | * @return array |
144: | */ |
145: | public function start(array $params = []) |
146: | { |
147: | $id = $this->extractArgument($params, 'id'); |
148: | |
149: | $endpoint = $this->endpointFactory->getEndpoint(Start::class); |
150: | $endpoint->setParams($params); |
151: | $endpoint->setId($id); |
152: | |
153: | return $this->performRequest($endpoint); |
154: | } |
155: | |
156: | /** |
157: | * Stop rollup. |
158: | * |
159: | * $params['id'] = (string) Rollup to access (Required) |
160: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
161: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
162: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
163: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
164: | * $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 "-". |
165: | * |
166: | * @param array $params Associative array of parameters |
167: | * @return array |
168: | */ |
169: | public function stop(array $params = []) |
170: | { |
171: | $id = $this->extractArgument($params, 'id'); |
172: | |
173: | $endpoint = $this->endpointFactory->getEndpoint(Stop::class); |
174: | $endpoint->setParams($params); |
175: | $endpoint->setId($id); |
176: | |
177: | return $this->performRequest($endpoint); |
178: | } |
179: | |
180: | } |
181: |