Clusters - Elasticsearch - Commands

Search clusters

Retrieves the information for all of the Elasticsearch clusters that match the specified query.

Request

POST /api/v1/clusters/elasticsearch/_search

Request body

(SearchRequest) (Optional) The search request to execute. NOTE: When not specified, all of the clusters are matched.

Responses

200
(ElasticsearchClustersInfo) A list of Elasticsearch clusters that matched the given search query.
400
(BasicFailedReply) The search request failed.
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/_search \
-u $CLOUD_USER:$CLOUD_KEY \
-H 'Content-Type: application/json' \
-d '
{
   "from" : 0,
   "query" : {
      "bool" : {
         "filter" : [
            null
         ],
         "minimum_should_match" : 0,
         "must" : [
            null
         ],
         "must_not" : [
            null
         ],
         "should" : [
            null
         ]
      },
      "exists" : {
         "field" : "string"
      },
      "match" : {
         "some_property" : {
            "analyzer" : "string",
            "minimum_should_match" : 0,
            "operator" : "string",
            "query" : "string"
         }
      },
      "match_all" : {},
      "match_none" : {},
      "nested" : {
         "path" : "string",
         "query" : null,
         "score_mode" : "string"
      },
      "prefix" : {
         "some_property" : {
            "boost" : 0.1,
            "value" : "string"
         }
      },
      "query_string" : {
         "allow_leading_wildcard" : true,
         "analyzer" : "string",
         "default_field" : "string",
         "default_operator" : "string",
         "query" : "string"
      },
      "range" : {
         "some_property" : {
            "boost" : 0.1,
            "format" : "string",
            "gt" : {},
            "gte" : {},
            "lt" : {},
            "lte" : {},
            "time_zone" : "string"
         }
      },
      "term" : {
         "some_property" : {
            "value" : {}
         }
      }
   },
   "size" : 0,
   "sort" : [
      "string"
   ]
}
'

Restart cluster

Restarts the Elasticsearch cluster. When you restart an active cluster, the existing plan is used and a cluster_reboot is applied. A cluster_reboot issues an Elasticsearch restart command, then waits for the command to complete. When you restart an inactive cluster, the most recent successful plan is applied.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/_restart

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

cancel_pending

boolean; default: false

N

When true, cancels the pending plans, then restarts the cluster.

group_attribute

string; default: "__zone_\_"

N

Specifies the properties that divide the instances into groups.To restart all of the instances, use \_\_all\_\.To restart the instances by logical zone, use \_\_zone\_\.To restart one instance at a time, use \_\_name\_\, or use a comma-separated list of instance attributes.

restore_snapshot

boolean; default: true

N

When true and restoring from a shutdown, restores the cluster from the last available snapshot.

shard_init_wait_time

integer as int64; default: 600

N

The time, in seconds, to wait for shards that show no progress of initializing, before rolling the next group (default: 10 minutes)

skip_snapshot

boolean; default: true

N

When true, captures a snapshot, then restarts the cluster.

Responses

202
(ClusterCommandResponse) The stop command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
400
(BasicFailedReply) The cluster specified by {cluster_id} is unable to restart (code: 'clusters.restart.failed')
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: 'clusters.cluster_not_found')
412
(BasicFailedReply) The command sent to a cluster found the cluster in an illegal state, the error message gives more details (code: 'clusters.cluster_plan_state_error')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/_restart \
-u $CLOUD_USER:$CLOUD_KEY

Resynchronize cluster

Immediately synchronizes the Elasticsearch cluster information in the back-end search index and caches.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/_resync

Path parameters

Name Type Required Description

cluster_id

string

Y

Elasticsearch cluster identifier

Responses

200
(EmptyResponse) The cluster resync operation executed successfully
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
500
(BasicFailedReply) The cluster resync operation failed for cluster {cluster_id} (code: 'clusters.resync_failed')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/_resync \
-u $CLOUD_USER:$CLOUD_KEY

Shut down cluster

Shuts down the active Elasticsearch cluster and removes all of the cluster nodes. The cluster plan is retained. WARNING: To avoid data loss, save the data outside of the cluster before you shut the cluster down.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/_shutdown

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

hide

boolean; default: false

N

Hides the clusters during shutdown. NOTE: By default, hidden clusters are not listed.

skip_snapshot

