Skip to content

Commit

Permalink
Auto-update endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed May 31, 2016
1 parent 7148f9e commit 3b041f8
Show file tree
Hide file tree
Showing 105 changed files with 1,121 additions and 970 deletions.
7 changes: 3 additions & 4 deletions src/Elasticsearch/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -1085,11 +1085,10 @@ public function clearScroll($params = array())
/** @var callback $endpointBuilder */
$endpointBuilder = $this->endpoints;

/** @var \Elasticsearch\Endpoints\Scroll $endpoint */
$endpoint = $endpointBuilder('Scroll');
/** @var \Elasticsearch\Endpoints\ClearScroll $endpoint */
$endpoint = $endpointBuilder('ClearScroll');
$endpoint->setScrollID($scrollID)
->setBody($body)
->setClearScroll(true);
->setBody($body);
$endpoint->setParams($params);
$response = $endpoint->performRequest();

Expand Down
14 changes: 8 additions & 6 deletions src/Elasticsearch/Endpoints/Cat/Aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Aliases
* Class Aliases.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class Aliases extends AbstractEndpoint
{
// A comma-separated list of alias names to return
private $name;

/**
* @param $name
*
Expand All @@ -28,7 +28,9 @@ public function setName($name)
if (isset($name) !== true) {
return $this;
}

if (is_array($name) === true) {
$name = implode(',', $name);
}
$this->name = $name;

return $this;
Expand All @@ -40,8 +42,7 @@ public function setName($name)
protected function getURI()
{
$name = $this->name;
$uri = "/_cat/aliases";

$uri = '/_cat/aliases';
if (isset($name) === true) {
$uri = "/_cat/aliases/$name";
}
Expand All @@ -55,6 +56,7 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'local',
'master_timeout',
'h',
Expand Down
14 changes: 8 additions & 6 deletions src/Elasticsearch/Endpoints/Cat/Allocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Allocation
* Class Allocation.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class Allocation extends AbstractEndpoint
{
// A comma-separated list of node IDs or names to limit the returned information
private $node_id;

/**
* @param $node_id
*
Expand All @@ -28,7 +28,9 @@ public function setNodeId($node_id)
if (isset($node_id) !== true) {
return $this;
}

if (is_array($node_id) === true) {
$node_id = implode(',', $node_id);
}
$this->node_id = $node_id;

return $this;
Expand All @@ -40,8 +42,7 @@ public function setNodeId($node_id)
protected function getURI()
{
$node_id = $this->node_id;
$uri = "/_cat/allocation";

$uri = '/_cat/allocation';
if (isset($node_id) === true) {
$uri = "/_cat/allocation/$node_id";
}
Expand All @@ -55,6 +56,7 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'bytes',
'local',
'master_timeout',
Expand Down
9 changes: 5 additions & 4 deletions src/Elasticsearch/Endpoints/Cat/Count.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Count
* Class Count.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class Count extends AbstractEndpoint
Expand All @@ -21,8 +22,7 @@ class Count extends AbstractEndpoint
protected function getURI()
{
$index = $this->index;
$uri = "/_cat/count";

$uri = '/_cat/count';
if (isset($index) === true) {
$uri = "/_cat/count/$index";
}
Expand All @@ -36,6 +36,7 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'local',
'master_timeout',
'h',
Expand Down
17 changes: 11 additions & 6 deletions src/Elasticsearch/Endpoints/Cat/Fielddata.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Fielddata
* Class Fielddata.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class Fielddata extends AbstractEndpoint
{
// A comma-separated list of fields to return the fielddata size
private $fields;

/**
* @param $fields
*
Expand All @@ -27,7 +28,9 @@ public function setFields($fields)
if (isset($fields) !== true) {
return $this;
}

if (is_array($fields) === true) {
$fields = implode(',', $fields);
}
$this->fields = $fields;

return $this;
Expand All @@ -39,8 +42,7 @@ public function setFields($fields)
protected function getURI()
{
$fields = $this->fields;
$uri = "/_cat/fielddata";

$uri = '/_cat/fielddata';
if (isset($fields) === true) {
$uri = "/_cat/fielddata/$fields";
}
Expand All @@ -54,11 +56,14 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'bytes',
'local',
'master_timeout',
'h',
'help',
'v',
'fields',
);
}

Expand Down
8 changes: 5 additions & 3 deletions src/Elasticsearch/Endpoints/Cat/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Health
* Class Health.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class Health extends AbstractEndpoint
Expand All @@ -20,7 +21,7 @@ class Health extends AbstractEndpoint
*/
protected function getURI()
{
$uri = "/_cat/health";
$uri = '/_cat/health';

return $uri;
}
Expand All @@ -31,6 +32,7 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'local',
'master_timeout',
'h',
Expand Down
7 changes: 4 additions & 3 deletions src/Elasticsearch/Endpoints/Cat/Help.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Help
* Class Help.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class Help extends AbstractEndpoint
Expand All @@ -20,7 +21,7 @@ class Help extends AbstractEndpoint
*/
protected function getURI()
{
$uri = "/_cat";
$uri = '/_cat';

return $uri;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Elasticsearch/Endpoints/Cat/Indices.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Indices
* Class Indices.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/

class Indices extends AbstractEndpoint
{
/**
Expand All @@ -22,8 +22,7 @@ class Indices extends AbstractEndpoint
protected function getURI()
{
$index = $this->index;
$uri = "/_cat/indices";

$uri = '/_cat/indices';
if (isset($index) === true) {
$uri = "/_cat/indices/$index";
}
Expand All @@ -37,6 +36,7 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'bytes',
'local',
'master_timeout',
Expand Down
8 changes: 5 additions & 3 deletions src/Elasticsearch/Endpoints/Cat/Master.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class Master
* Class Master.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class Master extends AbstractEndpoint
Expand All @@ -20,7 +21,7 @@ class Master extends AbstractEndpoint
*/
protected function getURI()
{
$uri = "/_cat/master";
$uri = '/_cat/master';

return $uri;
}
Expand All @@ -31,6 +32,7 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'local',
'master_timeout',
'h',
Expand Down
10 changes: 6 additions & 4 deletions src/Elasticsearch/Endpoints/Cat/NodeAttrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
use Elasticsearch\Endpoints\AbstractEndpoint;

/**
* Class NodeAttrs
* Class Nodeattrs.
*
* @category Elasticsearch
* @package Elasticsearch\Endpoints\Cat
*
* @author Zachary Tong <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
*
* @link http://elastic.co
*/
class NodeAttrs extends AbstractEndpoint
class Nodeattrs extends AbstractEndpoint
{
/**
* @return string
*/
protected function getURI()
{
$uri = "/_cat/nodeattrs";
$uri = '/_cat/nodeattrs';

return $uri;
}
Expand All @@ -31,6 +32,7 @@ protected function getURI()
protected function getParamWhitelist()
{
return array(
'format',
'local',
'master_timeout',
'h',
Expand Down
Loading

0 comments on commit 3b041f8

Please sign in to comment.