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\Neural\Stats; |
19: | |
20: | /** |
21: | * Class NeuralNamespace |
22: | * |
23: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
24: | */ |
25: | class NeuralNamespace extends AbstractNamespace |
26: | { |
27: | /** |
28: | * Provides information about the current status of the neural-search plugin. |
29: | * |
30: | * $params['node_id'] = (string) A comma-separated list of node IDs or names to limit the returned information; leave empty to get information from all nodes. |
31: | * $params['stat'] = (array) A comma-separated list of stats to retrieve; use empty string to retrieve all stats. |
32: | * $params['flat_stat_paths'] = (boolean) Whether to return stats in the flat form, which can improve readability, especially for heavily nested stats.For example, the flat form of `"processors": { "ingest": { "text_embedding_executions": 20181212 } }` is `"processors.ingest.text_embedding_executions": "20181212"`. (Default = false) |
33: | * $params['include_all_nodes'] = (boolean) When `true` includes aggregated statistics across all nodes in the `all_nodes` category.When `false`, excludes the `all_nodes` category from the response. (Default = true) |
34: | * $params['include_individual_nodes'] = (boolean) When `true` includes statistics for individual nodes in the `nodes` category.When `false`, excludes the `nodes` category from the response. (Default = true) |
35: | * $params['include_info'] = (boolean) When `true` includes cluster-wide information in the `info` category.When `false`, excludes the `info` category from the response. (Default = true) |
36: | * $params['include_metadata'] = (boolean) Whether to return stat metadata instead of the raw stat value, includes additional information about the stat.These can include things like type hints, time since last stats being recorded, or recent rolling interval values (Default = false) |
37: | * $params['pretty'] = (boolean) Whether to pretty-format the returned JSON response. (Default = false) |
38: | * $params['human'] = (boolean) Whether to return human-readable values for statistics. (Default = false) |
39: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
40: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
41: | * $params['filter_path'] = (any) A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`. |
42: | * |
43: | * @param array $params Associative array of parameters |
44: | * @return array |
45: | */ |
46: | public function stats(array $params = []) |
47: | { |
48: | $node_id = $this->extractArgument($params, 'node_id'); |
49: | $stat = $this->extractArgument($params, 'stat'); |
50: | |
51: | $endpoint = $this->endpointFactory->getEndpoint(Stats::class); |
52: | $endpoint->setParams($params); |
53: | $endpoint->setNodeId($node_id); |
54: | $endpoint->setStat($stat); |
55: | |
56: | return $this->performRequest($endpoint); |
57: | } |
58: | |
59: | } |
60: |