Aliases.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace Elasticsearch\Endpoints\Cat;
  3. use Elasticsearch\Endpoints\AbstractEndpoint;
  4. /**
  5. * Class Aliases
  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 Aliases extends AbstractEndpoint
  14. {
  15. // A comma-separated list of alias names to return
  16. private $name;
  17. /**
  18. * @param $name
  19. *
  20. * @return $this
  21. */
  22. public function setName($name)
  23. {
  24. if (isset($name) !== true) {
  25. return $this;
  26. }
  27. $this->name = $name;
  28. return $this;
  29. }
  30. /**
  31. * @return string
  32. */
  33. public function getURI()
  34. {
  35. $name = $this->name;
  36. $uri = "/_cat/aliases";
  37. if (isset($name) === true) {
  38. $uri = "/_cat/aliases/$name";
  39. }
  40. return $uri;
  41. }
  42. /**
  43. * @return string[]
  44. */
  45. public function getParamWhitelist()
  46. {
  47. return array(
  48. 'local',
  49. 'master_timeout',
  50. 'h',
  51. 'help',
  52. 'v',
  53. 'format',
  54. 's',
  55. 'format',
  56. );
  57. }
  58. /**
  59. * @return string
  60. */
  61. public function getMethod()
  62. {
  63. return 'GET';
  64. }
  65. }