Move Elasticsearch resource instances

edit

Moves one or more instances belonging to the given Elasticsearch resource to a different allocator.

Request

edit

POST /api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/instances/{instance_ids}/_move

Path parameters

edit
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 (or '_main' if there is only one).

Query parameters

edit
Name Type Required Description

force_move

boolean; default: false

N

When true, moves instance data at file-system level (not via Elasticsearch), and re-creates instances on target allocator(s).

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 are considered permanently shut down for data migration logic.

move_only

boolean; default: true

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

edit

(TransientElasticsearchPlanConfiguration) Overrides the default move configuration

Responses

edit
200

(TransientElasticsearchPlanConfiguration)

If validate_only is true, the calculated plan is returned

202

(EmptyResponse)

The move command was issued successfully. Use the "GET" command on the /{deployment_id} resource to monitor progress

404

(BasicFailedReply)

  • The Deployment specified by {deployment_id} cannot be found. (code: deployments.deployment_not_found)
  • The Elasticsearch 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

Request example

edit
curl -XPOST https://{{hostname}}/api/v1/deployments/{deployment_id}/elasticsearch/{ref_id}/instances/{instance_ids}/_move \
-H "Authorization: ApiKey $ECE_API_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_allocator_tags" : {
         "some_property" : "string"
      },
      "preferred_allocators" : [
         "string"
      ],
      "reallocate_instances" : true,
      "skip_data_migration" : true,
      "skip_post_upgrade_steps" : true,
      "skip_snapshot" : true,
      "skip_snapshot_post_major_upgrade" : true,
      "skip_upgrade_checker" : true,
      "timeout" : 0
   },
   "remote_clusters" : {
      "resources" : [
         {
            "alias" : "string",
            "deployment_id" : "string",
            "elasticsearch_ref_id" : "string",
            "info" : {
               "compatible" : true,
               "connected" : true,
               "healthy" : true,
               "trusted" : true,
               "trusted_back" : true
            },
            "skip_unavailable" : true
         }
      ]
   },
   "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" : {
      "autodetect" : {},
      "grow_and_shrink" : {},
      "rolling" : {
         "allow_inline_resize" : true,
         "group_by" : "string",
         "shard_init_wait_time" : 0,
         "skip_synced_flush" : true
      },
      "rolling_grow_and_shrink" : {}
   }
}
'