Skip to content

Commit a37d021

Browse files
szabostevelcawl
andauthored
Adds EQL, ESQL, features API example requests and responses (#2879)
Co-authored-by: lcawl <lcawley@elastic.co>
1 parent b26b9a1 commit a37d021

10 files changed

+112
-4
lines changed

docs/overlays/elasticsearch-openapi-overlays.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# overlays.yaml
1+
# Overlays that are specific to the Elasticsearch OpenAPI document
22
overlay: 1.0.0
33
info:
44
title: Overlays for the Elasticsearch OpenAPI document
@@ -19,3 +19,25 @@ actions:
1919
x-feedbackLink:
2020
label: Feedback
2121
url: https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+
22+
# Examples that apply only to the Elasticsearch OpenAPI document
23+
- target: "$.paths['/_features']['get']"
24+
description: "Add examples for get features operation"
25+
update:
26+
responses:
27+
200:
28+
content:
29+
application/json:
30+
examples:
31+
getFeaturesResponseExample1:
32+
$ref: "../../specification/features/get_features/FeaturesApiResponseExample1.json"
33+
- target: "$.paths['/_features/_reset']['post']"
34+
description: "Add examples for reset features operation"
35+
update:
36+
responses:
37+
200:
38+
content:
39+
application/json:
40+
examples:
41+
resetFeaturesResponseExample1:
42+
$ref: "../../specification/features/reset_features/ResetFeaturesResponseExample1.json"
43+

docs/overlays/elasticsearch-serverless-openapi-overlays.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# overlays.yaml
1+
# Overlays that are specific to the Elasticsearch Serverless OpenAPI document
22
overlay: 1.0.0
33
info:
44
title: Overlays for the Elasticsearch Serverless OpenAPI document

docs/overlays/elasticsearch-shared-example-overlays.yaml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# overlays.yaml
1+
# Overlays that are applicable to both Elasticsearch and Elasticsearch Serverless OpenAPI documents
22
overlay: 1.0.0
33
info:
44
title: Overlays for examples that apply to both Elasticsearcb and Elasticsearch Serverless OpenAPI documents
@@ -69,4 +69,41 @@ actions:
6969
application/json:
7070
examples:
7171
updateTransformResponseExample1:
72-
$ref: "../../specification/transform/update_transform/UpdateTransformResponseExample1.json"
72+
$ref: "../../specification/transform/update_transform/UpdateTransformResponseExample1.json"
73+
- target: "$.paths['/_eql/search/status/{id}']['get']"
74+
description: "Add examples for get async EQL status operation"
75+
update:
76+
responses:
77+
200:
78+
content:
79+
application/json:
80+
examples:
81+
eqlGetStatusResponseExample1:
82+
$ref: "../../specification/eql/get_status/EqlGetStatusResponseExample1.json"
83+
- target: "$.components['requestBodies']['eql.search']"
84+
description: "Add examples for EQL search operation"
85+
update:
86+
content:
87+
application/json:
88+
examples:
89+
eqlSearchRequestExample1:
90+
$ref: "../../specification/eql/search/EqlSearchRequestExample1.json"
91+
eqlSearchRequestExample2:
92+
$ref: "../../specification/eql/search/EqlSearchRequestExample2.json"
93+
- target: "$.components['reponses']['eql.search#200']"
94+
description: "Add examples for EQL search operation"
95+
update:
96+
content:
97+
application/json:
98+
examples:
99+
eqlSearchResponseExample2:
100+
$ref: "../../specification/eql/search/EqlSearchResponseExample2.json"
101+
- target: "$.paths['/_query']['post']"
102+
description: "Add examples for ES|QL query operation"
103+
update:
104+
requestBody:
105+
content:
106+
application/json:
107+
examples:
108+
esqlQueryRequestExample1:
109+
$ref: "../../specification/esql/query/EsqlQueryApiRequestExample1.json"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A successful response for getting status information for an async EQL search.",
3+
"description": "",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"id\" : \"FmNJRUZ1YWZCU3dHY1BIOUhaenVSRkEaaXFlZ3h4c1RTWFNocDdnY2FSaERnUTozNDE=\",\n \"is_running\" : true,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1611690235000,\n \"expiration_time_in_millis\" : 1611690295000\n\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "Returns search results for an EQL query.",
3+
"method_request": "GET /my-data-stream/_eql/search",
4+
"description": "",
5+
"type": "request",
6+
"value": "{\n \"query\": \"\"\"\n process where process.name == \"regsvr32.exe\"\n \"\"\"\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "Returns search results for an EQL query",
3+
"method_request": "GET /my-data-stream/_eql/search",
4+
"description": "",
5+
"type": "request",
6+
"value": "{\n \"query\": \"\"\"\n process where (process.name == \"cmd.exe\" and process.pid != 2013)\n \"\"\"\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A successful response for performing search with an EQL query.",
3+
"description": "",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"is_partial\": false,\n \"is_running\": false,\n \"took\": 6,\n \"timed_out\": false,\n \"hits\": {\n \"total\": {\n \"value\": 1,\n \"relation\": \"eq\"\n },\n \"sequences\": [\n {\n \"join_keys\": [\n 2012\n ],\n \"events\": [\n {\n \"_index\": \".ds-my-data-stream-2099.12.07-000001\",\n \"_id\": \"AtOJ4UjUBAAx3XR5kcCM\",\n \"_source\": {\n \"@timestamp\": \"2099-12-06T11:04:07.000Z\",\n \"event\": {\n \"category\": \"file\",\n \"id\": \"dGCHwoeS\",\n \"sequence\": 2\n },\n \"file\": {\n \"accessed\": \"2099-12-07T11:07:08.000Z\",\n \"name\": \"cmd.exe\",\n \"path\": \"C:\\\\Windows\\\\System32\\\\cmd.exe\",\n \"type\": \"file\",\n \"size\": 16384\n },\n \"process\": {\n \"pid\": 2012,\n \"name\": \"cmd.exe\",\n \"executable\": \"C:\\\\Windows\\\\System32\\\\cmd.exe\"\n }\n }\n },\n {\n \"_index\": \".ds-my-data-stream-2099.12.07-000001\",\n \"_id\": \"OQmfCaduce8zoHT93o4H\",\n \"_source\": {\n \"@timestamp\": \"2099-12-07T11:07:09.000Z\",\n \"event\": {\n \"category\": \"process\",\n \"id\": \"aR3NWVOs\",\n \"sequence\": 4\n },\n \"process\": {\n \"pid\": 2012,\n \"name\": \"regsvr32.exe\",\n \"command_line\": \"regsvr32.exe /s /u /i:https://...RegSvr32.sct scrobj.dll\",\n \"executable\": \"C:\\\\Windows\\\\System32\\\\regsvr32.exe\"\n }\n }\n }\n ]\n }\n ]\n }\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "Returns results for an ES|QL query.",
3+
"method_request": "POST /_query",
4+
"description": "",
5+
"type": "request",
6+
"value": "{\n \"query\": \"\"\"\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\"\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A successful response for retrieving a list of feature states that can be included when taking a snapshot.",
3+
"description": "",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"features\": [\n {\n \"name\": \"tasks\",\n \"description\": \"Manages task results\"\n },\n {\n \"name\": \"kibana\",\n \"description\": \"Manages Kibana configuration and reports\"\n }\n ]\n}"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"summary": "A successful response for clearing state information stored in system indices by Elasticsearch features.",
3+
"description": "",
4+
"type": "response",
5+
"response_code": 200,
6+
"value": "{\n \"features\" : [\n {\n \"feature_name\" : \"security\",\n \"status\" : \"SUCCESS\"\n },\n {\n \"feature_name\" : \"tasks\",\n \"status\" : \"SUCCESS\"\n }\n ]\n}"
7+
}

0 commit comments

Comments
 (0)