Deployment - Commands

Search Deployments

Retrieves the information for all of the deployments that match the specified query.

Request

POST /api/v1/deployments/_search

Request body

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

Responses

200

(DeploymentsSearchResponse) The list of deployments that match the specified query and belong to the authenticated user.

Headers

x-cloud-resource-created (string)
The date-time when the resource was created (ISO format relative to UTC)
x-cloud-resource-last-modified (string)
The date-time when the resource was last modified (ISO format relative to UTC)
x-cloud-resource-version (string)
The resource version, which is used to avoid update conflicts with concurrent operations

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/_search \
-H "Authorization: ApiKey $EC_API_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" : [
      {}
   ]
}
'

Migrate Elasticsearch resource to use ILM

Migrates the specified Elasticsearch resource to use ILM.

Request

POST /api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_enable-ilm

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

Request body

(EnableIlmRequest) (required) Information to build the ILM policies that will be created

Responses

200

(DeploymentResourceCommandResponse) Standard response

404

(BasicFailedReply) The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_not_found])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) We have failed you. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_enable-ilm \
-H "Authorization: ApiKey $EC_API_KEY" \
-H 'Content-Type: application/json' \
-d '
{
   "index_patterns" : [
      {
         "index_pattern" : "string",
         "node_attributes" : {
            "some_property" : "string"
         },
         "policy_name" : "string"
      }
   ]
}
'

Migrate Elasticsearch resource to use SLM

Migrates the specified Elasticsearch resource to use SLM.

Request

POST /api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_enable-slm

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

Responses

200

(DeploymentResourceCommandResponse) Standard response

404

(BasicFailedReply) The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_not_found])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) We have failed you. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_enable-slm \
-H "Authorization: ApiKey $EC_API_KEY"

Reset elastic user password

Resets the password of the 'elastic' user.

Request

POST /api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_reset-password

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

Responses

200

(ElasticsearchElasticUserPasswordResetResponse) The password reset was out carried successfully

404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) Failed to reset the 'elastic' user's password. (code: deployments.elasticsearch.password_reset_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.elasticsearch.password_reset_error])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_reset-password \
-H "Authorization: ApiKey $EC_API_KEY"

Restart Deployment Elasticsearch Resource

Restarts an Elasticsearch Resource. If a Resource is active: this command re-applies the existing plan but applies a "cluster_reboot", which issues a restart command and waits for it to complete. If a Resource is inactive: this command starts it up with the most recent successful plan.

Request

POST /api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_restart

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

Query parameters

Name Type Required Description

cancel_pending

boolean; default: false

N

If true, cancels any pending plans before restarting. If false and there are pending plans, returns an error.

group_attribute

string; default: "__zone__"

N

Indicates the property or properties used to divide the list of instances to restart in groups. Valid options are: '__all__' (restart all at once), '__zone__' by logical zone, '__name__' one instance at a time, or a comma-separated list of attributes of the instances

restore_snapshot

boolean; default: true

N

When set to true and restoring from shutdown, then will restore the cluster from the last snapshot (if available).

shard_init_wait_time

integer; 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

If true, will not take a snapshot of the cluster before restarting.

Responses

202

(DeploymentResourceCommandResponse) The restart command was issued successfully.

404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found])
The error codes associated with the response
422

