Clusters - Elasticsearch - CRUD

Get clusters

Retrieves the information for all Elasticsearch clusters.

Request

GET /api/v1/clusters/elasticsearch

Query parameters

Name Type Required Description

convert_legacy_plans

boolean; default: false

N

When true, converts the plans to the 2.0.x format. When false, uses the 1.x format. The default is false.

enrich_with_template

boolean; default: false

N

When plans are shown, includes the missing elements from the applicable deployment template.

from

integer; default: 0

N

The number of clusters to skip.

q

string

N

An optional query to filter Elasticsearch clusters by. Maps to an Elasticsearch query_string query.

show_hidden

boolean

N

Includes the hidden clusters in the response.

show_metadata

boolean; default: false

N

Includes all of the cluster metadata in the response. NOTE: Responses can include a large amount of metadata, as well as credentials.

show_plan_defaults

boolean; default: false

N

When plans are shown, includes the default values in the response. NOTE: This option results in large responses.

show_plans

boolean; default: false

N

Includes the active and pending plan information in the response. NOTE: This option can result in large responses.

show_security

boolean; default: false

N

Includes the Elasticsearch 2.x security information in the response. NOTE: Responses can include a large amount of metadata, as well as credentials.

show_settings

boolean; default: false

N

Includes the cluster settings in the response.

show_system_alerts

integer; default: 0

N

The number of system alerts to include in the response. For example, the number of forced restarts caused from a limited amount of memory. Only numbers greater than zero return a field. NOTE: Responses can include a large number of system alerts.

size

integer; default: 100

N

Maximum number of clusters to include in the response. For all clusters, use -1. NOTE: This option can result in large responses.

Responses

200
(ElasticsearchClustersInfo) The information for the Elasticsearch cluster is retrieved.
Warning

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

Request example

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

Create cluster

Creates an Elasticsearch cluster.

Request

POST /api/v1/clusters/elasticsearch

Query parameters

Name Type Required Description

request_id

string

N

(Optional) The idempotency token. When two create requests share the same request_id (minimum size of 32 characters, maximum size of 128 characters), only one cluster is created. The second request returns the information for that cluster, but the password field is blank.

validate_only

boolean; default: false

N

When true, validates the cluster definition without creating the cluster.

Request body

(CreateElasticsearchClusterRequest) (required) The cluster definition

Responses

