Skip to content

Commit

Permalink
Update endpoints to be 1.0 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Jan 21, 2014
1 parent 86c0c98 commit 2453a7e
Show file tree
Hide file tree
Showing 70 changed files with 2,743 additions and 1,041 deletions.
84 changes: 84 additions & 0 deletions src/Elasticsearch/Endpoints/ClearScroll.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php
/**
* User: zach
* Date: 01/20/2014
* Time: 14:34:49 pm
*/

namespace Elasticsearch\Endpoints;

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

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

class Clearscroll extends AbstractEndpoint
{
// A comma-separated list of scroll IDs to clear
private $scroll_id;


/**
* @param $scroll_id
*
* @return $this
*/
public function setScroll_Id($scroll_id)
{
if (isset($scroll_id) !== true) {
return $this;
}

$this->scroll_id = $scroll_id;
return $this;
}


/**
* @throws \Elasticsearch\Common\Exceptions\RuntimeException
* @return string
*/
protected function getURI()
{
if (isset($this->scroll_id) !== true) {
throw new Exceptions\RuntimeException(
'scroll_id is required for Clearscroll'
);
}
$scroll_id = $this->scroll_id;
$uri = "/_search/scroll/$scroll_id";

if (isset($scroll_id) === true) {
$uri = "/_search/scroll/$scroll_id";
}

return $uri;
}


/**
* @return string[]
*/
protected function getParamWhitelist()
{
return array(
);
}


/**
* @return string
*/
protected function getMethod()
{
return 'DELETE';
}
}
15 changes: 11 additions & 4 deletions src/Elasticsearch/Endpoints/Cluster/Health.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* User: zach
* Date: 05/31/2013
* Time: 16:47:11 pm
* Date: 01/20/2014
* Time: 14:34:49 pm
*/

namespace Elasticsearch\Endpoints\Cluster;
Expand All @@ -12,26 +12,32 @@

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

class Health extends AbstractEndpoint
{

/**
* @return string
*/
protected function getURI()
{

$index = $this->index;
$uri = "/_cluster/health";

if (isset($index) === true) {
$uri = "/_cluster/health/$index";
}

return $uri;
}


/**
* @return string[]
*/
Expand All @@ -49,6 +55,7 @@ protected function getParamWhitelist()
);
}


/**
* @return string
*/
Expand Down
43 changes: 0 additions & 43 deletions src/Elasticsearch/Endpoints/Cluster/Node/AbstractNodeEndpoint.php

This file was deleted.

54 changes: 0 additions & 54 deletions src/Elasticsearch/Endpoints/Cluster/Node/HotThreads.php

This file was deleted.

63 changes: 0 additions & 63 deletions src/Elasticsearch/Endpoints/Cluster/Node/Info.php

This file was deleted.

54 changes: 0 additions & 54 deletions src/Elasticsearch/Endpoints/Cluster/Node/Shutdown.php

This file was deleted.

Loading

0 comments on commit 2453a7e

Please sign in to comment.