Skip to content

Commit a142201

Browse files
committed
add modify_data_stream
1 parent fb0018b commit a142201

File tree

3 files changed

+72
-1
lines changed

3 files changed

+72
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,7 @@ npm run docs:dev
920920
- :heavy_check_mark: 迁移数据流 [:link:](https://elasticsearch.bookhub.tech/rest_apis/data_stream_apis/migrate_to_data_stream)
921921
- :heavy_check_mark: 数据流统计 [:link:](https://elasticsearch.bookhub.tech/rest_apis/data_stream_apis/data_stream_stats)
922922
- :heavy_check_mark: 推广数据流 [:link:](https://elasticsearch.bookhub.tech/rest_apis/data_stream_apis/promote_data_stream)
923+
- :heavy_check_mark: 修改数据流 [:link:](https://elasticsearch.bookhub.tech/rest_apis/data_stream_apis/modify_data_stream)
923924
- :heavy_check_mark: 文档 API [:link:](https://elasticsearch.bookhub.tech/rest_apis/document_apis/)
924925
- :heavy_check_mark: 读写 API [:link:](https://elasticsearch.bookhub.tech/rest_apis/document_apis/replication)
925926
- :heavy_check_mark: 索引 API [:link:](https://elasticsearch.bookhub.tech/rest_apis/document_apis/docs_index)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# 修改数据流 API
2+
3+
在单个原子操作中执行一个或多个[数据流](/data_streams)修改操作。
4+
5+
```bash
6+
POST _data_stream/_modify
7+
{
8+
"actions": [
9+
{
10+
"remove_backing_index": {
11+
"data_stream": "my-logs",
12+
"index": ".ds-my-logs-2099.01.01-000001"
13+
}
14+
},
15+
{
16+
"add_backing_index": {
17+
"data_stream": "my-logs",
18+
"index": "index-to-add"
19+
}
20+
}
21+
]
22+
}
23+
```
24+
25+
## 请求
26+
27+
`POST /_data_stream/_modify`
28+
29+
## 请求体
30+
31+
- `actions`
32+
33+
(必填,对象数组)要执行的操作。
34+
35+
- `actions` 对象属性
36+
37+
- `<action>`
38+
39+
(必填,对象)键是操作类型。至少需要一个操作。
40+
41+
- 有效的 `<action>` 键
42+
43+
- `add_backing_index`
44+
45+
添加现有索引作为数据流的后备索引。作为该操作的一部分,索引将被隐藏。
46+
47+
:::warning 警告
48+
使用 add_backing_index 操作添加索引可能会导致不当的数据流行为。这应该被视为专家级 API。
49+
:::
50+
51+
52+
- `remove_backing_index`
53+
54+
从数据流中删除一个后备索引。作为该操作的一部分,索引将被取消隐藏。不能删除数据流的写索引。
55+
56+
- `<action>` 属性(对象主体包含的操作选项)
57+
58+
- `data_stream`
59+
60+
(必需*,字符串) 操作所针对的数据流。
61+
62+
- `index`
63+
64+
(必需*,字符串)操作索引。
65+
66+
67+
68+
69+
> [原文链接](https://www.elastic.co/guide/en/elasticsearch/reference/current/modify-data-streams-api.html)

sidebars.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ const sidebars = {
161161
'rest_apis/data_stream_apis/get_data_stream',
162162
'rest_apis/data_stream_apis/migrate_to_data_stream',
163163
'rest_apis/data_stream_apis/data_stream_stats',
164-
'rest_apis/data_stream_apis/promote_data_stream'
164+
'rest_apis/data_stream_apis/promote_data_stream',
165+
'rest_apis/data_stream_apis/modify_data_stream'
165166
]
166167
},
167168
{

0 commit comments

Comments
 (0)