Add an index block Added in 7.9.0

PUT /{index}/_block/{block}

Limits the operations allowed on an index by blocking specific operation types.

Path parameters

  • index string Required

    A comma separated list of indices to add a block to

  • block string Required

    The block to add (one of read, write, read_only or metadata)

    Values are metadata, read, read_only, or write.

Query parameters

  • Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

  • expand_wildcards string | array[string]

    Whether to expand wildcard expression to concrete indices that are open, closed or both.

  • Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • Specify timeout for connection to master

  • timeout string

    Explicit operation timeout

Responses

PUT /{index}/_block/{block}
curl \
 -X PUT http://api.example.com/{index}/_block/{block}
Response examples (200)
A successful response for adding an index block to an index.
{
  "acknowledged" : true,
  "shards_acknowledged" : true,
  "indices" : [ {
    "name" : "my-index-000001",
    "blocked" : true
  } ]
}