-
Notifications
You must be signed in to change notification settings - Fork 964
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Cat and a few other new 1.0 endpoints
- Loading branch information
1 parent
e36b6df
commit 73b72b0
Showing
21 changed files
with
1,524 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
/** | ||
* User: zach | ||
* Date: 01/20/2014 | ||
* Time: 14:34:49 pm | ||
*/ | ||
|
||
namespace Elasticsearch\Endpoints\Cat; | ||
|
||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
use Elasticsearch\Common\Exceptions; | ||
|
||
/** | ||
* 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://elasticsearch.org | ||
*/ | ||
|
||
class Aliases extends AbstractEndpoint | ||
{ | ||
// A comma-separated list of alias names to return | ||
private $name; | ||
|
||
|
||
/** | ||
* @param $name | ||
* | ||
* @return $this | ||
*/ | ||
public function setName($name) | ||
{ | ||
if (isset($name) !== true) { | ||
return $this; | ||
} | ||
|
||
$this->name = $name; | ||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
$name = $this->name; | ||
$uri = "/_cat/aliases"; | ||
|
||
if (isset($name) === true) { | ||
$uri = "/_cat/aliases/$name"; | ||
} | ||
|
||
return $uri; | ||
} | ||
|
||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'local', | ||
'master_timeout', | ||
'h', | ||
'help', | ||
'v', | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'GET'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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\Cat; | ||
|
||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
use Elasticsearch\Common\Exceptions; | ||
|
||
/** | ||
* 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://elasticsearch.org | ||
*/ | ||
|
||
class Allocation extends AbstractEndpoint | ||
{ | ||
// A comma-separated list of node IDs or names to limit the returned information | ||
private $node_id; | ||
|
||
|
||
/** | ||
* @param $node_id | ||
* | ||
* @return $this | ||
*/ | ||
public function setNode_Id($node_id) | ||
{ | ||
if (isset($node_id) !== true) { | ||
return $this; | ||
} | ||
|
||
$this->node_id = $node_id; | ||
return $this; | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
$node_id = $this->node_id; | ||
$uri = "/_cat/allocation"; | ||
|
||
if (isset($node_id) === true) { | ||
$uri = "/_cat/allocation/$node_id"; | ||
} | ||
|
||
return $uri; | ||
} | ||
|
||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'bytes', | ||
'local', | ||
'master_timeout', | ||
'h', | ||
'help', | ||
'v', | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'GET'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
/** | ||
* User: zach | ||
* Date: 01/20/2014 | ||
* Time: 14:34:49 pm | ||
*/ | ||
|
||
namespace Elasticsearch\Endpoints\Cat; | ||
|
||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
use Elasticsearch\Common\Exceptions; | ||
|
||
/** | ||
* 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://elasticsearch.org | ||
*/ | ||
|
||
class Count extends AbstractEndpoint | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
$index = $this->index; | ||
$uri = "/_cat/count"; | ||
|
||
if (isset($index) === true) { | ||
$uri = "/_cat/count/$index"; | ||
} | ||
|
||
return $uri; | ||
} | ||
|
||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'local', | ||
'master_timeout', | ||
'h', | ||
'help', | ||
'v', | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'GET'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/** | ||
* User: zach | ||
* Date: 01/20/2014 | ||
* Time: 14:34:49 pm | ||
*/ | ||
|
||
namespace Elasticsearch\Endpoints\Cat; | ||
|
||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
use Elasticsearch\Common\Exceptions; | ||
|
||
/** | ||
* 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://elasticsearch.org | ||
*/ | ||
|
||
class Health extends AbstractEndpoint | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
$uri = "/_cat/health"; | ||
|
||
|
||
return $uri; | ||
} | ||
|
||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'local', | ||
'master_timeout', | ||
'h', | ||
'help', | ||
'ts', | ||
'v', | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'GET'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
/** | ||
* User: zach | ||
* Date: 01/20/2014 | ||
* Time: 14:34:49 pm | ||
*/ | ||
|
||
namespace Elasticsearch\Endpoints\Cat; | ||
|
||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
use Elasticsearch\Common\Exceptions; | ||
|
||
/** | ||
* 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://elasticsearch.org | ||
*/ | ||
|
||
class Help extends AbstractEndpoint | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
$uri = "/_cat"; | ||
|
||
|
||
return $uri; | ||
} | ||
|
||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'help', | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'GET'; | ||
} | ||
} |
Oops, something went wrong.