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 WlmNamespace |
22: | * |
23: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
24: | */ |
25: | class WlmNamespace extends AbstractNamespace |
26: | { |
27: | /** |
28: | * Creates a new query group and sets the resource limits for the new query group. |
29: | * |
30: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
31: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
32: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
33: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
34: | * $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 "-". |
35: | * |
36: | * @param array $params Associative array of parameters |
37: | * @return array |
38: | */ |
39: | public function createQueryGroup(array $params = []) |
40: | { |
41: | $body = $this->extractArgument($params, 'body'); |
42: | |
43: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Wlm\CreateQueryGroup::class); |
44: | $endpoint->setParams($params); |
45: | $endpoint->setBody($body); |
46: | |
47: | return $this->performRequest($endpoint); |
48: | } |
49: | |
50: | /** |
51: | * Deletes the specified query group. |
52: | * |
53: | * $params['name'] = (string) The name of the query group. |
54: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
55: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
56: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
57: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
58: | * $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 "-". |
59: | * |
60: | * @param array $params Associative array of parameters |
61: | * @return array |
62: | */ |
63: | public function deleteQueryGroup(array $params = []) |
64: | { |
65: | $name = $this->extractArgument($params, 'name'); |
66: | |
67: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Wlm\DeleteQueryGroup::class); |
68: | $endpoint->setParams($params); |
69: | $endpoint->setName($name); |
70: | |
71: | return $this->performRequest($endpoint); |
72: | } |
73: | |
74: | /** |
75: | * Retrieves the specified query group. If no query group is specified, all query groups in the cluster are retrieved. |
76: | * |
77: | * $params['name'] = (string) The name of the query group. |
78: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
79: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
80: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
81: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
82: | * $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 "-". |
83: | * |
84: | * @param array $params Associative array of parameters |
85: | * @return array |
86: | */ |
87: | public function getQueryGroup(array $params = []) |
88: | { |
89: | $name = $this->extractArgument($params, 'name'); |
90: | |
91: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Wlm\GetQueryGroup::class); |
92: | $endpoint->setParams($params); |
93: | $endpoint->setName($name); |
94: | |
95: | return $this->performRequest($endpoint); |
96: | } |
97: | |
98: | /** |
99: | * Updates the specified query group. |
100: | * |
101: | * $params['name'] = (string) The name of the query group. |
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 updateQueryGroup(array $params = []) |
112: | { |
113: | $name = $this->extractArgument($params, 'name'); |
114: | $body = $this->extractArgument($params, 'body'); |
115: | |
116: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Wlm\UpdateQueryGroup::class); |
117: | $endpoint->setParams($params); |
118: | $endpoint->setName($name); |
119: | $endpoint->setBody($body); |
120: | |
121: | return $this->performRequest($endpoint); |
122: | } |
123: | |
124: | } |
125: |