Indices.php 1.0 KB

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