1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | namespace OpenSearch\Endpoints\List; |
17: | |
18: | use OpenSearch\Endpoints\AbstractEndpoint; |
19: | |
20: | |
21: | |
22: | |
23: | class Shards extends AbstractEndpoint |
24: | { |
25: | public function getURI(): string |
26: | { |
27: | $index = $this->index ?? null; |
28: | if (isset($index)) { |
29: | return "/_list/shards/$index"; |
30: | } |
31: | return "/_list/shards"; |
32: | } |
33: | |
34: | public function getParamWhitelist(): array |
35: | { |
36: | return [ |
37: | 'bytes', |
38: | 'cluster_manager_timeout', |
39: | 'format', |
40: | 'h', |
41: | 'help', |
42: | 'local', |
43: | 'master_timeout', |
44: | 'next_token', |
45: | 's', |
46: | 'size', |
47: | 'sort', |
48: | 'time', |
49: | 'v', |
50: | 'pretty', |
51: | 'human', |
52: | 'error_trace', |
53: | 'source', |
54: | 'filter_path' |
55: | ]; |
56: | } |
57: | |
58: | public function getMethod(): string |
59: | { |
60: | return 'GET'; |
61: | } |
62: | |
63: | protected function getParamDeprecation(): array |
64: | { |
65: | return ['master_timeout' => 'cluster_manager_timeout']; |
66: | } |
67: | } |
68: | |