Skip to content

Commit

Permalink
Added XPack endpoints + fixed minor issue on endpoint generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ezimuel committed Apr 1, 2020
1 parent 5284599 commit 763d91a
Show file tree
Hide file tree
Showing 545 changed files with 39,651 additions and 26 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ generator/*
# Elasticsearch related
util/elasticsearch/
util/cache/
util/output

# Sami docs generator
/sami.phar
Expand Down
221 changes: 221 additions & 0 deletions src/Elasticsearch/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,30 @@
use Elasticsearch\Namespaces\NodesNamespace;
use Elasticsearch\Namespaces\SnapshotNamespace;
use Elasticsearch\Namespaces\TasksNamespace;
use Elasticsearch\Namespaces\AsyncSearchNamespace;
use Elasticsearch\Namespaces\AutoscalingNamespace;
use Elasticsearch\Namespaces\CcrNamespace;
use Elasticsearch\Namespaces\DataFrameTransformDeprecatedNamespace;
use Elasticsearch\Namespaces\EnrichNamespace;
use Elasticsearch\Namespaces\EqlNamespace;
use Elasticsearch\Namespaces\GraphNamespace;
use Elasticsearch\Namespaces\IlmNamespace;
use Elasticsearch\Namespaces\LicenseNamespace;
use Elasticsearch\Namespaces\MigrationNamespace;
use Elasticsearch\Namespaces\MlNamespace;
use Elasticsearch\Namespaces\MonitoringNamespace;
use Elasticsearch\Namespaces\RollupNamespace;
use Elasticsearch\Namespaces\SecurityNamespace;
use Elasticsearch\Namespaces\SlmNamespace;
use Elasticsearch\Namespaces\SqlNamespace;
use Elasticsearch\Namespaces\SslNamespace;
use Elasticsearch\Namespaces\TransformNamespace;
use Elasticsearch\Namespaces\WatcherNamespace;
use Elasticsearch\Namespaces\XpackNamespace;

/**
* Class Client
* Generated running $ php util/GenerateEndpoints.php 7.7
*
* @category Elasticsearch
* @package Elasticsearch
Expand Down Expand Up @@ -89,6 +110,106 @@ class Client
*/
protected $tasks;

/**
* @var AsyncSearchNamespace
*/
protected $asyncSearch;

/**
* @var AutoscalingNamespace
*/
protected $autoscaling;

/**
* @var CcrNamespace
*/
protected $ccr;

/**
* @var DataFrameTransformDeprecatedNamespace
*/
protected $dataFrameTransformDeprecated;

/**
* @var EnrichNamespace
*/
protected $enrich;

/**
* @var EqlNamespace
*/
protected $eql;

/**
* @var GraphNamespace
*/
protected $graph;

/**
* @var IlmNamespace
*/
protected $ilm;

/**
* @var LicenseNamespace
*/
protected $license;

/**
* @var MigrationNamespace
*/
protected $migration;

/**
* @var MlNamespace
*/
protected $ml;

/**
* @var MonitoringNamespace
*/
protected $monitoring;

/**
* @var RollupNamespace
*/
protected $rollup;

/**
* @var SecurityNamespace
*/
protected $security;

/**
* @var SlmNamespace
*/
protected $slm;

/**
* @var SqlNamespace
*/
protected $sql;

/**
* @var SslNamespace
*/
protected $ssl;

/**
* @var TransformNamespace
*/
protected $transform;

/**
* @var WatcherNamespace
*/
protected $watcher;

/**
* @var XpackNamespace
*/
protected $xpack;


