Delete.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace Elasticsearch\Endpoints\Ingest\Pipeline;
  3. use Elasticsearch\Common\Exceptions;
  4. use Elasticsearch\Endpoints\AbstractEndpoint;
  5. /**
  6. * Class Delete
  7. *
  8. * @category Elasticsearch
  9. * @package Elasticsearch\Endpoints\Ingest
  10. * @author Zachary Tong <zach@elastic.co>
  11. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  12. * @link http://elastic.co
  13. */
  14. class Delete extends AbstractEndpoint
  15. {
  16. /**
  17. * @throws \Elasticsearch\Common\Exceptions\RuntimeException
  18. * @return string
  19. */
  20. public function getURI()
  21. {
  22. if (isset($this->id) !== true) {
  23. throw new Exceptions\RuntimeException(
  24. 'id is required for DeletePipeline'
  25. );
  26. }
  27. $id = $this->id;
  28. $uri = "/_ingest/pipeline/$id";
  29. return $uri;
  30. }
  31. /**
  32. * @return string[]
  33. */
  34. public function getParamWhitelist()
  35. {
  36. return array(
  37. 'master_timeout',
  38. 'timeout'
  39. );
  40. }
  41. /**
  42. * @return string
  43. */
  44. public function getMethod()
  45. {
  46. return 'DELETE';
  47. }
  48. }