Elasticsearch Resources

Get a list of your active Elasticsearch instances

GET /elasticsearch/<instance_name>/

Response:

{
    "data": [
        {
            "api_key": "<api-key>",
            "caster": null,
            "connection_strings": {
                "public": {
                    "http": "http://iad1-10713-0.es.objectrocket.com:10713,http://iad1-10713-1.es.objectrocket.com:10713,http://iad1-10713-2.es.objectrocket.com:10713,http://iad1-10713-3.es.objectrocket.com:10713",
                    "https": "https://iad1-10713-0.es.objectrocket.com:20713,https://iad1-10713-1.es.objectrocket.com:20713,https://iad1-10713-2.es.objectrocket.com:20713,https://iad1-10713-3.es.objectrocket.com:20713",
                    "kibana_http": "http://iad1-10713-kibana.es.objectrocket.com:10713",
                    "kibana_https": "https://iad1-10713-kibana.es.objectrocket.com:20713",
                    "transport": "iad1-10713-0.es.objectrocket.com:40713,iad1-10713-1.es.objectrocket.com:40713,iad1-10713-2.es.objectrocket.com:40713,iad1-10713-3.es.objectrocket.com:40713"
                },
                "servicenet": {
                    "http": "http://iad1-sn-10713-0.es.objectrocket.com:10713,http://iad1-sn-10713-1.es.objectrocket.com:10713,http://iad1-sn-10713-2.es.objectrocket.com:10713,http://iad1-sn-10713-3.es.objectrocket.com:10713",
                    "https": "https://iad1-sn-10713-0.es.objectrocket.com:20713,https://iad1-sn-10713-1.es.objectrocket.com:20713,https://iad1-sn-10713-2.es.objectrocket.com:20713,https://iad1-sn-10713-3.es.objectrocket.com:20713",
                    "transport": "iad1-sn-10713-0.es.objectrocket.com:40713,iad1-sn-10713-1.es.objectrocket.com:40713,iad1-sn-10713-2.es.objectrocket.com:40713,iad1-sn-10713-3.es.objectrocket.com:40713"
                }
            },
            "created": "2017-02-10 22:58:54",
            "encrypted": false,
            "id": "<instance id>",
            "name": "foobar",
            "plan": 4,
            "service": "elasticsearch",
            "settings": {},
            "state": "COMPLETED",
            "type": "elasticsearch",
            "user": "<youruserid>",
            "version": "5.1.1",
            "zone": "US-East-IAD1"
        },
        {
            ...
        }
    ]
}

Response Field Map:

Field Usage
api_key Not used in Elasticsearch clusters
caster ID for customers in a dedicated casters environment
connection strings Elasticsearch API, Elasticsearch transport, and Kibana connection strings for Rackspace ServiceNet and public interfaces. All strings given in http and https (secure) options where applicable
created Date and time that the cluster was cerated
encrypted Whether this cluster has at-rest-encryption enabled
id unique instance id for each instance
name The instance name. Use this for <instance_name> in the other commands
plan The instance storage size from plan size (i.e. 4,8,16,32,64,128,256,512)
service Will always be “elasticsearch” for elasticsearch instances
settings settings for ACL sync are listed here
state Indicates the build state of the current instance (i.e. REQUESTED, STARTED, COMPLETED)
type Type of instance. Will always be “elasticsearch” for Elasticsearch instances
user your unique internal user id number
version Elasticsearch version on this cluster
zone The ObjectRocket datacenter that this instance is deployed in

Check the build status of an Elasticsearch cluster

GET /elasticsearch/<instance_name>/build

Response:

{
    "data": {
        "action": "create",
        "build_finish_date": 1487021778493,
        "build_start_date": 1487021330107,
        "encrypted": false,
        "id": "<instance id>",
        "login": "<login name>",
        "name": "new_instance",
        "phase": "INSTANCE_DEPLOYED",
        "plan": 4,
        "state": "COMPLETED",
        "updated_date": 1487021778493,
        "version": "5.1.1",
        "zone": "US-Dallas"
    }
}