(BasicFailedReply) The command sent to a Resource found the Resource in an illegal state, the error message gives more details. (code: deployments.deployment_resource_plan_change_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_plan_change_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_restart \
-H "Authorization: ApiKey $EC_API_KEY"

Shutdown Deployment Elasticsearch Resource

Shutdown Elasticsearch Resource belonging to a given Deployment.

Request

POST /api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_shutdown

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

Query parameters

Name Type Required Description

hide

boolean

N

Hide cluster on shutdown. Hidden clusters are not listed by default. Only applicable for Platform administrators.

skip_snapshot

boolean; default: false

N

If true, will skip taking a snapshot of the cluster before shutting the cluster down (if even possible).

Responses

200

(DeploymentResourceCommandResponse) Standard response.

400

(BasicFailedReply) Parameter is restricted and can only be set by a Platform administrator. (code: deployments.restricted_parameter)

Headers

x-cloud-error-codes (string; allowed values: [deployments.restricted_parameter])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/_shutdown \
-H "Authorization: ApiKey $EC_API_KEY"

Start all instances

Starts all instances belonging to a Deployment Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/_start

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Responses

202

(DeploymentResourceCommandResponse) The start command was issued successfully.

403

(BasicFailedReply) The start maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/_start \
-H "Authorization: ApiKey $EC_API_KEY"

Stop all instances

Stops all instances belonging to a Deployment Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/_stop

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Responses

202

(DeploymentResourceCommandResponse) The stop command was issued successfully.

403

(BasicFailedReply) The stop maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/_stop \
-H "Authorization: ApiKey $EC_API_KEY"

Start maintenance mode (all instances)

Starts maintenance mode of all instances belonging to a Deployment Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/maintenance-mode/_start

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Responses

202

(DeploymentResourceCommandResponse) The start maintenance command was issued successfully.

403

(BasicFailedReply) The start maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/maintenance-mode/_start \
-H "Authorization: ApiKey $EC_API_KEY"

Stop maintenance mode (all instances)

Stops maintenance mode of all instances belonging to a Deployment Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/maintenance-mode/_stop

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Responses

202

(DeploymentResourceCommandResponse) The stop maintenance mode command was issued successfully.

403

(BasicFailedReply) The stop maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/maintenance-mode/_stop \
-H "Authorization: ApiKey $EC_API_KEY"

Start instances

Starts instances belonging to a Deployment Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/_start

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

If true and the instance does not exist then quietly proceed to the next instance, otherwise treated as an error

Responses

202

(DeploymentResourceCommandResponse) The start command was issued successfully.

403

(BasicFailedReply) The start maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/_start \
-H "Authorization: ApiKey $EC_API_KEY"

Stop instances

Stops instances belonging to a Deployment Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/_stop

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

If true and the instance does not exist then quietly proceed to the next instance, otherwise treated as an error.

Responses

202

(DeploymentResourceCommandResponse) The stop command was issued successfully.

403

(BasicFailedReply) The start maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/_stop \
-H "Authorization: ApiKey $EC_API_KEY"

Start maintenance mode

Starts maintenance mode of instances belonging to a Deployment Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/maintenance-mode/_start

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

If true and the instance does not exist then quietly proceed to the next instance, otherwise treated as an error.

Responses

202

(DeploymentResourceCommandResponse) The start maintenance command was issued successfully.

403

(BasicFailedReply) The start maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/maintenance-mode/_start \
-H "Authorization: ApiKey $EC_API_KEY"

Stop maintenance mode

Stops maintenance mode of instances belonging to a Resource.

Request

POST /api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/maintenance-mode/_stop

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

instance_ids

array[string]

Y

A comma-separated list of instance identifiers.

ref_id

string

Y

User-specified RefId for the Resource.

resource_kind

string

Y

The kind of resource (one of elasticsearch, kibana or apm).

Query parameters

Name Type Required Description

ignore_missing

boolean; default: false

N

If true and the instance does not exist then quietly proceed to the next instance, otherwise treated as an error.

Responses

202

(DeploymentResourceCommandResponse) The stop maintenance mode command was issued successfully.

403

(BasicFailedReply) The stop maintenance mode command was prohibited for the given Resource. (code: deployments.instance_update_prohibited_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.instance_update_prohibited_error])
The error codes associated with the response
404

(BasicFailedReply) * The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found) * The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found) * One or more instances of the given resource type are missing. (code: deployments.instances_missing_on_update_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_not_found, deployments.deployment_resource_not_found, deployments.instances_missing_on_update_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) A Resource that was previously stored no longer exists. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{resource_kind}/{ref_id}/instances/{instance_ids}/maintenance-mode/_stop \
-H "Authorization: ApiKey $EC_API_KEY"