boolean; default: false

N

When true, skips the snapshot when the cluster is shut down.

Responses

202
(ClusterCommandResponse) The shutdown command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: 'clusters.cluster_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/_shutdown \
-u $CLOUD_USER:$CLOUD_KEY

Take snapshot

To create a snapshot of the specified Elasticsearch cluster, uses the configured snapshot repository.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/_snapshot

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Request body

(ClusterSnapshotRequest) Overrides default settings for the snapshot

Responses

202
(ClusterSnapshotResponse) The create snapshot command was issued successfully
401
(BasicFailedReply) The supplied credentials for the snapshot repository are invalid (code: 'clusters.snapshot.invalid_credentials')
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found, or the snapshot repository was not found (code: 'clusters.cluster_not_found', 'clusters.snapshot.repository_not_found')
409
(BasicFailedReply) The cluster name specified is already in use (code: 'clusters.snapshot.invalid_name')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
500
(BasicFailedReply) The snapshot request failed (code: 'clusters.snapshot.failed', clusters.endpoint_not_found)
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/_snapshot \
-u $CLOUD_USER:$CLOUD_KEY \
-H 'Content-Type: application/json' \
-d '
{
   "name" : "string",
   "password" : "string",
   "repository_name" : "string",
   "username" : "string"
}
'

Move instances (advanced)

Moves one or more instances in the Elasticsearch cluster. The custom configuration settings are posted in the body.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/_move

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

force_update

boolean; default: false

N

When true, cancels and overwrites the pending plans, or treats the instance as an error.

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

instances_down

boolean; default: false

N

When true, the instances specified by instance_ids permanently shut down for data migration logic.

move_only

boolean; default: false

N

When true, moves the specified instances and ignores the changes for the cluster state.

validate_only

boolean; default: false

N

When true, validates the move request, then returns the calculated plan without applying the plan.

Request body

(TransientElasticsearchPlanConfiguration) (required) Overrides defaults for the move, including setting the configuration of instances specified in the path

Responses

202
(ClusterCommandResponse) The move command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
400
(BasicFailedReply) The cluster definition contained errors (code: 'clusters.cluster_invalid_plan' and 'clusters.plan_feature_not_implemented')
403
(BasicFailedReply) The move command was prohibited for the given cluster.
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/_move \
-u $CLOUD_USER:$CLOUD_KEY \
-H 'Content-Type: application/json' \
-d '
{
   "cluster_settings_json" : {},
   "plan_configuration" : {
      "calm_wait_time" : 0,
      "cluster_reboot" : "string",
      "extended_maintenance" : true,
      "max_snapshot_age" : 0,
      "max_snapshot_attempts" : 0,
      "move_allocators" : [
         {
            "allocator_down" : true,
            "from" : "string",
            "to" : [
               "string"
            ]
         }
      ],
      "move_instances" : [
         {
            "from" : "string",
            "instance_down" : true,
            "to" : [
               "string"
            ]
         }
      ],
      "move_only" : true,
      "override_failsafe" : true,
      "preferred_allocators" : [
         "string"
      ],
      "reallocate_instances" : true,
      "skip_data_migration" : true,
      "skip_post_upgrade_steps" : true,
      "skip_snapshot" : true,
      "skip_upgrade_checker" : true,
      "timeout" : 0
   },
   "restore_snapshot" : {
      "repository_config" : {
         "raw_settings" : {}
      },
      "repository_name" : "string",
      "restore_payload" : {
         "indices" : [
            "string"
         ],
         "raw_settings" : {}
      },
      "snapshot_name" : "string",
      "source_cluster_id" : "string",
      "strategy" : "string"
   },
   "strategy" : {
      "grow_and_shrink" : {},
      "rolling" : {
         "allow_inline_resize" : true,
         "group_by" : "string",
         "shard_init_wait_time" : 0,
         "skip_synced_flush" : true
      },
      "rolling_grow_and_shrink" : {}
   }
}
'

Start all instances

Starts all of the instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/_start

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The start command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The start command was prohibited for the given cluster
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop all instances

Stops all of the instances in the Elasticsearch cluster..

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/_stop

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The stop command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The stop command was prohibited for the given cluster.
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/_stop \
-u $CLOUD_USER:$CLOUD_KEY

Start maintenance mode all instances

