Skip to content

Commit 763d91a

Browse files
committed
Added XPack endpoints + fixed minor issue on endpoint generation
1 parent 5284599 commit 763d91a

File tree

545 files changed

+39651
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

545 files changed

+39651
-26
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ generator/*
2323
# Elasticsearch related
2424
util/elasticsearch/
2525
util/cache/
26-
util/output
2726

2827
# Sami docs generator
2928
/sami.phar

src/Elasticsearch/Client.php

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,30 @@
2020
use Elasticsearch\Namespaces\NodesNamespace;
2121
use Elasticsearch\Namespaces\SnapshotNamespace;
2222
use Elasticsearch\Namespaces\TasksNamespace;
23+
use Elasticsearch\Namespaces\AsyncSearchNamespace;
24+
use Elasticsearch\Namespaces\AutoscalingNamespace;
25+
use Elasticsearch\Namespaces\CcrNamespace;
26+
use Elasticsearch\Namespaces\DataFrameTransformDeprecatedNamespace;
27+
use Elasticsearch\Namespaces\EnrichNamespace;
28+
use Elasticsearch\Namespaces\EqlNamespace;
29+
use Elasticsearch\Namespaces\GraphNamespace;
30+
use Elasticsearch\Namespaces\IlmNamespace;
31+
use Elasticsearch\Namespaces\LicenseNamespace;
32+
use Elasticsearch\Namespaces\MigrationNamespace;
33+
use Elasticsearch\Namespaces\MlNamespace;
34+
use Elasticsearch\Namespaces\MonitoringNamespace;
35+
use Elasticsearch\Namespaces\RollupNamespace;
36+
use Elasticsearch\Namespaces\SecurityNamespace;
37+
use Elasticsearch\Namespaces\SlmNamespace;
38+
use Elasticsearch\Namespaces\SqlNamespace;
39+
use Elasticsearch\Namespaces\SslNamespace;
40+
use Elasticsearch\Namespaces\TransformNamespace;
41+
use Elasticsearch\Namespaces\WatcherNamespace;
42+
use Elasticsearch\Namespaces\XpackNamespace;
2343

2444
/**
2545
* Class Client
46+
* Generated running $ php util/GenerateEndpoints.php 7.7
2647
*
2748
* @category Elasticsearch
2849
* @package Elasticsearch
@@ -89,6 +110,106 @@ class Client
89110
*/
90111
protected $tasks;
91112

113+
/**
114+
* @var AsyncSearchNamespace
115+
*/
116+
protected $asyncSearch;
117+
118+
/**
119+
* @var AutoscalingNamespace
120+
*/
121+
protected $autoscaling;
122+
123+
/**
124+
* @var CcrNamespace
125+
*/
126+
protected $ccr;
127+
128+
/**
129+
* @var DataFrameTransformDeprecatedNamespace
130+
*/
131+
protected $dataFrameTransformDeprecated;
132+
133+
/**
134+
* @var EnrichNamespace
135+
*/
136+
protected $enrich;
137+
138+
/**
139+
* @var EqlNamespace
140+
*/
141+
protected $eql;
142+
143+
/**
144+
* @var GraphNamespace
145+
*/
146+
protected $graph;
147+
148+
/**
149+
* @var IlmNamespace
150+
*/
151+
protected $ilm;
152+
153+
/**
154+
* @var LicenseNamespace
155+
*/
156+
protected $license;
157+
158+
/**
159+
* @var MigrationNamespace
160+
*/
161+
protected $migration;
162+
163+
/**
164+
* @var MlNamespace
165+
*/
166+
protected $ml;
167+
168+
/**
169+
* @var MonitoringNamespace
170+
*/
171+
protected $monitoring;
172+
173+
/**
174+
* @var RollupNamespace
175+
*/
176+
protected $rollup;
177+
178+
/**
179+
* @var SecurityNamespace
180+
*/
181+
protected $security;
182+
183+
/**
184+
* @var SlmNamespace
185+
*/
186+
protected $slm;
187+
188+
/**
189+
* @var SqlNamespace
190+
*/
191+
protected $sql;
192+
193+
/**
194+
* @var SslNamespace
195+
*/
196+
protected $ssl;
197+
198+
/**
199+
* @var TransformNamespace
200+
*/
201+
protected $transform;
202+
203+
/**
204+
* @var WatcherNamespace
205+
*/
206+
protected $watcher;
207+
208+
/**
209+
* @var XpackNamespace
210+
*/
211+
protected $xpack;
212+
92213

