Compose for ElasticSearch 101

Compose is for database management and provisioning in which also gives a dashboard for monitoring database instances.

Compose is a part of IBM and supports the IBM Cloud platform.

Compose on IBM Cloud offers a variety of supported databases with the sole goal of assisting developers to focus on creating rather than focusing on worrying about database backends.

Today we will do a walkthrough of Compose for ElasticSearch.

You will need an account on IBM Cloud platform first.

Next step is creating the service on IBM Cloud by going into the catalog of services and finding ‘Compose for ElasticSearch’ in the Data and Analytics portion of the platform’s catalog of services.

IBM Cloud Catalog

Create a service of Compose for ElasticSearch on IBM Cloud. You will be directed to create an account on Compose from here.

Compose account made, then deploy ElasticSearch

So now you can go down two roads from here. Administrate via the Compose account with the couple of commands as shown in this tutorial, here, done by Dj Walker-Morgan.

Or go with my tutorial as adapted from here by Dj Walker-Morgan, and use the list of available API calls I link to below in the title ‘Available API Calls List’.

Platform API Keys

Now you are going to need to fetch your platform API keys.

So would you rather use API keys or would you rather put your username and password down in a program or script? API keys, so we can use these for various services on the platform.

Click on ‘Platform API Keys’ under Manage in your navbar

Click on the “Create +” on the right hand side of the page.

Provide a name to your API keys

Download this API Key in a respect you prefer.

Now we can focus on Compose for ElasticSearch again.

Open up the landing page for the service instance in your Dashboard console of IBM Cloud.

Now its time to gather credentials to being able to use the API.

Compose Credentials

Scroll down until you see something titled on this page called “Instance Administration API” under the Connection Strings section.

Taken from docs, these are not my creds.

Available API Calls List

Okay you are set up now for Compose API calls. Through the Compose documentation there are a number of commands supported, detailed here at the bottom of the page titled “Available API calls”.

Command Line Setup

You are going to have to install the IBM Cloud command line interface for this part of doing a command with cURL.


cURL is used to transfer data through various protocols like HTTP here, as a command line tool. It comes with some operating systems, like I don’t think I have ever seen a Linux distro I have used without it (Debian you have to install just about everything so, yes. Windows, yes. I think UNIX too).

The link to this looks shady but allow me to assure you, everyone in the world has ran that through VirusTotal repeatedly.


The installers are right here, bx installation.

Here are the commands for this CLI for logging into IBM Cloud.

Watch which region your API endpoint is:

US South and US East bx login -a
Sydney and AP North bx login -a
Germany bx login -a
United Kingdom bx login -a

We will do an API call for GET deployments. Remember your region, if you are not in US-South for your region (as listed above) your endpoint will be different than my command.

curl -s -X GET -H 'authorization: Bearer 'platform_apiKey -H 'content-type: application/json'

The result should be…

bash-3.2# curl -s -X GET -H 'authorization: Bearer 'Platform_API_Key -H 'content-type: application/json'
{"id":"XXXXXXXXX","account_id":"XXXXXXXXXXXX","name":"xxxxxxxxxx","type":"elastic_search","created_at":"2017-12-01T21:19:09.834Z","notes":"","customer_billing_code":"","cluster_id":"XXXXXXXX","ca_certificate_base64":"XXXXXXXX","connection_strings":{"direct":["",""],"cli":[],"maps":[],"misc":{"direct_kibana":[]},"ssh":[],"health":["curl -u admin:XXXXXXXXX ''","curl -u admin:XXXXXXXX ''"],"admin":[]},"version":"2.4.6"}bash-3bash-3.2#
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.