Passed
Push — 1.x ( 77e7f6...966118 )
by Adrian
02:40 queued 12s
created

Nodes::flushattributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 5
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
4
namespace Manticoresearch;
5
6
7
use Manticoresearch\Endpoints\Nodes\AgentStatus;
8
use Manticoresearch\Endpoints\Nodes\CreateFunction;
9
use Manticoresearch\Endpoints\Nodes\CreatePlugin;
10
use Manticoresearch\Endpoints\Nodes\Debug;
11
use Manticoresearch\Endpoints\Nodes\DropFunction;
12
use Manticoresearch\Endpoints\Nodes\DropPlugin;
13
use Manticoresearch\Endpoints\Nodes\FlushAttributes;
14
use Manticoresearch\Endpoints\Nodes\FlushHostnames;
15
use Manticoresearch\Endpoints\Nodes\FlushLogs;
16
use Manticoresearch\Endpoints\Nodes\Plugins;
17
use Manticoresearch\Endpoints\Nodes\ReloadIndexes;
18
use Manticoresearch\Endpoints\Nodes\ReloadPlugins;
19
use Manticoresearch\Endpoints\Nodes\Set;
20
use Manticoresearch\Endpoints\Nodes\Status;
21
use Manticoresearch\Endpoints\Nodes\Tables;
22
use Manticoresearch\Endpoints\Nodes\Threads;
23
use Manticoresearch\Endpoints\Nodes\Variables;
24
use Manticoresearch\Endpoints\Sql;
25
26
class Nodes
27
{
28
    /**
29
     * @var Client
30
     */
31
    protected $_client;
32
    protected $_params;
33
34
    /**
35
     * Nodes namespace
36
     * @param Client $client
37
     */
38
    public function __construct($client)
39
    {
40
        $this->_client = $client;
41
        $this->_params =['responseClass'=>'Manticoresearch\\Response\\SqlToArray'];
42
    }
43
44
    public function agentstatus($params=[])
45
    {
46
        $body = $params['body']??[];
47
        $endpoint = new AgentStatus();
48
        $endpoint->setBody($body);
49
        $response = $this->_client->request($endpoint,$this->_params);
50
        return  $response->getResponse();
51
    }
52
53
    public function createfunction($params)
54
    {
55
        $body = $params['body'];
56
        $endpoint = new CreateFunction();
57
        $endpoint->setBody($body);
58
        $response = $this->_client->request($endpoint,$this->_params);
59
        return  $response->getResponse();
60
    }
61
62
    public function createplugin($params)
63
    {
64
        $body = $params['body'];
65
        $endpoint = new CreatePlugin();
66
        $endpoint->setBody($body);
67
        $response = $this->_client->request($endpoint,$this->_params);
68
        return  $response->getResponse();
69
    }
70
71
    public function debug($params)
72
    {
73
        $body = $params['body'];
74
        $endpoint = new Debug();
75
        $endpoint->setBody($body);
76
        $response = $this->_client->request($endpoint,$this->_params);
77
        return  $response->getResponse();
78
    }
79
80
    public function dropfunction($params)
81
    {
82
        $body = $params['body'];
83
        $endpoint = new DropFunction();
84
        $endpoint->setBody($body);
85
        $response = $this->_client->request($endpoint,$this->_params);
86
        return  $response->getResponse();
87
    }
88
89
    public function dropplugin($params)
90
    {
91
        $body = $params['body'];
92
        $endpoint = new DropPlugin();
93
        $endpoint->setBody($body);
94
        $response = $this->_client->request($endpoint,$this->_params);
95
        return  $response->getResponse();
96
    }
97
98
    public function flushattributes($params=[])
99
    {
100
        $body = $params['body']??[];
101
        $endpoint = new FlushAttributes();
102
        $endpoint->setBody($body);
103
        $response = $this->_client->request($endpoint,$this->_params);
104
        return  $response->getResponse();
105
    }
106
107
    public function flushhostnames($params=[])
108
    {
109
        $body = $params['body']??[];
110
        $endpoint = new FlushHostnames();
111
        $endpoint->setBody($body);
112
        $response = $this->_client->request($endpoint,$this->_params);
113
        return  $response->getResponse();
114
    }
115
116
    public function flushlogs($params=[])
117
    {
118
        $body = $params['body']??[];
119
        $endpoint = new FlushLogs();
120
        $endpoint->setBody($body);
121
        $response = $this->_client->request($endpoint,$this->_params);
122
        return  $response->getResponse();
123
    }
124
125
    public function plugins($params=[])
126
    {
127
        $body = $params['body']??[];
128
        $endpoint = new Plugins();
129
        $endpoint->setBody($body);
130
        $response = $this->_client->request($endpoint,$this->_params);
131
        return  $response->getResponse();
132
    }
133
134
    public function reloadindexes($params=[])
135
    {
136
        $body = $params['body']??[];
137
        $endpoint = new ReloadIndexes();
138
        $endpoint->setBody($body);
139
        $response = $this->_client->request($endpoint,$this->_params);
140
        return  $response->getResponse();
141
    }
142
143
    public function reloadplugins($params=[])
144
    {
145
        $body = $params['body']??[];
146
        $endpoint = new ReloadPlugins();
147
        $endpoint->setBody($body);
148
        $response = $this->_client->request($endpoint,$this->_params);
149
        return  $response->getResponse();
150
    }
151
152
    public function set($params)
153
    {
154
        $body = $params['body'];
155
        $endpoint = new Set();
156
        $endpoint->setBody($body);
157
        $response = $this->_client->request($endpoint,$this->_params);
158
        return  $response->getResponse();
159
    }
160
161
    /**
162
     * @param array $params
163
     * @return mixed
164
     */
165
    public function status($params=[])
166
    {
167
        $body = $params['body']??[];
168
        $endpoint = new Status();
169
        $endpoint->setBody($body);
170
        $response = $this->_client->request($endpoint,$this->_params);
171
        return  $response->getResponse();
172
173
    }
174
175
    public function tables($params=[])
176
    {
177
        $body = $params['body']??[];
178
        $endpoint = new Tables();
179
        $endpoint->setBody($body);
180
        $response = $this->_client->request($endpoint,$this->_params);
181
        return  $response->getResponse();
182
    }
183
184
    public function threads($params=[])
185
    {
186
        $body = $params['body']??[];
187
        $endpoint = new Threads();
188
        $endpoint->setBody($body);
189
        $response = $this->_client->request($endpoint,$this->_params);
190
        return  $response->getResponse();
191
    }
192
193
    public function variables($params=[])
194
    {
195
        $body = $params['body']??[];
196
        $endpoint = new Variables();
197
        $endpoint->setBody($body);
198
        $response = $this->_client->request($endpoint,$this->_params);
199
        return  $response->getResponse();
200
    }
201
}