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 QueryNamespace |
22: | * |
23: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
24: | */ |
25: | class QueryNamespace extends AbstractNamespace |
26: | { |
27: | /** |
28: | * Deletes specific datasource specified by name. |
29: | * |
30: | * $params['datasource_name'] = (string) The Name of the DataSource 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 datasourceDelete(array $params = []) |
41: | { |
42: | $datasource_name = $this->extractArgument($params, 'datasource_name'); |
43: | |
44: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Query\DatasourceDelete::class); |
45: | $endpoint->setParams($params); |
46: | $endpoint->setDatasourceName($datasource_name); |
47: | |
48: | return $this->performRequest($endpoint); |
49: | } |
50: | |
51: | /** |
52: | * Retrieves specific datasource specified by name. |
53: | * |
54: | * $params['datasource_name'] = (string) The Name of the DataSource to retrieve. |
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 datasourceRetrieve(array $params = []) |
65: | { |
66: | $datasource_name = $this->extractArgument($params, 'datasource_name'); |
67: | |
68: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Query\DatasourceRetrieve::class); |
69: | $endpoint->setParams($params); |
70: | $endpoint->setDatasourceName($datasource_name); |
71: | |
72: | return $this->performRequest($endpoint); |
73: | } |
74: | |
75: | /** |
76: | * Creates a new query datasource. |
77: | * |
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 datasourcesCreate(array $params = []) |
88: | { |
89: | $body = $this->extractArgument($params, 'body'); |
90: | |
91: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Query\DatasourcesCreate::class); |
92: | $endpoint->setParams($params); |
93: | $endpoint->setBody($body); |
94: | |
95: | return $this->performRequest($endpoint); |
96: | } |
97: | |
98: | /** |
99: | * Retrieves list of all datasources. |
100: | * |
101: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
102: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
103: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
104: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
105: | * $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 "-". |
106: | * |
107: | * @param array $params Associative array of parameters |
108: | * @return array |
109: | */ |
110: | public function datasourcesList(array $params = []) |
111: | { |
112: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Query\DatasourcesList::class); |
113: | $endpoint->setParams($params); |
114: | |
115: | return $this->performRequest($endpoint); |
116: | } |
117: | |
118: | /** |
119: | * Updates an existing query datasource. |
120: | * |
121: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
122: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
123: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
124: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
125: | * $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 "-". |
126: | * |
127: | * @param array $params Associative array of parameters |
128: | * @return array |
129: | */ |
130: | public function datasourcesUpdate(array $params = []) |
131: | { |
132: | $body = $this->extractArgument($params, 'body'); |
133: | |
134: | $endpoint = $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Query\DatasourcesUpdate::class); |
135: | $endpoint->setParams($params); |
136: | $endpoint->setBody($body); |
137: | |
138: | return $this->performRequest($endpoint); |
139: | } |
140: | |
141: | } |
142: |