A first API call: What deployments are there?

As a first API call, let’s use a GET request to retrieve information about existing deployments:

curl -k -X GET -H "Authorization: ApiKey $ECE_API_KEY" https://$COORDINATOR_HOST:12443/api/v1/deployments
{
  "deployments" : [
    {
      "id" : "05d846daf43545a2a58e418cacd02eef",
      "name" : "security-cluster",
      "resources" : [
        {
          "ref_id" : "elasticsearch",
          "id" : "05d846daf43545a2a58e418cacd02eef",
          "kind" : "elasticsearch",
          "region" : "ece-region",
          "cloud_id" : "security-cluster:MTkyLjE2OC...WVmJA=="
        }
      ]
    },
    {
      "id" : "8eb31cf464cc4b9cb5544226edc239b3",
      "name" : "logging-and-metrics",
      "resources" : [
        {
          "ref_id" : "elasticsearch",
          "id" : "8eb31cf464cc4b9cb5544226edc239b3",
          "kind" : "elasticsearch",
          "region" : "ece-region",
          "cloud_id" : "logging-and-metrics:MTkyLjE2OC40N...hY2Y3Y2My"
        },
        {
          "ref_id" : "kibana",
          "elasticsearch_cluster_ref_id" : "elasticsearch",
          "id" : "39984425c7824c79a7d45b263acf7cc2",
          "kind" : "kibana",
          "region" : "ece-region"
        }
      ]
    },
    {
      "id" : "a9311994df4046d5a6b84edfc5c49ff5",
      "name" : "admin-console-elasticsearch",
      "resources" : [
        {
          "ref_id" : "elasticsearch",
          "id" : "a9311994df4046d5a6b84edfc5c49ff5",
          "kind" : "elasticsearch",
          "region" : "ece-region",
          "cloud_id" : "admin-console-elasticsearch:MTkyLjE2OC...ZmY1JA=="
        }
      ]
    }
  ]
}

There are three deployments, security-cluster, logging-and-metrics, and admin-console-elasticsearch, which get created with every installation of Elastic Cloud Enterprise. Take care when modifying these deployments, as they are part of the control plane of ECE. To keep your installation safe, some operations are not allowed on these deployments, but we do recommend that you enable fault tolerance for their Elasticsearch resources and resize them.

In order to obtain more detail about a specific deployment, we can use a GET request using the deployment ID from the previous response:

curl -k -X GET -H "Authorization: ApiKey $ECE_API_KEY" https://$COORDINATOR_HOST:12443/api/v1/deployments/$DEPLOYMENT_ID
{
  "id": "a9311994df4046d5a6b84edfc5c49ff5",
  "name": "admin-console-elasticsearch",
  "healthy": true,
  "resources": {
    "elasticsearch": [
      {
        "ref_id": "elasticsearch",
        "id": "a9311994df4046d5a6b84edfc5c49ff5",
        "region": "ece-region",
        "info": {
          "cluster_id": "a9311994df4046d5a6b84edfc5c49ff5",
          "cluster_name": "admin-console-elasticsearch",
          "deployment_id": "a9311994df4046d5a6b84edfc5c49ff5",
          "healthy": true,
          "status": "started",
          "plan_info": {
            "healthy": true,
            ...
          },
          "topology": {
            ...
          }
        }
      }
    ]
  },
  "metadata": {
    "owner_id": "admin",
    "system_owned": true,
    "hidden": false,
    "last_modified": "2020-02-11T09:56:54.547Z"
  }
}

To simplify things, we’ve omitted some sections from the JSON output.

A note on terminology

If this is your first time using the ECE API, some of the terminology in the JSON output will likely be unfamiliar. For example, there is a reference to the term “plan” in output fields such as plan_info. A plan is just a resource configuration that gets applied to a resource, such as an Elasticsearch cluster or a Kibana instance. When you change an Elasticsearch cluster to resize it, for example, you are applying a new plan.

A deployment is a group of different resources such as Elasticsearch clusters, Kibana instances and other products of the Elastic Stack. In the previous example, the admin-console-elasticsearch deployment only had an Elasticsearch resource, and the logging-and-metrics deployment had both Elasticsearch and Kibana resources.