Shutdown.php 899 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Elasticsearch\Endpoints\Cluster\Nodes;
  3. /**
  4. * Class Shutdown
  5. *
  6. * @category Elasticsearch
  7. * @package Elasticsearch\Endpoints\Cluster\Nodes
  8. * @author Zachary Tong <zach@elastic.co>
  9. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  10. * @link http://elastic.co
  11. */
  12. class Shutdown extends AbstractNodesEndpoint
  13. {
  14. /**
  15. * @return string
  16. */
  17. public function getURI()
  18. {
  19. $node_id = $this->nodeID;
  20. $uri = "/_shutdown";
  21. if (isset($node_id) === true) {
  22. $uri = "/_cluster/nodes/$node_id/_shutdown";
  23. }
  24. return $uri;
  25. }
  26. /**
  27. * @return string[]
  28. */
  29. public function getParamWhitelist()
  30. {
  31. return array(
  32. 'delay',
  33. 'exit',
  34. );
  35. }
  36. /**
  37. * @return string
  38. */
  39. public function getMethod()
  40. {
  41. return 'POST';
  42. }
  43. }