-
Notifications
You must be signed in to change notification settings - Fork 966
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
a76cbf2
commit 66c851f
Showing
6 changed files
with
378 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
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,54 @@ | ||
<?php | ||
|
||
namespace Elasticsearch\Endpoints\Ingest\Pipeline; | ||
|
||
use Elasticsearch\Common\Exceptions; | ||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
|
||
/** | ||
* Class Delete | ||
* | ||
* @category Elasticsearch | ||
* @package Elasticsearch\Endpoints\Ingest | ||
* @author Zachary Tong <zachary.tong@elasticsearch.com> | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 | ||
* @link http://elasticsearch.org | ||
*/ | ||
class Delete extends AbstractEndpoint | ||
{ | ||
/** | ||
* @throws \Elasticsearch\Common\Exceptions\RuntimeException | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
if (isset($this->id) !== true) { | ||
throw new Exceptions\RuntimeException( | ||
'id is required for DeletePipeline' | ||
); | ||
} | ||
$id = $this->id; | ||
$uri = "/_ingest/pipeline/$id"; | ||
|
||
return $uri; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'master_timeout', | ||
'timeout' | ||
); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'DELETE'; | ||
} | ||
} |
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,53 @@ | ||
<?php | ||
|
||
namespace Elasticsearch\Endpoints\Ingest\Pipeline; | ||
|
||
use Elasticsearch\Common\Exceptions; | ||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
|
||
/** | ||
* Class Get | ||
* | ||
* @category Elasticsearch | ||
* @package Elasticsearch\Endpoints\Ingest | ||
* @author Zachary Tong <zachary.tong@elasticsearch.com> | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 | ||
* @link http://elasticsearch.org | ||
*/ | ||
class Get extends AbstractEndpoint | ||
{ | ||
/** | ||
* @throws \Elasticsearch\Common\Exceptions\RuntimeException | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
if (isset($this->id) !== true) { | ||
throw new Exceptions\RuntimeException( | ||
'id is required for GetPipeline' | ||
); | ||
} | ||
$id = $this->id; | ||
$uri = "/_ingest/pipeline/$id"; | ||
|
||
return $uri; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'master_timeout' | ||
); | ||
} | ||
|
||
/** | ||
* @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,71 @@ | ||
<?php | ||
|
||
namespace Elasticsearch\Endpoints\Ingest\Pipeline; | ||
|
||
use Elasticsearch\Common\Exceptions; | ||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
|
||
/** | ||
* Class Put | ||
* | ||
* @category Elasticsearch | ||
* @package Elasticsearch\Endpoints\Ingest | ||
* @author Zachary Tong <zachary.tong@elasticsearch.com> | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 | ||
* @link http://elasticsearch.org | ||
*/ | ||
class Put extends AbstractEndpoint | ||
{ | ||
/** | ||
* @param array $body | ||
* | ||
* @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException | ||
* @return $this | ||
*/ | ||
public function setBody($body) | ||
{ | ||
if (isset($body) !== true) { | ||
return $this; | ||
} | ||
|
||
$this->body = $body; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @throws \Elasticsearch\Common\Exceptions\RuntimeException | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
if (isset($this->id) !== true) { | ||
throw new Exceptions\RuntimeException( | ||
'id is required for PutPipeline' | ||
); | ||
} | ||
$id = $this->id; | ||
$uri = "/_ingest/pipeline/$id"; | ||
|
||
return $uri; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'master_timeout', | ||
'timeout' | ||
); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'PUT'; | ||
} | ||
} |
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,65 @@ | ||
<?php | ||
|
||
namespace Elasticsearch\Endpoints\Ingest; | ||
|
||
use Elasticsearch\Common\Exceptions; | ||
use Elasticsearch\Endpoints\AbstractEndpoint; | ||
|
||
/** | ||
* Class Simulate | ||
* | ||
* @category Elasticsearch | ||
* @package Elasticsearch\Endpoints\Ingest | ||
* @author Zachary Tong <zachary.tong@elasticsearch.com> | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache2 | ||
* @link http://elasticsearch.org | ||
*/ | ||
class Simulate extends AbstractEndpoint | ||
{ | ||
/** | ||
* @param array $body | ||
* | ||
* @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException | ||
* @return $this | ||
*/ | ||
public function setBody($body) | ||
{ | ||
if (isset($body) !== true) { | ||
return $this; | ||
} | ||
|
||
$this->body = $body; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @throws \Elasticsearch\Common\Exceptions\RuntimeException | ||
* @return string | ||
*/ | ||
protected function getURI() | ||
{ | ||
if (isset($this->id) === true) { | ||
return "/_ingest/pipeline/{$this->id}/_simulate"; | ||
} | ||
return "/_ingest/pipeline/_simulate"; | ||
} | ||
|
||
/** | ||
* @return string[] | ||
*/ | ||
protected function getParamWhitelist() | ||
{ | ||
return array( | ||
'verbose', | ||
); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
protected function getMethod() | ||
{ | ||
return 'GET'; | ||
} | ||
} |
Oops, something went wrong.