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\DanglingIndices; |
23: | |
24: | use OpenSearch\Common\Exceptions\RuntimeException; |
25: | use OpenSearch\Endpoints\AbstractEndpoint; |
26: | |
27: | |
28: | |
29: | |
30: | class DeleteDanglingIndex extends AbstractEndpoint |
31: | { |
32: | protected $index_uuid; |
33: | |
34: | public function getURI(): string |
35: | { |
36: | $index_uuid = $this->index_uuid ?? null; |
37: | if (isset($index_uuid)) { |
38: | return "/_dangling/$index_uuid"; |
39: | } |
40: | throw new RuntimeException('Missing parameter for the endpoint dangling_indices.delete_dangling_index'); |
41: | } |
42: | |
43: | public function getParamWhitelist(): array |
44: | { |
45: | return [ |
46: | 'accept_data_loss', |
47: | 'cluster_manager_timeout', |
48: | 'master_timeout', |
49: | 'timeout', |
50: | 'pretty', |
51: | 'human', |
52: | 'error_trace', |
53: | 'source', |
54: | 'filter_path' |
55: | ]; |
56: | } |
57: | |
58: | public function getMethod(): string |
59: | { |
60: | return 'DELETE'; |
61: | } |
62: | |
63: | public function setIndexUuid($index_uuid): static |
64: | { |
65: | if (isset($index_uuid) !== true) { |
66: | return $this; |
67: | } |
68: | $this->index_uuid = $index_uuid; |
69: | |
70: | return $this; |
71: | } |
72: | |
73: | protected function getParamDeprecation(): array |
74: | { |
75: | return ['master_timeout' => 'cluster_manager_timeout']; |
76: | } |
77: | } |
78: | |