200
(ClusterCrudResponse) The cluster definition was valid - no further action was requested. The return object contains an internal representation of the plan, for use in debugging
201
(ClusterCrudResponse) The cluster definition was valid and the cluster creation has started
400
(BasicFailedReply) * The cluster definition contained errors. (code: clusters.cluster_invalid_plan) * The features used in the cluster definition have not been implemented yet. (code: clusters.plan_feature_not_implemented)
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 \
-u $CLOUD_USER:$CLOUD_KEY \
-H 'Content-Type: application/json' \
-d '
{
   "apm" : {
      "name" : "string",
      "plan" : {
         "apm" : {
            "docker_image" : "string",
            "system_settings" : {
               "debug_enabled" : "string",
               "elasticsearch_password" : "string",
               "elasticsearch_url" : "string",
               "elasticsearch_username" : "string",
               "kibana_url" : "string",
               "secret_token" : "string"
            },
            "user_settings_json" : {},
            "user_settings_override_json" : {},
            "user_settings_override_yaml" : "string",
            "user_settings_yaml" : "string",
            "version" : "string"
         },
         "cluster_topology" : [
            {
               "apm" : null,
               "instance_configuration_id" : "string",
               "size" : {
                  "resource" : "string",
                  "value" : 0
               },
               "zone_count" : 0
            }
         ],
         "transient" : {
            "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" : {}
            }
         }
      }
   },
   "cluster_name" : "string",
   "kibana" : {
      "cluster_name" : "string",
      "plan" : {
         "cluster_topology" : [
            {
               "allocator_filter" : {},
               "instance_configuration_id" : "string",
               "kibana" : {
                  "docker_image" : "string",
                  "system_settings" : {
                     "elasticsearch_password" : "string",
                     "elasticsearch_url" : "string",
                     "elasticsearch_username" : "string"
                  },
                  "user_settings_json" : {},
                  "user_settings_override_json" : {},
                  "user_settings_override_yaml" : "string",
                  "user_settings_yaml" : "string",
                  "version" : "string"
               },
               "memory_per_node" : 0,
               "node_configuration" : "string",
               "node_count_per_zone" : 0,
               "size" : null,
               "zone_count" : 0
            }
         ],
         "kibana" : null,
         "transient" : {
            "plan_configuration" : {
               "calm_wait_time" : 0,
               "cluster_reboot" : "string",
               "extended_maintenance" : true,
               "move_allocators" : [
                  null
               ],
               "move_instances" : [
                  null
               ],
               "preferred_allocators" : [
                  "string"
               ],
               "reallocate_instances" : true,
               "timeout" : 0
            },
            "strategy" : null
         },
         "zone_count" : 0
      }
   },
   "plan" : {
      "cluster_topology" : [
         {
            "allocator_filter" : {},
            "elasticsearch" : {
               "curation" : {
                  "from_instance_configuration_id" : "string",
                  "to_instance_configuration_id" : "string"
               },
               "docker_image" : "string",
               "enabled_built_in_plugins" : [
                  "string"
               ],
               "node_attributes" : {
                  "some_property" : "string"
               },
               "system_settings" : {
                  "auto_create_index" : true,
                  "default_shards_per_index" : 0,
                  "destructive_requires_name" : true,
                  "enable_close_index" : true,
                  "monitoring_collection_interval" : 0,
                  "monitoring_history_duration" : "string",
                  "reindex_whitelist" : [
                     "string"
                  ],
                  "scripting" : {
                     "expressions_enabled" : true,
                     "file" : {
                        "enabled" : true,
                        "sandbox_mode" : true
                     },
                     "inline" : null,
                     "mustache_enabled" : true,
                     "painless_enabled" : true,
                     "stored" : null
                  },
                  "use_disk_threshold" : true,
                  "watcher_trigger_engine" : "string"
               },
               "user_bundles" : [
                  {
                     "elasticsearch_version" : "string",
                     "name" : "string",
                     "url" : "string"
                  }
               ],
               "user_plugins" : [
                  {
                     "elasticsearch_version" : "string",
                     "name" : "string",
                     "url" : "string"
                  }
               ],
               "user_settings_json" : {},
               "user_settings_override_json" : {},
               "user_settings_override_yaml" : "string",
               "user_settings_yaml" : "string",
               "version" : "string"
            },
            "instance_configuration_id" : "string",
            "memory_per_node" : 0,
            "node_configuration" : "string",
            "node_count_per_zone" : 0,
            "node_type" : {
               "data" : true,
               "ingest" : true,
               "master" : true,
               "ml" : true
            },
            "size" : null,
            "zone_count" : 0
         }
      ],
      "deployment_template" : {
         "id" : "string",
         "version" : "string"
      },
      "elasticsearch" : null,
      "tiebreaker_override" : true,
      "tiebreaker_topology" : {
         "memory_per_node" : 0
      },
      "transient" : {
         "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" : [
               null
            ],
            "move_instances" : [
               null
            ],
            "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" : null
      },
      "zone_count" : 0
   },
   "settings" : {
      "ccs" : {
         "remote_clusters" : {
            "some_property" : {
               "cluster_id" : "string",
               "skip_unavailable" : true
            }
         }
      },
      "curation" : {
         "specs" : [
            {
               "index_pattern" : "string",
               "trigger_interval_seconds" : 0
            }
         ]
      },
      "dedicated_masters_threshold" : 0,
      "ip_filtering" : {
         "rulesets" : [
            "string"
         ]
      },
      "metadata" : {
         "contact_email" : "string",
         "hidden" : true,
         "name" : "string",
         "owner_id" : "string",
         "resources" : {
            "cpu" : {
               "boost" : true,
               "hard_limit" : true
            }
         },
         "subscription_level" : "string",
         "system_owned" : true
      },
      "monitoring" : {
         "target_cluster_id" : "string"
      },
      "snapshot" : {
         "enabled" : true,
         "interval" : "string",
         "pending_interval" : "string",
         "repository" : {
            "default" : {},
            "reference" : {
               "repository_name" : "string"
            },
            "static" : {
               "repository_type" : "string",
               "settings" : {}
            }
         },
         "repository_name" : "string",
         "retention" : {
            "max_age" : "string",
            "snapshots" : 0
         },
         "suspended" : [
            "string"
         ],
         "wait_time_after_snapshotting" : "string"
      }
   }
}
'

