Clusters - Apm - Commands

Search clusters

Retrieves cluster information for all Apm clusters that match a given query.

Request

POST /api/v1/clusters/apm/_search

Request body

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

Responses

200
(ApmsInfo) The search request succeeded.
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/apm/_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 a Apm cluster. If a cluster is active: this command re-applies the existing plan but applies a "cluster_reboot", which issues a Apm restart command and waits for it to complete. If a cluster is inactive: this command starts it up with the most recent successful plan.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment identifier.

Query parameters

Name Type Required Description

cancel_pending

boolean; default: false

N

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

Responses

202
(ClusterCommandResponse) The APM server is stopping. To monitor progress, use the GET command on the /{cluster_id} resource.
404
(BasicFailedReply) The {cluster_id} can't be found. (code: 'clusters.cluster_not_found')
412
(BasicFailedReply) The APM server is in an unhealthy state. For more details, refer to the error message. (code: 'clusters.cluster_plan_state_error')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/_restart \
-u $CLOUD_USER:$CLOUD_KEY

Resynchronize cluster

Immediately resynchronizes the search index and cache for the selected Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment identifier.

Responses

200
(EmptyResponse) The resynchronization succeeded.
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
500
(BasicFailedReply) The resynchronization failed. (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/apm/{cluster_id}/_resync \
-u $CLOUD_USER:$CLOUD_KEY

Shut down cluster

Shuts down a running cluster and removes all nodes belonging to the cluster. The cluster definition is retained. Warning: this will lose all cluster data that is not saved in a snapshot repository.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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.

Responses

202
(ClusterCommandResponse) The APM server is shutting down. To monitor progress, use the GET command on the /{cluster_id} resource.
404
(BasicFailedReply) The {cluster_id} can't be found. (code: 'clusters.cluster_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/_shutdown \
-u $CLOUD_USER:$CLOUD_KEY

Upgrade cluster

Upgrades a running cluster.

Request

POST /api/v1/clusters/apm/{cluster_id}/_upgrade

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment identifier.

Query parameters

Name Type Required Description

validate_only

boolean; default: false

N

When true, returns the update version without performing the upgrade

Responses

202
(ClusterUpgradeInfo) The upgrade is in progress. To monitor progress, use the GET command on the /{cluster_id} resource.
404
(BasicFailedReply) The {cluster_id} can't be found. (code: 'clusters.cluster_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/_upgrade \
-u $CLOUD_USER:$CLOUD_KEY

Move instances (advanced)

Moves one or more instances belonging to a Apm cluster, with custom configuration posted in the body.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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.

validate_only

boolean; default: false

N

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

Request body

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

Responses

202
(ClusterCommandResponse) The move is in progress. To monitor progress, use the GET command on the /{cluster_id} resource.
400
(BasicFailedReply) The APM server plan contains errors. (code: 'clusters.cluster_invalid_plan' and 'clusters.plan_feature_not_implemented')
403
(BasicFailedReply) The move command is prohibited for the APM server.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/_move \
-u $CLOUD_USER:$CLOUD_KEY \
-H 'Content-Type: application/json' \
-d '
{
   "plan_configuration" : {
      "calm_wait_time" : 0,
      "cluster_reboot" : "string",
      "extended_maintenance" : true,
      "move_allocators" : [
         {
            "allocator_down" : true,
            "from" : "string",
            "to" : [
               "string"
            ]
         }
      ],
      "move_instances" : [
         {
            "from" : "string",
            "instance_down" : true,
            "to" : [
               "string"
            ]
         }
      ],
      "preferred_allocators" : [
         "string"
      ],
      "reallocate_instances" : true,
      "timeout" : 0
   },
   "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 the instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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 instances are starting. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to start the APM server.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop all instances

Stops all the instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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 instances are stopping. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to stop the instances.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/_stop \
-u $CLOUD_USER:$CLOUD_KEY

Start maintenance mode all instances

Starts maintenance mode of all instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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) Maintenance mode has started. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to start maintenance mode.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/maintenance-mode/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop maintenance mode all instances

Stops maintenance mode of all instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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) Maintenance mode is stopping. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to stop maintenance mode.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/maintenance-mode/_stop \
-u $CLOUD_USER:$CLOUD_KEY

Move instances

Moves one or more instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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.

validate_only

boolean; default: false

N

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

Request body

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

Responses

202
(ClusterCommandResponse) The move is in progress. To monitor progress, use the GET command on the /{cluster_id} resource.
400
(BasicFailedReply) The APM server plan contains errors. (code: 'clusters.cluster_invalid_plan' and 'clusters.plan_feature_not_implemented')
403
(BasicFailedReply) The move command is prohibited for the APM server.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/{instance_ids}/_move \
-u $CLOUD_USER:$CLOUD_KEY \
-H 'Content-Type: application/json' \
-d '
{
   "plan_configuration" : {
      "calm_wait_time" : 0,
      "cluster_reboot" : "string",
      "extended_maintenance" : true,
      "move_allocators" : [
         {
            "allocator_down" : true,
            "from" : "string",
            "to" : [
               "string"
            ]
         }
      ],
      "move_instances" : [
         {
            "from" : "string",
            "instance_down" : true,
            "to" : [
               "string"
            ]
         }
      ],
      "preferred_allocators" : [
         "string"
      ],
      "reallocate_instances" : true,
      "timeout" : 0
   },
   "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 belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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 instances are starting. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to start the APM server.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/{instance_ids}/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop instances

Stops the instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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 instances are stopping. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to stop the instances.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/{instance_ids}/_stop \
-u $CLOUD_USER:$CLOUD_KEY

Start maintenance mode

Starts maintenance mode of instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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) Maintenance mode has started. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to start maintenance mode.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/{instance_ids}/maintenance-mode/_start \
-u $CLOUD_USER:$CLOUD_KEY

Stop maintenance mode

Stops maintenance mode of instances belonging to a Apm cluster.

Request

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

Path parameters

Name Type Required Description

cluster_id

string

Y

The APM deployment 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) Maintenance mode is stopping. To monitor progress, use the GET command on the /{cluster_id} resource.
403
(BasicFailedReply) You are unable to stop maintenance mode.
404
(BasicFailedReply) One or more {instance_id} can't be found. (code: 'clusters.instances_not_found')
449
(BasicFailedReply) Elevated permissions are required. (code: '"root.needs_elevated_permissions"')
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/apm/{cluster_id}/instances/{instance_ids}/maintenance-mode/_stop \
-u $CLOUD_USER:$CLOUD_KEY