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\List\Help; |
19: | use OpenSearch\Endpoints\List\Indices; |
20: | use OpenSearch\Endpoints\List\Shards; |
21: | |
22: | /** |
23: | * Class ListNamespace |
24: | * |
25: | * NOTE: This file is autogenerated using util/GenerateEndpoints.php |
26: | */ |
27: | class ListNamespace extends AbstractNamespace |
28: | { |
29: | /** |
30: | * Returns help for the List APIs. |
31: | * |
32: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
33: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
34: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
35: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
36: | * $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 "-". |
37: | * |
38: | * @param array $params Associative array of parameters |
39: | * @return array |
40: | */ |
41: | public function help(array $params = []) |
42: | { |
43: | $endpoint = $this->endpointFactory->getEndpoint(Help::class); |
44: | $endpoint->setParams($params); |
45: | |
46: | return $this->performRequest($endpoint); |
47: | } |
48: | |
49: | /** |
50: | * Returns paginated information about indexes including number of primaries and replicas, document counts, disk size. |
51: | * |
52: | * $params['index'] = (array) Comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
53: | * $params['bytes'] = (any) The unit used to display byte values. |
54: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
55: | * $params['expand_wildcards'] = (any) The type of index that wildcard patterns can match. |
56: | * $params['format'] = (string) A short version of the Accept header, such as `JSON`, `YAML`. |
57: | * $params['h'] = (array) Comma-separated list of column names to display. |
58: | * $params['health'] = (any) The health status used to limit returned indexes. By default, the response includes indexes of any health status. |
59: | * $params['help'] = (boolean) Return help information. (Default = false) |
60: | * $params['include_unloaded_segments'] = (boolean) If `true`, the response includes information from segments that are not loaded into memory. (Default = false) |
61: | * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) |
62: | * $params['master_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
63: | * $params['next_token'] = (Array) Token to retrieve next page of indexes. |
64: | * $params['pri'] = (boolean) If `true`, the response only includes information from primary shards. (Default = false) |
65: | * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. |
66: | * $params['size'] = (integer) Maximum number of indexes to be displayed in a page. |
67: | * $params['sort'] = (enum) Defines order in which indexes will be displayed. Accepted values are `asc` and `desc`. If `desc`, most recently created indexes would be displayed first. (Options = asc,desc) |
68: | * $params['time'] = (any) The unit used to display time values. |
69: | * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) |
70: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
71: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
72: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
73: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
74: | * $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 "-". |
75: | * |
76: | * @param array $params Associative array of parameters |
77: | * @return array |
78: | */ |
79: | public function indices(array $params = []) |
80: | { |
81: | $index = $this->extractArgument($params, 'index'); |
82: | |
83: | $endpoint = $this->endpointFactory->getEndpoint(Indices::class); |
84: | $endpoint->setParams($params); |
85: | $endpoint->setIndex($index); |
86: | |
87: | return $this->performRequest($endpoint); |
88: | } |
89: | |
90: | /** |
91: | * Returns paginated details of shard allocation on nodes. |
92: | * |
93: | * $params['index'] = (array) A comma-separated list of data streams, indexes, and aliases used to limit the request. Supports wildcards (`*`). To target all data streams and indexes, omit this parameter or use `*` or `_all`. |
94: | * $params['bytes'] = (any) The unit used to display byte values. |
95: | * $params['cluster_manager_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
96: | * $params['format'] = (string) A short version of the Accept header, such as `JSON`, `YAML`. |
97: | * $params['h'] = (array) Comma-separated list of column names to display. |
98: | * $params['help'] = (boolean) Return help information. (Default = false) |
99: | * $params['local'] = (boolean) Return local information, do not retrieve the state from cluster-manager node. (Default = false) |
100: | * $params['master_timeout'] = (string) Operation timeout for connection to cluster-manager node. |
101: | * $params['next_token'] = (Array) Token to retrieve next page of shards. |
102: | * $params['s'] = (array) Comma-separated list of column names or column aliases to sort by. |
103: | * $params['size'] = (integer) Maximum number of shards to be displayed in a page. |
104: | * $params['sort'] = (enum) Defines order in which shards will be displayed. Accepted values are `asc` and `desc`. If `desc`, most recently created shards would be displayed first. (Options = asc,desc) |
105: | * $params['time'] = (any) The unit in which to display time values. |
106: | * $params['v'] = (boolean) Verbose mode. Display column headers. (Default = false) |
107: | * $params['pretty'] = (boolean) Whether to pretty format the returned JSON response. (Default = false) |
108: | * $params['human'] = (boolean) Whether to return human readable values for statistics. (Default = true) |
109: | * $params['error_trace'] = (boolean) Whether to include the stack trace of returned errors. (Default = false) |
110: | * $params['source'] = (string) The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests. |
111: | * $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 "-". |
112: | * |
113: | * @param array $params Associative array of parameters |
114: | * @return array |
115: | */ |
116: | public function shards(array $params = []) |
117: | { |
118: | $index = $this->extractArgument($params, 'index'); |
119: | |
120: | $endpoint = $this->endpointFactory->getEndpoint(Shards::class); |
121: | $endpoint->setParams($params); |
122: | $endpoint->setIndex($index); |
123: | |
124: | return $this->performRequest($endpoint); |
125: | } |
126: | |
127: | } |
128: |