Search clusters that can be used as cross-cluster search remotes

Retrieves the information for all of the Elasticsearch clusters that can selected as remotes in a given version.

Request

GET /api/v1/clusters/elasticsearch/ccs/eligible_remotes

Query parameters

Name Type Required Description

owner_id

string

N

(Optional) Returns only clusters filtered by the provided owner id.

q

string

N

(Optional) Cluster name or id prefix to filters the candidates.

size

integer

N

(Optional) Maximum number of clusters to include in the response.

version

string

Y

The version of the cross-cluster search cluster that will link with the remote candidates.

Responses

200
(ElasticsearchClustersInfo) A list of Elasticsearch clusters that can be used as cross-cluster search remotes in deployments with the provided version
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 -XGET {{hostname}}/api/v1/clusters/elasticsearch/ccs/eligible_remotes \
-u $CLOUD_USER:$CLOUD_KEY

Delete cluster

Deletes the Elasticsearch cluster. Before you delete the Elasticsearch cluster, you must first successfully issue a _shutdown command.

Request

DELETE /api/v1/clusters/elasticsearch/{cluster_id}

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Responses

200
(EmptyResponse) The cluster has been successfully deleted
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found. (code: clusters.cluster_not_found)
412
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet. (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 -XDELETE {{hostname}}/api/v1/clusters/elasticsearch/{cluster_id} \
-u $CLOUD_USER:$CLOUD_KEY

Get cluster

Retrieves the Elasticsearch cluster information.

Request

GET /api/v1/clusters/elasticsearch/{cluster_id}

Path parameters

Name Type Required Description

cluster_id

string

Y

The Elasticsearch cluster identifier.

Query parameters

Name Type Required Description

convert_legacy_plans

boolean; default: false

N

When true, converts the plans to the 2.0.x format. When false, uses the 1.x format. The default is false.

enrich_with_template

boolean; default: false

N

When plans are shown, includes the missing elements from the applicable deployment template.

show_metadata

boolean; default: false

N

Includes all of the cluster metadata in the response. NOTE: Responses can include a large amount of metadata, as well as credentials.

show_plan_defaults

boolean; default: false

N

When plans are shown, includes the default values in the response. NOTE: This option results in large responses.

show_plan_logs

boolean; default: false

N

Includes the active, pending, and historical plan information in the attempt log. NOTE: This option can result in large responses.

show_plans

boolean; default: true

N

Includes the active and pending plan information in the response. NOTE: This option can result in large responses.

show_security

boolean; default: false

N

Includes the Elasticsearch 2.x security information in the response. NOTE: Responses can include a large amount of metadata, as well as credentials.

show_settings

boolean; default: false

N

Includes the cluster settings in the response.

show_system_alerts

integer; default: 0

N

The number of system alerts to include in the response. For example, the number of forced restarts caused from a limited amount of memory. Only numbers greater than zero return a field. NOTE: Responses can include a large number of system alerts.

Responses

200
(ElasticsearchClusterInfo) The information for the Elasticsearch cluster is retrieved.
404
(BasicFailedReply) The {cluster_id} can't be found. (code: 'clusters.cluster_not_found')
Warning

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

Request example

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