mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
This commit adds support for CPU ranges in the desired nodes API. This aligns better with environments where administrators/orchestrators can define lower and upper bounds for the amount of CPUs that the desired node would get once deployed. This allows to provide information about the expected CPU and possible allowed overcommit that the desired node will run on. This was the previous expected body for the desired nodes API (we still support it): ``` PUT /_internal/desired_nodes/history/1 { "nodes" : [ { "settings" : { "node.name" : "instance-000187", "node.external_id": "instance-000187", "node.roles" : ["data_hot", "master"], "node.attr.data" : "hot", "node.attr.logical_availability_zone" : "zone-0" }, "processors" : 8, "memory" : "58gb", "storage" : "1700gb", "node_version" : "8.3.0" } ] } ``` Now it's possible to define `processors` or `processors_range` as in: ``` PUT /_internal/desired_nodes/history/1 { "nodes" : [ { "settings" : { "node.name" : "instance-000187", "node.external_id": "instance-000187", "node.roles" : ["data_hot", "master"], "node.attr.data" : "hot", "node.attr.logical_availability_zone" : "zone-0" }, "processors_range" : {"min": 8.0, "max": 16.0}, "memory" : "58gb", "storage" : "1700gb", "node_version" : "8.3.0" } ] } ``` Note that `max` in `processors_range` is optional. This commit also moves from representing CPUs as integers to accept floating point numbers. Note: I disabled the bwc yamlRestTests for versions < 8.3 since we introduced a few "breaking changes" but since this is an internal API it should be fine.
59 lines
1.4 KiB
Text
59 lines
1.4 KiB
Text
[[delete-desired-nodes]]
|
|
=== Delete desired nodes API
|
|
++++
|
|
<titleabbrev>Delete desired nodes</titleabbrev>
|
|
++++
|
|
|
|
NOTE: {cloud-only}
|
|
|
|
Delete desired nodes.
|
|
|
|
[[delete-desired-nodes-request]]
|
|
==== {api-request-title}
|
|
|
|
//////////////////////////
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_internal/desired_nodes/history/1
|
|
{
|
|
"nodes" : [
|
|
{
|
|
"settings" : {
|
|
"node.name" : "instance-000187",
|
|
"node.external_id": "instance-000187",
|
|
"node.roles" : ["data_hot", "master"],
|
|
"node.attr.data" : "hot",
|
|
"node.attr.logical_availability_zone" : "zone-0"
|
|
},
|
|
"processors" : 8.0,
|
|
"memory" : "58gb",
|
|
"storage" : "2tb",
|
|
"node_version" : "{version}"
|
|
}
|
|
]
|
|
}
|
|
--------------------------------------------------
|
|
// TESTSETUP
|
|
//////////////////////////
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
DELETE /_internal/desired_nodes
|
|
--------------------------------------------------
|
|
// TEST
|
|
|
|
[[delete-desired-nodes-desc]]
|
|
==== {api-description-title}
|
|
|
|
This API deletes the desired nodes.
|
|
|
|
[[delete-desired-nodes-examples]]
|
|
==== {api-examples-title}
|
|
|
|
This example deletes the current desired nodes.
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
DELETE /_internal/desired_nodes
|
|
--------------------------------------------------
|
|
// TEST
|