update-desired-nodes.asciidoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. [[update-desired-nodes]]
  2. === Create or update desired nodes API
  3. ++++
  4. <titleabbrev>Create or update desired nodes</titleabbrev>
  5. ++++
  6. NOTE: {cloud-only}
  7. Creates or updates the desired nodes.
  8. [[update-desired-nodes-request]]
  9. ==== {api-request-title}
  10. [source,console]
  11. --------------------------------------------------
  12. PUT /_internal/desired_nodes/<history_id>/<version>
  13. {
  14. "nodes" : [
  15. {
  16. "settings" : {
  17. "node.name" : "instance-000187",
  18. "node.external_id": "instance-000187",
  19. "node.roles" : ["data_hot", "master"],
  20. "node.attr.data" : "hot",
  21. "node.attr.logical_availability_zone" : "zone-0"
  22. },
  23. "processors" : 8,
  24. "memory" : "58gb",
  25. "storage" : "1700gb",
  26. "node_version" : "{version}"
  27. }
  28. ]
  29. }
  30. --------------------------------------------------
  31. // TEST[s/<history_id>/test/]
  32. // TEST[s/<version>/1/]
  33. //////////////////////////
  34. [source,console]
  35. --------------------------------------------------
  36. DELETE /_internal/desired_nodes
  37. --------------------------------------------------
  38. // TEST[continued]
  39. //////////////////////////
  40. [[update-desired-nodes-query-params]]
  41. ==== {api-query-parms-title}
  42. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  43. [[update-desired-nodes-desc]]
  44. ==== {api-description-title}
  45. This API creates or update the desired nodes. External orchestrators can use
  46. this API to let Elasticsearch know about the cluster topology, including future
  47. changes such as adding or removing nodes. Using this information, the system is
  48. able to take better decisions.
  49. [[update-desired-nodes-examples]]
  50. ==== {api-examples-title}
  51. In this example, a new version for the desired nodes with history `Ywkh3INLQcuPT49f6kcppA` is created.
  52. This API only accepts monotonically increasing versions.
  53. [source,console]
  54. --------------------------------------------------
  55. PUT /_internal/desired_nodes/Ywkh3INLQcuPT49f6kcppA/100
  56. {
  57. "nodes" : [
  58. {
  59. "settings" : {
  60. "node.name" : "instance-000187",
  61. "node.external_id": "instance-000187",
  62. "node.roles" : ["data_hot", "master"],
  63. "node.attr.data" : "hot",
  64. "node.attr.logical_availability_zone" : "zone-0"
  65. },
  66. "processors" : 8,
  67. "memory" : "58gb",
  68. "storage" : "1700gb",
  69. "node_version" : "{version}"
  70. }
  71. ]
  72. }
  73. --------------------------------------------------
  74. // TEST
  75. The API returns the following result:
  76. [source,console-result]
  77. --------------------------------------------------
  78. {
  79. "replaced_existing_history_id": false
  80. }
  81. --------------------------------------------------
  82. //////////////////////////
  83. [source,console]
  84. --------------------------------------------------
  85. DELETE /_internal/desired_nodes
  86. --------------------------------------------------
  87. // TEST[continued]
  88. //////////////////////////