Looking for an example of template based cluster deployment via REST API

Sorry - this is a double to my topic under category "Elasticsearch". Correctly it should be placed here - unter "Elastic Cloud Enterprise". i use an on prem installation of ECE.

I've created a custom Deployment template based on a custom Instance configuration.
If I deploy a new cluster via UI it works.

How can I create a new cluster based on my custom template vis REST API?

I can't find a working example for template based deployment in REST API Reference.

Here is what I tried so far:

**Variant 1: doesn't work **

(My hope was, that all cluster toplogy info would be taken from template.)

curl -k -X POST -u admin ... clusters/elasticsearch -H 'content-type: application/json' -d '{
"cluster_name" : "MyCluster",
"plan" : {
"elasticsearch" : {
"version" : "6.6.0"
},
"deployment_template": {
"id": "c7159de3c438493b9925474390a8a6a0"
}
}
}'

Variant 2: Creates a Cluster, but doesn't use my template

curl -k -X POST -u admin ... clusters/elasticsearch -H 'content-type: application/json' -d '{
"cluster_name" : "MyCluster",
"plan" : {
"elasticsearch" : {
"version" : "6.6.0"
},
"cluster_topology" : [
{
"memory_per_node" : 2048,
"node_count_per_zone" : 1,
"node_type" : {
"data" : true,
"ingest" : true,
"master" : true
},
"zone_count" : 1
}
],
"deployment_template": {
"id": "c7159de3c438493b9925474390a8a6a0"
}
}
}'

The template id is correct.

TIA,
Agnes

Currently the deployment template id is only used by the UI to display the right visual elements

So your variant 2 is correct (and the benefit of using the template is to ensure that you can subsequently edit it via the UI)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.