1<?php
2
3declare(strict_types = 1);
4/**
5 * User: zach
6 * Date: 01/20/2014
7 * Time: 14:34:49 pm
8 */
9
10namespace Elasticsearch\Endpoints\Indices\Upgrade;
11
12use Elasticsearch\Endpoints\AbstractEndpoint;
13use Elasticsearch\Common\Exceptions;
14
15/**
16 * Class Post
17 *
18 * @category Elasticsearch
19 * @package  Elasticsearch\Endpoints\Indices
20 * @author   Zachary Tong <zach@elastic.co>
21 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
22 * @link     http://elastic.co
23 */
24
25class Get extends AbstractEndpoint
26{
27    public function getURI(): string
28    {
29        $index = $this->index ?? null;
30        if (isset($index)) {
31            return "/$index/_upgrade";
32        }
33        return "/_upgrade";
34    }
35
36    public function getParamWhitelist(): array
37    {
38        return [
39            'ignore_unavailable',
40            'allow_no_indices',
41            'expand_wildcards'
42        ];
43    }
44
45    public function getMethod(): string
46    {
47        return 'GET';
48    }
49}
50