1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Endpoints\Cat;
6
7use Elasticsearch\Endpoints\AbstractEndpoint;
8
9/**
10 * Class Indices
11 *
12 * @category Elasticsearch
13 * @package  Elasticsearch\Endpoints\Cat
14 * @author   Zachary Tong <zach@elastic.co>
15 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
16 * @link     http://elastic.co
17 */
18
19class Indices extends AbstractEndpoint
20{
21    public function getURI(): string
22    {
23        $index = $this->index ?? null;
24
25        if (isset($index)) {
26            return "/_cat/indices/$index";
27        }
28
29        return "/_cat/indices";
30    }
31
32    public function getParamWhitelist(): array
33    {
34        return [
35            'format',
36            'bytes',
37            'local',
38            'master_timeout',
39            'h',
40            'health',
41            'help',
42            'pri',
43            's',
44            'v'
45        ];
46    }
47
48    public function getMethod(): string
49    {
50        return 'GET';
51    }
52}
53