Response Field Map:

Field Usage
action The action being performed on the instance
build_finish_date a timestamp for when build finished (in ms)
build_start_date a timestamp for when build started (in ms)
encrypted Whether this cluster has at-rest-encryption enabled
id unique instance id for each instance
login your login name for the ObjectRocket UI/API
name The instance name. Use this for <instance_name> in the other commands
phase Indicates the different phases of the build state
plan The instance storage size from plan size (i.e. 4,8,16,32,64,128,256,512)
state Indicates the build state of the current instance (i.e. REQUESTED, STARTED, COMPLETED)
updated_date a timestamp for the last time the instance state was updated (in ms)
version Elasticsearch version on this cluster
zone The ObjectRocket datacenter that this instance is deployed in

List users for the elasticsearch instance

GET /elasticsearch/<instance_name>/users/

Response:

{
    "data": [
        {
            "role": "kibana-only",
            "username": "foouser"
        },
        {
            "role": "readonly",
            "username": "baruser"
        }
    ]
}

Response Field Map:

:header-rows: 1 :stub-columns: 1 :class: compatibility
Field Usage
role The user’s role. Can be “admin”, “readonly”, or “kibana-only”
username the username of the user

Create a new user for the elasticsearch instance

POST /elasticsearch/<instance_name>/users/

Request Body:

{
  "username": "myuser",
  "password": "mytestp@ss",
  "role": "admin"
}

Request Field Map:

:header-rows: 1 :stub-columns: 1 :class: compatibility
Field Usage
username (Required) username of the new user
password (Required) password of the new user
role (Required) The user’s role. Can be “admin”, “readonly”, or “kibana-only”

Response:

{
    "data": {
        "role": "admin",
        "username": "myuser"
    }
}

Delete a user of the elasticsearch instance

DELETE /elasticsearch/<instance_name>/users/

Request Body:

{
  "username": "myuser"
}

Request Field Map:

:header-rows: 1 :stub-columns: 1 :class: compatibility
Field Usage
username (Required) username of the user to delete

Response:

{
    "data": {
        "username": "myuser"
    }
}

Add a data node to the Elasticsearch cluster

Note

Adding a data node will impact your monthly subscription fees. See The ObjectRocket pricing page for more details.

POST /elasticsearch/<instance_name>/data_nodes/

Request Body:

{
  "count": 1
}

Request Field Map:

:header-rows: 1 :stub-columns: 1 :class: compatibility
Field Usage
count number of data nodes to add

Response:

{
    "data": "58a20bb9ffbbf821544090f7"
}

Display index stats

You can use the ObjectRocket API to gather information from the Elasticsearch stats APIs. This call returns data similar to an index /_stats/ call in Elasticsearch

GET /elasticsearch/<instance_name>/indices/

Response:

{
    "data": {
        "_all": {
            "primaries": {
                "completion": {
                    "size_in_bytes": 0
                },
                "docs": {
                    "count": 1,
                    "deleted": 0
                },
                "fielddata": {
                    "evictions": 0,
                    "memory_size_in_bytes": 0
                },
                "flush": {
                    "total": 1,
                    "total_time_in_millis": 6
                },
                "get": {
                    "current": 0,
                    "exists_time_in_millis": 0,
                    "exists_total": 0,
                    "missing_time_in_millis": 0,
                    "missing_total": 0,
                    "time_in_millis": 0,
                    "total": 0
                },
                "indexing": {
                    "delete_current": 0,
                    "delete_time_in_millis": 0,
                    "delete_total": 0,
                    "index_current": 0,
                    "index_failed": 0,
                    "index_time_in_millis": 55,
                    "index_total": 1,
                    "is_throttled": false,
                    "noop_update_total": 0,
                    "throttle_time_in_millis": 0
                }
        ...
}