123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- [role="xpack"]
- [testenv="basic"]
- [[freeze-index-api]]
- === Freeze index API
- ++++
- <titleabbrev>Freeze index</titleabbrev>
- ++++
- Freezes an index.
- [[freeze-index-api-request]]
- ==== {api-request-title}
- `POST /<index>/_freeze`
- [[freeze-index-api-prereqs]]
- ==== {api-prereq-title}
- * If the {es} {security-features} are enabled, you must have the `manage`
- <<privileges-list-indices,index privilege>> for the target index or index alias.
- [[freeze-index-api-desc]]
- ==== {api-description-title}
- A frozen index has almost no overhead on the cluster (except for maintaining its
- metadata in memory) and is read-only. Read-only indices are blocked for write
- operations, such as <<indexing,docs-index_>> or <<indices-forcemerge,force
- merges>>. See <<frozen-indices>> and <<unfreeze-index-api>>.
- The current write index on a data stream cannot be frozen. In order to freeze
- the current write index, the data stream must first be
- <<data-streams-rollover,rolled over>> so that a new write index is created
- and then the previous write index can be frozen.
- IMPORTANT: Freezing an index will close the index and reopen it within the same
- API call. This causes primaries to not be allocated for a short amount of time
- and causes the cluster to go red until the primaries are allocated again. This
- limitation might be removed in the future.
- [[freeze-index-api-path-parms]]
- ==== {api-path-parms-title}
- `<index>`::
- (Required, string) Identifier for the index.
- [[freeze-index-api-examples]]
- ==== {api-examples-title}
- The following example freezes and unfreezes an index:
- [source,console]
- --------------------------------------------------
- POST /my-index-000001/_freeze
- POST /my-index-000001/_unfreeze
- --------------------------------------------------
- // TEST[s/^/PUT my-index-000001\n/]
|