Segments.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * User: zach
  4. * Date: 01/12/2015
  5. * Time: 14:34:49 pm
  6. */
  7. namespace Elasticsearch\Endpoints\Cat;
  8. use Elasticsearch\Endpoints\AbstractEndpoint;
  9. use Elasticsearch\Common\Exceptions;
  10. /**
  11. * Class Segments
  12. *
  13. * @category Elasticsearch
  14. * @package Elasticsearch\Endpoints\Cat
  15. * @author Zachary Tong <zach@elastic.co>
  16. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  17. * @link http://elastic.co
  18. */
  19. class Segments extends AbstractEndpoint
  20. {
  21. /**
  22. * @return string
  23. */
  24. public function getURI()
  25. {
  26. $index = $this->index;
  27. $uri = "/_cat/segments";
  28. if (isset($index) === true) {
  29. $uri = "/_cat/segments/$index";
  30. }
  31. return $uri;
  32. }
  33. /**
  34. * @return string[]
  35. */
  36. public function getParamWhitelist()
  37. {
  38. return array(
  39. 'h',
  40. 'help',
  41. 'v',
  42. 's',
  43. 'format',
  44. );
  45. }
  46. /**
  47. * @return string
  48. */
  49. public function getMethod()
  50. {
  51. return 'GET';
  52. }
  53. }