anchor.diff:  [[cluster-allocation-explain]]
   === Cluster Allocation Explain API
  +
  +Provides explanations for shard allocations in the cluster.
  +
  +
  +[[cluster-allocation-explain-api-request]]
  +==== {api-request-title}
  +
  +`GET /_cluster/allocation/explain`
  +
  +
  +[[cluster-allocation-explain-api-desc]]
  +==== {api-description-title}
   
   The purpose of the cluster allocation explain API is to provide
   explanations for shard allocations in the cluster.  For unassigned shards,
   the explain API provides an explanation for why the shard is unassigned.
   For assigned shards, the explain API provides an explanation for why the
   shard is remaining on its current node and has not moved or rebalanced to
  -another node.  This API can be very useful when attempting to diagnose why
  -a shard is unassigned or why a shard continues to remain on its current node
  -when you might expect otherwise.
  -
  -[float]
  -==== Explain API Request
  -
  -To explain the allocation of a shard, first an index should exist:
  -
  -[source,js]
  ---------------------------------------------------
  -PUT /myindex
  ---------------------------------------------------
  -// CONSOLE
  +another node. This API can be very useful when attempting to diagnose why a 
  +shard is unassigned or why a shard continues to remain on its current node when 
  +you might expect otherwise.
  +
  +
  +[[cluster-allocation-explain-api-query-params]]
  +==== {api-query-parms-title}
  +
  +`include_disk_info`::
  +    (Optional, boolean) If `true`, returns information about disk usage and 
  +    shard sizes. Defaults to `false`.
  +    
  +`include_yes_decisions`::
  +    (Optional, boolean) If `true`, returns 'YES' decisions in explanation. 
  +    Defaults to `false`.
  +
  +
  +[[cluster-allocation-explain-api-request-body]]
  +==== {api-request-body-title}
  +
  +`current_node`::
  +    (Optional, string) Specifies the node ID or the name of the node to only 
  +    explain a shard that is currently located on the specified node.
  +
  +`index`::
  +    (Optional, string) Specifies the name of the index that you would like an 
  +    explanation for.
  +
  +`primary`::
  +    (Optional, boolean) If `true`, returns explanation for the primary shard 
  +    for the given shard ID.
  +
  +`shard`::
  +    (Optional, integer) Specifies the ID of the shard that you would like an 
  +    explanation for.
  +
  +You can also have {es} explain the allocation of the first unassigned shard that 
  +it finds by sending an empty body for the request.
  +
  +
  +[[cluster-allocation-explain-api-examples]]
  +==== {api-examples-title}
  +
  +
  +//////
  +[source,js]	
  +--------------------------------------------------	
  +PUT /myindex	
  +--------------------------------------------------	
  +// CONSOLE	
   // TESTSETUP
  -
  -And then the allocation for shards of that index can be explained:
  +//////
   
   [source,js]
   --------------------------------------------------
  
positive.code: }
  --------------------------------------------------
  // NOTCONSOLE
  <1> The configured delay before allocating a replica shard that does not exist due to the node holding it leaving the cluster
  <2> The remaining delay before allocating the replica shard
  <3> Information about the shard data found on a node
  
  The API response output for an assigned shard that is not allowed to
  remain on its current node and is required to move:
  
  [source,js]
  --------------------------------------------------
  
negative.code: --------------------------------------------------
  // CONSOLE
  
  
  ===== Example of the current_node parameter
  
  [source,js]
  --------------------------------------------------
  