//////////////////////////

[source,console]
--------------------------------------------------
PUT my-index-000001
{
  "settings": {
    "index.routing.allocation.enable": "primaries"
  }
}

--------------------------------------------------
// TESTSETUP

[source,console]
--------------------------------------------------
DELETE my-index-000001
--------------------------------------------------
// TEARDOWN

//////////////////////////

// tag::cloud[]
In order to get the shards assigned we'll need to change the value of the 
<<index-routing-allocation-enable-setting, configuration>> that restricts the 
assignemnt of the shards to `all`.

**Use {kib}**

//tag::kibana-api-ex[]
. Log in to the {ess-console}[{ecloud} console].
+

. On the **Elasticsearch Service** panel, click the name of your deployment. 
+

NOTE: If the name of your deployment is disabled your {kib} instances might be
unhealthy, in which case please contact https://support.elastic.co[Elastic Support].
If your deployment doesn't include {kib}, all you need to do is 
{cloud}/ec-access-kibana.html[enable it first].

. Open your deployment's side navigation menu (placed under the Elastic logo in the upper left corner)
and go to **Dev Tools > Console**.
+
[role="screenshot"]
image::images/kibana-console.png[{kib} Console,align="center"]

. Inspect the `index.routing.allocation.enable` <<indices-get-settings, index setting>> 
for the index with unassigned shards:
+
[source,console]
----
GET /my-index-000001/_settings/index.routing.allocation.enable?flat_settings
----
+
The response will look like this:
+
[source,console-result]
----
{
  "my-index-000001": {
    "settings": {
      "index.routing.allocation.enable": "none" <1>
    }
  }
}
----
// TESTRESPONSE[skip:the result is for illustrating purposes only]

+
<1> Represents the current configured value that controls if the index is allowed 
to be partially or totally allocated.

. <<indices-update-settings,Change>> the <<index-routing-allocation-enable-setting, configuration>> 
value to allow the index to be fully allocated:
+
[source,console]
----
PUT /my-index-000001/_settings
{
  "index" : {
    "routing.allocation.enable" : "all" <1>
  }
}
----
// TEST[continued]

+
<1> The new value for the `allocation.enable` configuration for the `my-index-000001` index
is changed to allow all the shards to be allocated. 

//end::kibana-api-ex[]
// end::cloud[]

// tag::self-managed[]
In order to get the shards assigned we'll need to change the value of the 
<<index-routing-allocation-enable-setting, configuration>> that restricts the 
assignemnt of the shards to `all`.

. Inspect the `index.routing.allocation.enable` <<indices-get-settings, index setting>> 
for the index with unassigned shards:
+
[source,console]
----
GET /my-index-000001/_settings/index.routing.allocation.enable?flat_settings
----
+
The response will look like this:
+
[source,console-result]
----
{
  "my-index-000001": {
    "settings": {
      "index.routing.allocation.enable": "none" <1>
    }
  }
}
----
// TESTRESPONSE[skip:the result is for illustrating purposes only]

+
<1> Represents the current configured value that controls if the index is allowed 
to be partially or totally allocated.

. <<indices-update-settings,Change>> the <<index-routing-allocation-enable-setting, configuration>> 
value to allow the index to be fully allocated:
+
[source,console]
----
PUT /my-index-000001/_settings
{
  "index" : {
    "routing.allocation.enable" : "all" <1>
  }
}
----
// TEST[continued]

+
<1> The new value for the `allocation.enable` configuration for the `my-index-000001` index
is changed to allow all the shards to be allocated. 

// end::self-managed[]