/**
* Client constructor
Expand All @@ -108,6 +229,26 @@ public function __construct(Transport $transport, callable $endpoint, array $reg
$this->nodes = new NodesNamespace($transport, $endpoint);
$this->snapshot = new SnapshotNamespace($transport, $endpoint);
$this->tasks = new TasksNamespace($transport, $endpoint);
$this->asyncSearch = new AsyncSearchNamespace($transport, $endpoint);
$this->autoscaling = new AutoscalingNamespace($transport, $endpoint);
$this->ccr = new CcrNamespace($transport, $endpoint);
$this->dataFrameTransformDeprecated = new DataFrameTransformDeprecatedNamespace($transport, $endpoint);
$this->enrich = new EnrichNamespace($transport, $endpoint);
$this->eql = new EqlNamespace($transport, $endpoint);
$this->graph = new GraphNamespace($transport, $endpoint);
$this->ilm = new IlmNamespace($transport, $endpoint);
$this->license = new LicenseNamespace($transport, $endpoint);
$this->migration = new MigrationNamespace($transport, $endpoint);
$this->ml = new MlNamespace($transport, $endpoint);
$this->monitoring = new MonitoringNamespace($transport, $endpoint);
$this->rollup = new RollupNamespace($transport, $endpoint);
$this->security = new SecurityNamespace($transport, $endpoint);
$this->slm = new SlmNamespace($transport, $endpoint);
$this->sql = new SqlNamespace($transport, $endpoint);
$this->ssl = new SslNamespace($transport, $endpoint);
$this->transform = new TransformNamespace($transport, $endpoint);
$this->watcher = new WatcherNamespace($transport, $endpoint);
$this->xpack = new XpackNamespace($transport, $endpoint);

$this->registeredNamespaces = $registeredNamespaces;
}
Expand Down Expand Up @@ -1291,6 +1432,86 @@ public function tasks(): TasksNamespace
{
return $this->tasks;
}
public function asyncSearch(): AsyncSearchNamespace
{
return $this->asyncSearch;
}
public function autoscaling(): AutoscalingNamespace
{
return $this->autoscaling;
}
public function ccr(): CcrNamespace
{
return $this->ccr;
}
public function dataFrameTransformDeprecated(): DataFrameTransformDeprecatedNamespace
{
return $this->dataFrameTransformDeprecated;
}
public function enrich(): EnrichNamespace
{
return $this->enrich;
}
public function eql(): EqlNamespace
{
return $this->eql;
}
public function graph(): GraphNamespace
{
return $this->graph;
}
public function ilm(): IlmNamespace
{
return $this->ilm;
}
public function license(): LicenseNamespace
{
return $this->license;
}
public function migration(): MigrationNamespace
{
return $this->migration;
}
public function ml(): MlNamespace
{
return $this->ml;
}
public function monitoring(): MonitoringNamespace
{
return $this->monitoring;
}
public function rollup(): RollupNamespace
{
return $this->rollup;
}
public function security(): SecurityNamespace
{
return $this->security;
}
public function slm(): SlmNamespace
{
return $this->slm;
}
public function sql(): SqlNamespace
{
return $this->sql;
}
public function ssl(): SslNamespace
{
return $this->ssl;
}
public function transform(): TransformNamespace
{
return $this->transform;
}
public function watcher(): WatcherNamespace
{
return $this->watcher;
}
public function xpack(): XpackNamespace
{
return $this->xpack;
}

/**
* Catchall for registered namespaces
Expand Down
52 changes: 52 additions & 0 deletions src/Elasticsearch/Endpoints/AsyncSearch/Delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
declare(strict_types = 1);

namespace Elasticsearch\Endpoints\AsyncSearch;

use Elasticsearch\Common\Exceptions\RuntimeException;
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Delete
* Elasticsearch API name async_search.delete
* Generated running $ php util/GenerateEndpoints.php 7.7
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\AsyncSearch
* @author Enrico Zimuel <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class Delete extends AbstractEndpoint
{

public function getURI(): string
{
$id = $this->id ?? null;

if (isset($id)) {
return "/_async_search/$id";
}
throw new RuntimeException('Missing parameter for the endpoint async_search.delete');
}

public function getParamWhitelist(): array
{
return [];
}

public function getMethod(): string
{
return 'DELETE';
}

public function setId($id): Delete
{
if (isset($id) !== true) {
return $this;
}
$this->id = $id;

return $this;
}
}
56 changes: 56 additions & 0 deletions src/Elasticsearch/Endpoints/AsyncSearch/Get.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
declare(strict_types = 1);

namespace Elasticsearch\Endpoints\AsyncSearch;

use Elasticsearch\Common\Exceptions\RuntimeException;
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Get
* Elasticsearch API name async_search.get
* Generated running $ php util/GenerateEndpoints.php 7.7
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\AsyncSearch
* @author Enrico Zimuel <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
* @link http://elastic.co
*/
class Get extends AbstractEndpoint
{

public function getURI(): string
{
$id = $this->id ?? null;

if (isset($id)) {
return "/_async_search/$id";
}
throw new RuntimeException('Missing parameter for the endpoint async_search.get');
}

public function getParamWhitelist(): array
{
return [
'wait_for_completion_timeout',
'keep_alive',
'typed_keys'
];
}

public function getMethod(): string
{
return 'GET';
}

public function setId($id): Get
{
if (isset($id) !== true) {
return $this;
}
$this->id = $id;

return $this;
}
}
Loading

0 comments on commit 763d91a

Please sign in to comment.