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