93214
/**
94215
* Client constructor
@@ -108,6 +229,26 @@ public function __construct(Transport $transport, callable $endpoint, array $reg
108229
$this->nodes = new NodesNamespace($transport, $endpoint);
109230
$this->snapshot = new SnapshotNamespace($transport, $endpoint);
110231
$this->tasks = new TasksNamespace($transport, $endpoint);
232+
$this->asyncSearch = new AsyncSearchNamespace($transport, $endpoint);
233+
$this->autoscaling = new AutoscalingNamespace($transport, $endpoint);
234+
$this->ccr = new CcrNamespace($transport, $endpoint);
235+
$this->dataFrameTransformDeprecated = new DataFrameTransformDeprecatedNamespace($transport, $endpoint);
236+
$this->enrich = new EnrichNamespace($transport, $endpoint);
237+
$this->eql = new EqlNamespace($transport, $endpoint);
238+
$this->graph = new GraphNamespace($transport, $endpoint);
239+
$this->ilm = new IlmNamespace($transport, $endpoint);
240+
$this->license = new LicenseNamespace($transport, $endpoint);
241+
$this->migration = new MigrationNamespace($transport, $endpoint);
242+
$this->ml = new MlNamespace($transport, $endpoint);
243+
$this->monitoring = new MonitoringNamespace($transport, $endpoint);
244+
$this->rollup = new RollupNamespace($transport, $endpoint);
245+
$this->security = new SecurityNamespace($transport, $endpoint);
246+
$this->slm = new SlmNamespace($transport, $endpoint);
247+
$this->sql = new SqlNamespace($transport, $endpoint);
248+
$this->ssl = new SslNamespace($transport, $endpoint);
249+
$this->transform = new TransformNamespace($transport, $endpoint);
250+
$this->watcher = new WatcherNamespace($transport, $endpoint);
251+
$this->xpack = new XpackNamespace($transport, $endpoint);
111252

112253
$this->registeredNamespaces = $registeredNamespaces;
113254
}
@@ -1291,6 +1432,86 @@ public function tasks(): TasksNamespace
12911432
{
12921433
return $this->tasks;
12931434
}
1435+
public function asyncSearch(): AsyncSearchNamespace
1436+
{
1437+
return $this->asyncSearch;
1438+
}
1439+
public function autoscaling(): AutoscalingNamespace
1440+
{
1441+
return $this->autoscaling;
1442+
}
1443+
public function ccr(): CcrNamespace
1444+
{
1445+
return $this->ccr;
1446+
}
1447+
public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace
1448+
{
1449+
return $this->dataFrameTransformDeprecated;
1450+
}
1451+
public function enrich(): EnrichNamespace
1452+
{
1453+
return $this->enrich;
1454+
}
1455+
public function eql(): EqlNamespace
1456+
{
1457+
return $this->eql;
1458+
}
1459+
public function graph(): GraphNamespace
1460+
{
1461+
return $this->graph;
1462+
}
1463+
public function ilm(): IlmNamespace
1464+
{
1465+
return $this->ilm;
1466+
}
1467+
public function license(): LicenseNamespace
1468+
{
1469+
return $this->license;
1470+
}
1471+
public function migration(): MigrationNamespace
1472+
{
1473+
return $this->migration;
1474+
}
1475+
public function ml(): MlNamespace
1476+
{
1477+
return $this->ml;
1478+
}
1479+
public function monitoring(): MonitoringNamespace
1480+
{
1481+
return $this->monitoring;
1482+
}
1483+
public function rollup(): RollupNamespace
1484+
{
1485+
return $this->rollup;
1486+
}
1487+
public function security(): SecurityNamespace
1488+
{
1489+
return $this->security;
1490+
}
1491+
public function slm(): SlmNamespace
1492+
{
1493+
return $this->slm;
1494+
}
1495+
public function sql(): SqlNamespace
1496+
{
1497+
return $this->sql;
1498+
}
1499+
public function ssl(): SslNamespace
1500+
{
1501+
return $this->ssl;
1502+
}
1503+
public function transform(): TransformNamespace
1504+
{
1505+
return $this->transform;
1506+
}
1507+
public function watcher(): WatcherNamespace
1508+
{
1509+
return $this->watcher;
1510+
}
1511+
public function xpack(): XpackNamespace
1512+
{
1513+
return $this->xpack;
1514+
}
12941515

12951516
/**
12961517
* Catchall for registered namespaces
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
declare(strict_types = 1);
3+
4+
namespace Elasticsearch\Endpoints\AsyncSearch;
5+
6+
use Elasticsearch\Common\Exceptions\RuntimeException;
7+
use Elasticsearch\Endpoints\AbstractEndpoint;
8+
9+
/**
10+
* Class Delete
11+
* Elasticsearch API name async_search.delete
12+
* Generated running $ php util/GenerateEndpoints.php 7.7
13+
*
14+
* @category Elasticsearch
15+
* @package Elasticsearch\Endpoints\AsyncSearch
16+
* @author Enrico Zimuel <enrico.zimuel@elastic.co>
17+
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
18+
* @link http://elastic.co
19+
*/
20+
class Delete extends AbstractEndpoint
21+
{
22+
23+
public function getURI(): string
24+
{
25+
$id = $this->id ?? null;
26+
27+
if (isset($id)) {
28+
return "/_async_search/$id";
29+
}
30+
throw new RuntimeException('Missing parameter for the endpoint async_search.delete');
31+
}
32+
33+
public function getParamWhitelist(): array
34+
{
35+
return [];
36+
}
37+
38+
public function getMethod(): string
39+
{
40+
return 'DELETE';
41+
}
42+
43+
public function setId($id): Delete
44+
{
45+
if (isset($id) !== true) {
46+
return $this;
47+
}
48+
$this->id = $id;
49+
50+
return $this;
51+
}
52+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
declare(strict_types = 1);
3+
4+
namespace Elasticsearch\Endpoints\AsyncSearch;
5+
6+
use Elasticsearch\Common\Exceptions\RuntimeException;
7+
use Elasticsearch\Endpoints\AbstractEndpoint;
8+
9+
/**
10+
* Class Get
11+
* Elasticsearch API name async_search.get
12+
* Generated running $ php util/GenerateEndpoints.php 7.7
13+
*
14+
* @category Elasticsearch
15+
* @package Elasticsearch\Endpoints\AsyncSearch
16+
* @author Enrico Zimuel <enrico.zimuel@elastic.co>
17+
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
18+
* @link http://elastic.co
19+
*/
20+
class Get extends AbstractEndpoint
21+
{
22+
23+
public function getURI(): string
24+
{
25+
$id = $this->id ?? null;
26+
27+
if (isset($id)) {
28+
return "/_async_search/$id";
29+
}
30+
throw new RuntimeException('Missing parameter for the endpoint async_search.get');
31+
}
32+
33+
public function getParamWhitelist(): array
34+
{
35+
return [
36+
'wait_for_completion_timeout',
37+
'keep_alive',
38+
'typed_keys'
39+
];
40+
}
41+
42+
public function getMethod(): string
43+
{
44+
return 'GET';
45+
}
46+
47+
public function setId($id): Get
48+
{
49+
if (isset($id) !== true) {
50+
return $this;
51+
}
52+
$this->id = $id;
53+
54+
return $this;
55+
}
56+
}

0 commit comments

Comments
 (0)