Skip to content

Commit 45fcea6

Browse files
committed
Fix alias examples (#5331)
* Fix alias API examples * Generate output * Format yaml (cherry picked from commit 2a84c0c)
1 parent 7cb844c commit 45fcea6

File tree

8 files changed

+123
-27
lines changed

8 files changed

+123
-27
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/openapi/elasticsearch-serverless-openapi.json

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 20 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ doc_id,doc_url,previous_version_doc_url,description
22
apis,https://www.elastic.co/docs/api/doc/elasticsearch/v8,https://www.elastic.co/guide/en/elasticsearch/reference/7.17/rest-apis.html,
33
add-nodes,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/add-elasticsearch-nodes.html,,
44
alias-update,https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-put-alias,,
5+
aliases,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/aliases.html,,Aliases
56
aliases-update,https://www.elastic.co/docs/api/doc/elasticsearch/v8/operation/operation-indices-update-aliases,,
67
alibabacloud-api-keys,https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key,,
78
amazonbedrock-models,https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html,,

specification/indices/put_alias/IndicesPutAliasRequest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { Duration } from '@_types/Time'
2929
* @availability stack stability=stable
3030
* @availability serverless stability=stable visibility=public
3131
* @doc_id alias-update
32+
* @ext_doc_id aliases
3233
*/
3334
export interface Request extends RequestBase {
3435
urls: [
Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
# summary: indices/aliases.asciidoc:10
2-
method_request: POST _aliases
3-
# description: ''
1+
summary: Filter an alias
2+
method_request: POST /my-index-2099.05.06-000001/_alias/my-alias
3+
description: The filter option uses Query DSL to limit the documents an alias can access.
44
# type: request
5-
value: "{
6-
7-
\ \"actions\": [
8-
9-
\ {
10-
11-
\ \"add\": {
12-
13-
\ \"index\": \"my-data-stream\",
14-
15-
\ \"alias\": \"my-alias\"
16-
17-
\ }
18-
19-
\ }
20-
21-
\ ]
22-
23-
}"
5+
value: |-
6+
{
7+
"filter": {
8+
"bool": {
9+
"filter": [
10+
{
11+
"range": {
12+
"@timestamp": {
13+
"gte": "now-1d/d",
14+
"lt": "now/d"
15+
}
16+
}
17+
},
18+
{
19+
"term": {
20+
"user.id": "kimchy"
21+
}
22+
}
23+
]
24+
}
25+
}
26+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
summary: Write index
2+
method_request: POST /logs-my_app-default/_alias/logs
3+
description:
4+
You can use is_write_index to specify a write index or data stream for an alias. Elasticsearch routes any write
5+
requests for the alias to this index or data stream.
6+
# type: request
7+
value: |-
8+
{
9+
"is_write_index": true
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
summary: Routing
2+
method_request: POST /my-index-2099.05.06-000001/_alias/my-alias
3+
description: Use the routing option to route requests for an alias to a specific shard.
4+
# type: request
5+
value: |-
6+
{
7+
"routing": "1"
8+
}

0 commit comments

Comments
 (0)