-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0acccc6
commit 776c865
Showing
2 changed files
with
97 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,70 @@ | ||
<?php | ||
|
||
namespace Elasticsearch\Endpoints\Cat; | ||
|
||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
|
||
/** | ||
* Class Templates | ||
* | ||
* @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 Templates extends AbstractEndpoint | ||
{ | ||
private $name; | ||
|
||
/** | ||
* @param string $name | ||
* @return Templates | ||
*/ | ||
public function setName($name) | ||
{ | ||
$this->name = $name; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getURI() | ||
{ | ||
if (isset($this->name)) { | ||
return "/_cat/templates/{$this->name}"; | ||
} else { | ||
return "/_cat/templates"; | ||
} | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
public function getParamWhitelist() | ||
{ | ||
return array( | ||
'format', | ||
'node_id', | ||
'actions', | ||
'detailed', | ||
'parent_node', | ||
'parent_task', | ||
'h', | ||
'help', | ||
'v', | ||
's', | ||
'local', | ||
'master_timeout', | ||
); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public 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