Skip to content

[DOCS] Convert final examples from JSON to YAML #3692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Convert CCR examples from json to yaml
  • Loading branch information
lcawl committed Feb 3, 2025
commit 13b8259fdfc7752250ce4022b87d81dddb6a02ff
22 changes: 22 additions & 0 deletions docs/overlays/elasticsearch-openapi-overlays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,28 @@ actions:
examples:
ccrFollowerStatsResponseExample1:
$ref: "../../specification/ccr/follow_stats/examples/response/FollowIndexStatsResponseExample1.yaml"
- target: "$.paths['/{index}/_ccr/info']['get']"
description: "Add examples for get follower info"
update:
responses:
200:
content:
application/json:
examples:
ccrFollowerInfoResponseExample1:
$ref: "../../specification/ccr/follow_info/examples/response/FollowInfoResponseExample1.yaml"
ccrFollowerInfoResponseExample2:
$ref: "../../specification/ccr/follow_info/examples/response/FollowInfoResponseExample2.yaml"
- target: "$.paths['/_ccr/auto_follow/{name}']['delete']"
description: "Add examples for delete auto follow pattern"
update:
responses:
200:
content:
application/json:
examples:
ccrAutoFollowPatternDeleteResponseExample1:
$ref: "../../specification/ccr/delete_auto_follow_pattern/examples/response/DeleteAutoFollowPatternResponseExample1.yaml"
## Examples for cluster
- target: "$.components['requestBodies']['cluster.allocation_explain']"
description: "Add examples for cluster allocation explain operation"
Expand Down
8 changes: 4 additions & 4 deletions output/openapi/elasticsearch-openapi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 28 additions & 13 deletions output/schema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
summary: Dynamic templates
method_request: POST /_bulk
# method_request: POST /_bulk
description: >
Run `POST /_bulk` to perform a bulk request that consists of index and create actions with the `dynamic_templates` parameter.
The bulk request creates two new fields `work_location` and `home_location` with type `geo_point` according to the `dynamic_templates` parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ import { Duration } from '@_types/Time'

/**
* Delete auto-follow patterns.
*
* Delete a collection of cross-cluster replication auto-follow patterns.
* @rest_spec_name ccr.delete_auto_follow_pattern
* @availability stack since=6.5.0 stability=stable
* @cluster_privileges manage_ccr
* @doc_id ccr-delete-auto-follow-pattern
* @ext_doc_id ccr-auto-follow
*/
Expand All @@ -37,11 +39,14 @@ export interface Request extends RequestBase {
}
]
path_parts: {
/** The auto-follow pattern collection to delete. */
name: Name
}
query_parameters: {
/**
* Period to wait for a connection to the master node.
* The period to wait for a connection to the master node.
* If the master node is not available before the timeout expires, the request fails and returns an error.
* It can also be set to `-1` to indicate that the request should never timeout.
* @server_default 30s
*/
master_timeout?: Duration
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# summary:
description: A successful response from `DELETE /_ccr/auto_follow/my_auto_follow_pattern`, which deletes an auto-follow pattern.
# type: response
# response_code: 200
value: |-
{
"acknowledged" : true
}
7 changes: 6 additions & 1 deletion specification/ccr/follow_info/FollowInfoRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import { Duration } from '@_types/Time'

/**
* Get follower information.
*
* Get information about all cross-cluster replication follower indices.
* For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused.
* @rest_spec_name ccr.follow_info
* @availability stack since=6.7.0 stability=stable
* @cluster_privileges monitor
* @doc_id ccr-get-follow-info
* @ext_doc_id ccr
*/
Expand All @@ -38,11 +40,14 @@ export interface Request extends RequestBase {
}
]
path_parts: {
/** A comma-delimited list of follower index patterns. */
index: Indices
}
query_parameters: {
/**
* Period to wait for a connection to the master node.
* The period to wait for a connection to the master node.
* If the master node is not available before the timeout expires, the request fails and returns an error.
* It can also be set to `-1` to indicate that the request should never timeout.
* @server_default 30s
*/
master_timeout?: Duration
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
summary: An active follower index
description: A successful response from `GET /follower_index/_ccr/info` when the follower index is active.
# type: response
# response_code: 200
value: |-
{
"follower_indices": [
{
"follower_index": "follower_index",
"remote_cluster": "remote_cluster",
"leader_index": "leader_index",
"status": "active",
"parameters": {
"max_read_request_operation_count": 5120,
"max_read_request_size": "32mb",
"max_outstanding_read_requests": 12,
"max_write_request_operation_count": 5120,
"max_write_request_size": "9223372036854775807b",
"max_outstanding_write_requests": 9,
"max_write_buffer_count": 2147483647,
"max_write_buffer_size": "512mb",
"max_retry_delay": "500ms",
"read_poll_timeout": "1m"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
summary: A paused follower index
description: A successful response from `GET /follower_index/_ccr/info` when the follower index is paused.
# type: response
# response_code: '200'
value: |-
{
"follower_indices": [
{
"follower_index": "follower_index",
"remote_cluster": "remote_cluster",
"leader_index": "leader_index",
"status": "paused"
}
]
}
5 changes: 5 additions & 0 deletions specification/ccr/follow_info/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,15 @@ import { integer, long } from '@_types/Numeric'
import { Duration } from '@_types/Time'

export class FollowerIndex {
/** The name of the follower index. */
follower_index: IndexName
/** The name of the index in the leader cluster that is followed. */
leader_index: IndexName
/** An object that encapsulates cross-cluster replication parameters. If the follower index's status is paused, this object is omitted. */
parameters?: FollowerIndexParameters
/** The remote cluster that contains the leader index. */
remote_cluster: Name
/** The status of the index following: `active` or `paused`. */
status: FollowerIndexStatus
}

Expand Down
Loading