Cluster Deployment elastic+kibana via RESTful API in one step?

I've created a cluster deployment with kibana.
Making that over UI it is done in saving one configuration, which is than "separated" into to two plans (under advanced configuration) for elastic and kibana.

I've created the same cluster via API, but haven't found a way to do that in one configuration step.

This is my current approach, but I would like to do that in one curl POST, so that the elasticsearch_cluster_id is automatically provided for the kibana plan.

Is that possible?

 curl -k -X POST -u admin:<secret> http://.../api/v1/clusters/elasticsearch -H 'content-type: application/json' -d @add-elastic.json

    add-elastic.json
    {
        "cluster_name" : "MYCluster-KIBANA",
        "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"
          }
        }
    }

==> REPLY from API

{
"elasticsearch_cluster_id": "00a416b0d9d743a787fcdf437215504c",
"credentials": {
"username": "elastic",
"password": "secret"
}

curl -k -X POST -u admin:<secret> http://.../api/v1/clusters/kibana -H 'content-type: application/json' -d @add-kibana.json

add-kibana.json

{
 "elasticsearch_cluster_id": "00a416b0d9d743a787fcdf437215504c",
  "plan": {
   "kibana": {},
   "cluster_topology": [
    {
      "instance_configuration_id": "kibana",
      "zone_count": 1,
      "size": {
        "resource": "memory",
        "value": 1024
      }
    }
   ]
  }
}

Hey @apaulsen,

Thanks for sending this note. There is currently no API endpoint that will allow you to create an elasticsearch cluster and kibana instance in one request. We are working on supporting the use case you are describing and we'll update the public API reference section in our user guide once the new endpoint is available. Until that's available you will have to send two separate request as described in your example.

Correction - you can create an ES cluster + Kib instance set in a single API call - in the standard create call , there is a kibana field in the top level model

The thing you can't do that Roy was alluding to is reconfigure ES and Kibana with a single call - you'll need to make separate /clusters/elasticsearch/{id}/... and /clusters/kibana/{id}/... calls with the ES and Kibana ids. There will soon be a new set of APIs making creating and configuring the different services in the Elastic stack easier and more logical.

Alex

Sounds easy enough, but I'am a beginner.
I'can't figure out, where to put in the "kibana block"

I've tried this

{
    "cluster_name" : "MYCluster-KIBANA",
    "plan" : {
        "elasticsearch" : {
        "version" : "6.6.0"
        },
        "cluster_topology" : [
          {
            ...
          }				
        ],
       "kibana": {},
       "cluster_topology": [
         {
      	  ...
         }
       ]
    }
}

and got the following error message

  "errors": [{
    "code": "root.unexpected_error",
    "message": "There was an internal server error.",
    "sub_code": "IAEDTSC52DTSCDETC152TSCFEC125",
    "uuid": "e5b157a4ffac14831a3523dbcfc2f36c"
  }]

Sorry, I was too quick to respond having the new endpoint in mind. The links provided by @Alex_Piggott can help but here is an example of a simple payload you can use to create an elasticsearch cluster with kibana enabled in one request:

POST /api/v1/clusters/elasticsearch

{
   "cluster_name" : "test",
   "plan" : {
   		"elasticsearch" : {
        	"version" : "7.0.1"
            },
      "cluster_topology" : [
        { 
            "memory_per_node" : 1024,
            "node_count_per_zone" : 1,
            "node_type" : {
               "data" : true,
               "ingest" : true,
               "master" : true,
               "ml" : true
            },
            "zone_count" : 1
         }
      ]
   },
      "kibana" : {
      "cluster_name" : "test",
      "plan" : {
         "cluster_topology" : [
            {
               "instance_configuration_id" : "kibana",
               "memory_per_node" : 1024,
               "node_count_per_zone" : 1,
               "zone_count" : 1
            }
         ],
         "kibana" : { 
         	"version" : "7.0.1" 
			}
      }
   }
}

Hope this helps.

Works! Thank you!

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