Get.php 980 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace Elasticsearch\Endpoints\Ingest\Pipeline;
  3. use Elasticsearch\Common\Exceptions;
  4. use Elasticsearch\Endpoints\AbstractEndpoint;
  5. /**
  6. * Class Get
  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 Get 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. return '/_ingest/pipeline/*';
  24. }
  25. $id = $this->id;
  26. return "/_ingest/pipeline/$id";
  27. }
  28. /**
  29. * @return string[]
  30. */
  31. public function getParamWhitelist()
  32. {
  33. return array(
  34. 'master_timeout'
  35. );
  36. }
  37. /**
  38. * @return string
  39. */
  40. public function getMethod()
  41. {
  42. return 'GET';
  43. }
  44. }