Count.php 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace Elasticsearch\Endpoints\Cat;
  3. use Elasticsearch\Endpoints\AbstractEndpoint;
  4. /**
  5. * Class Count
  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 Count extends AbstractEndpoint
  14. {
  15. /**
  16. * @return string
  17. */
  18. public function getURI()
  19. {
  20. $index = $this->index;
  21. $uri = "/_cat/count";
  22. if (isset($index) === true) {
  23. $uri = "/_cat/count/$index";
  24. }
  25. return $uri;
  26. }
  27. /**
  28. * @return string[]
  29. */
  30. public function getParamWhitelist()
  31. {
  32. return array(
  33. 'local',
  34. 'master_timeout',
  35. 'h',
  36. 'help',
  37. 'v',
  38. 's',
  39. 'format',
  40. );
  41. }
  42. /**
  43. * @return string
  44. */
  45. public function getMethod()
  46. {
  47. return 'GET';
  48. }
  49. }