Skip to content

Commit 1fb94c6

Browse files
prudhvigodithiNaarcha-AWSnatebower
authored
Add new _scale API as part of OpenSearch Reader/Writer Separation (#9762)
* Add new scale API Signed-off-by: Prudhvi Godithi <[email protected]> * Update scale.md Signed-off-by: Naarcha-AWS <[email protected]> * Apply suggestions from code review Co-authored-by: Nathan Bower <[email protected]> Signed-off-by: Naarcha-AWS <[email protected]> --------- Signed-off-by: Prudhvi Godithi <[email protected]> Signed-off-by: Naarcha-AWS <[email protected]> Co-authored-by: Naarcha-AWS <[email protected]> Co-authored-by: Nathan Bower <[email protected]>
1 parent 9c31624 commit 1fb94c6

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

_api-reference/index-apis/scale.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
layout: default
3+
title: Scale
4+
parent: Index APIs
5+
nav_order: 50
6+
---
7+
8+
# Scale
9+
**Introduced 3.0**
10+
{: .label .label-purple }
11+
12+
The Scale API allows you to enable or disable the `search_only` mode on an index. When an index is in `search_only` mode, it retains only its search replicas and scales down primary and regular replica shards. This optimization helps reduce resource consumption during periods of low write activity while maintaining search capabilities.
13+
14+
This feature supports scenarios such as scale-to-zero deployments and reader/writer separation patterns, which can significantly improve resource utilization and reduce costs in production environments.
15+
16+
If you are using the Security plugin, you must have the `manage index` privileges.
17+
{: .note}
18+
19+
## Endpoints
20+
21+
```json
22+
POST /<index>/_scale
23+
```
24+
25+
## Path parameters
26+
27+
The following table lists the available path parameters.
28+
29+
| Parameter | Required | Data type | Description |
30+
| :--- | :--- | :--- | :--- |
31+
| `index` | **Required** | String | The name of the index to scale. Wildcards are not supported. |
32+
33+
## Request body fields
34+
35+
The following table lists the available request body fields.
36+
37+
| Field | Required | Data type | Description |
38+
| :--- | :--- | :--- | :--- |
39+
| `search_only` | **Required** | Boolean | When `true`, enables search-only mode on the index. When `false`, disables search-only mode and restores the index to normal operations. |
40+
41+
## Example requests
42+
43+
### Enable search-only mode
44+
45+
The following request enables search-only mode for an index named `my-index`:
46+
47+
```json
48+
POST /my-index/_scale
49+
{
50+
"search_only": true
51+
}
52+
```
53+
{% include copy-curl.html %}
54+
55+
### Disable search-only mode
56+
57+
The following request disables search-only mode and returns the index to normal operations:
58+
59+
```json
60+
POST /my-index/_scale
61+
{
62+
"search_only": false
63+
}
64+
```
65+
{% include copy-curl.html %}
66+
67+
## Example response
68+
69+
The API returns the following response:
70+
71+
```json
72+
{
73+
"acknowledged": true
74+
}
75+
```

0 commit comments

Comments
 (0)