Starts maintenance mode on all of the instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/maintenance-mode/_start

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The start maintenance mode command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The start maintenance mode command was prohibited for the given cluster.
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/maintenance-mode/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop maintenance mode all instances

Stops maintenance mode on all of the instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/maintenance-mode/_stop

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The stop maintenance mode command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The stop maintenance mode command was prohibited for the given cluster.
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/maintenance-mode/_stop \
-u $CLOUD_USER:$CLOUD_KEY

Move instances

Moves one or more instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/_move

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

Query parameters

Name Type Required Description

force_update

boolean; default: false

N

When true, cancels and overwrites the pending plans, or treats the instance as an error.

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

instances_down

boolean; default: false

N

When true, the instances specified by instance_ids permanently shut down for data migration logic.

validate_only

boolean; default: false

N

When true, validates the move request, then returns the calculated plan without applying the plan.

Request body

(TransientElasticsearchPlanConfiguration) Overrides defaults for the move, including setting the configuration of instances specified in the path

Responses

202
(ClusterCommandResponse) The move command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
400
(BasicFailedReply) The cluster definition contained errors (code: 'clusters.cluster_invalid_plan' and 'clusters.plan_feature_not_implemented')
403
(BasicFailedReply) The move command was prohibited for the given cluster
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/_move \
-u $CLOUD_USER:$CLOUD_KEY \
-H 'Content-Type: application/json' \
-d '
{
   "cluster_settings_json" : {},
   "plan_configuration" : {
      "calm_wait_time" : 0,
      "cluster_reboot" : "string",
      "extended_maintenance" : true,
      "max_snapshot_age" : 0,
      "max_snapshot_attempts" : 0,
      "move_allocators" : [
         {
            "allocator_down" : true,
            "from" : "string",
            "to" : [
               "string"
            ]
         }
      ],
      "move_instances" : [
         {
            "from" : "string",
            "instance_down" : true,
            "to" : [
               "string"
            ]
         }
      ],
      "move_only" : true,
      "override_failsafe" : true,
      "preferred_allocators" : [
         "string"
      ],
      "reallocate_instances" : true,
      "skip_data_migration" : true,
      "skip_post_upgrade_steps" : true,
      "skip_snapshot" : true,
      "skip_upgrade_checker" : true,
      "timeout" : 0
   },
   "restore_snapshot" : {
      "repository_config" : {
         "raw_settings" : {}
      },
      "repository_name" : "string",
      "restore_payload" : {
         "indices" : [
            "string"
         ],
         "raw_settings" : {}
      },
      "snapshot_name" : "string",
      "source_cluster_id" : "string",
      "strategy" : "string"
   },
   "strategy" : {
      "grow_and_shrink" : {},
      "rolling" : {
         "allow_inline_resize" : true,
         "group_by" : "string",
         "shard_init_wait_time" : 0,
         "skip_synced_flush" : true
      },
      "rolling_grow_and_shrink" : {}
   }
}
'

Start instances

Starts the instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/_start

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The start command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The start command was prohibited for the given cluster
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop instances

Stops the instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/_stop

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The stop command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The stop command was prohibited for the given cluster
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/_stop \
-u $CLOUD_USER:$CLOUD_KEY

Start maintenance mode

Starts maintenance mode on the specified instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/maintenance-mode/_start

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The start maintenance mode command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The start maintenance mode command was prohibited for the given cluster
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/maintenance-mode/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop maintenance mode

Stops maintenance mode on the specified instances in the Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/maintenance-mode/_stop

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

When true and the instance does not exist, proceeds to the next instance, or treats the instance as an error.

Responses

202
(ClusterCommandResponse) The stop maintenance mode command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress
403
(BasicFailedReply) The stop maintenance mode command was prohibited for the given cluster
404
(BasicFailedReply) One or more of the instances specified at {instance_ids} could not be found (code: 'clusters.instances_not_found')
449
(BasicFailedReply) elevated permissions are required. (code: '"root.unauthorized.rbac.elevated_permissions_required"')
Warning

To perform this operation, you must be authenticated by means of one of the following methods: apiKey, basicAuth.

Request example

curl -XPOST {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id}/instances/{instance_ids}/maintenance-mode/_stop \
-u $CLOUD_USER:$CLOUD_KEY