Restart Deployment Stateless Resource

Restarts a Stateless Resource. If a Resource is active: this command re-applies the existing plan but applies a "cluster_reboot", which issues a restart command and waits for it to complete. If a Resource is inactive: this command starts it up with the most recent successful plan.

Request

POST /api/v1/deployments/{deployment_id}/{stateless_resource_kind}/{ref_id}/_restart

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

stateless_resource_kind

string; allowed values: [kibana, apm, appsearch, enterprise_search]

Y

The kind of stateless resource

Query parameters

Name Type Required Description

cancel_pending

boolean; default: false

N

If true, cancels any pending plans before restarting. If false and there are pending plans, returns an error.

Responses

202

(DeploymentResourceCommandResponse) The restart command was issued successfully

404

(BasicFailedReply) The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_not_found])
The error codes associated with the response
422

(BasicFailedReply) The command sent to a Resource found the Resource in an illegal state, the error message gives more details. (code: deployments.deployment_resource_plan_change_error)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_plan_change_error])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) We have failed you. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{stateless_resource_kind}/{ref_id}/_restart \
-H "Authorization: ApiKey $EC_API_KEY"

Shutdown Deployment Stateless Resource

Shutdown Stateless Resource belonging to a given Deployment.

Request

POST /api/v1/deployments/{deployment_id}/{stateless_resource_kind}/{ref_id}/_shutdown

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

stateless_resource_kind

string; allowed values: [kibana, apm, appsearch, enterprise_search]

Y

The kind of stateless resource

Query parameters

Name Type Required Description

hide

boolean

N

Hide cluster on shutdown. Hidden clusters are not listed by default. Only applicable for Platform administrators.

skip_snapshot

boolean; default: false

N

If true, will skip taking a snapshot of the cluster before shutting the cluster down (if even possible)

Responses

200

(DeploymentResourceCommandResponse) Standard response

400

(BasicFailedReply) Parameter is restricted and can only be set by a Platform administrator. (code: deployments.restricted_parameter)

Headers

x-cloud-error-codes (string; allowed values: [deployments.restricted_parameter])
The error codes associated with the response
404

(BasicFailedReply) The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_not_found])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response
500

(BasicFailedReply) We have failed you. (code: deployments.deployment_resource_no_longer_exists)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_no_longer_exists])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{stateless_resource_kind}/{ref_id}/_shutdown \
-H "Authorization: ApiKey $EC_API_KEY"

Upgrade Kibana, APM, AppSearch inside Deployment

Upgrades a running cluster.

Request

POST /api/v1/deployments/{deployment_id}/{stateless_resource_kind}/{ref_id}/_upgrade

Path parameters

Name Type Required Description

deployment_id

string

Y

Identifier for the Deployment.

ref_id

string

Y

User-specified RefId for the Resource.

stateless_resource_kind

string; allowed values: [kibana, apm, appsearch, enterprise_search]

Y

The kind of stateless resource

Query parameters

Name Type Required Description

validate_only

boolean; default: false

N

When true, returns the update version without performing the upgrade

Responses

202

(DeploymentResourceUpgradeResponse) The upgrade command was issued successfully, use the "GET" command on the /{cluster_id} resource to monitor progress

404

(BasicFailedReply) The Resource specified by {ref_id} cannot be found. (code: deployments.deployment_resource_not_found)

Headers

x-cloud-error-codes (string; allowed values: [deployments.deployment_resource_not_found])
The error codes associated with the response
449

(BasicFailedReply) Elevated permissions are required. (code: root.unauthorized.rbac.elevated_permissions_required)

Headers

x-cloud-error-codes (string; allowed values: [root.unauthorized.rbac.elevated_permissions_required])
The error codes associated with the response

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

Request example

curl -XPOST https://api.elastic-cloud.com/api/v1/deployments/{deployment_id}/{stateless_resource_kind}/{ref_id}/_upgrade \
-H "Authorization: ApiKey $EC_API_KEY"