Get.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * User: zach
  4. * Date: 01/20/2014
  5. * Time: 14:34:49 pm
  6. */
  7. namespace Elasticsearch\Endpoints\Indices\Upgrade;
  8. use Elasticsearch\Endpoints\AbstractEndpoint;
  9. use Elasticsearch\Common\Exceptions;
  10. /**
  11. * Class Post
  12. *
  13. * @category Elasticsearch
  14. * @package Elasticsearch\Endpoints\Indices
  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 Get extends AbstractEndpoint
  20. {
  21. /**
  22. * @return string
  23. */
  24. public function getURI()
  25. {
  26. $index = $this->index;
  27. $uri = "/_upgrade";
  28. if (isset($index) === true) {
  29. $uri = "/$index/_upgrade";
  30. }
  31. return $uri;
  32. }
  33. /**
  34. * @return string[]
  35. */
  36. public function getParamWhitelist()
  37. {
  38. return array(
  39. 'wait_for_completion',
  40. 'only_ancient_segments',
  41. 'ignore_unavailable',
  42. 'allow_no_indices',
  43. 'expand_wildcards',
  44. );
  45. }
  46. /**
  47. * @return string
  48. */
  49. public function getMethod()
  50. {
  51. return 'GET';
  52. }
  53. }