1<?php
2
3declare(strict_types = 1);
4
5namespace Elasticsearch\Endpoints\Cluster\Nodes;
6
7/**
8 * Class Hotthreads
9 *
10 * @category Elasticsearch
11 * @package  Elasticsearch\Endpoints\Cluster\Nodes
12 * @author   Zachary Tong <zach@elastic.co>
13 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
14 * @link     http://elastic.co
15 */
16class HotThreads extends AbstractNodesEndpoint
17{
18    public function getURI(): string
19    {
20        $nodeId = $this->nodeID;
21        if (isset($nodeId)) {
22            return "/_cluster/nodes/$nodeId/hotthreads";
23        }
24        return "/_cluster/nodes/hotthreads";
25    }
26
27    /**
28     * @return string[]
29     */
30    public function getParamWhitelist(): array
31    {
32        return [
33            'interval',
34            'snapshots',
35            'threads',
36            'ignore_idle_threads',
37            'type',
38            'timeout'
39        ];
40    }
41
42    public function getMethod(): string
43    {
44        return 'GET';
45    }
46}
47