Skip to content

Commit 28775f9

Browse files
committed
Add esql version
Adds a `version` parameter to the ESQL `_query` request endpoint. We'll do some work to give this a default value in the generated clients soon, but for 8.14+ this'll be a required parameter.
1 parent 07e6742 commit 28775f9

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

output/schema/schema.json

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

output/typescript/types.ts

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

specification/esql/_types/Version.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { integer } from '@_types/Numeric'
21+
import { Duration } from '@_types/Time'
22+
23+
export enum Version {
24+
/**
25+
* Run against the first version of ESQL.
26+
*/
27+
'2024.04.01',
28+
/**
29+
* Run against the unreleased version of the ESQL language. This will
30+
* contain any changes staged for release that have yet to be included
31+
* in a version.
32+
*/
33+
snapshot
34+
}

specification/esql/query/QueryRequest.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import { RequestBase } from '@_types/Base'
2121
import { QueryContainer } from '@_types/query_dsl/abstractions'
2222
import { ScalarValue } from '@_types/common'
23+
import { Version } from '@esql/_types/Version'
2324

2425
/**
2526
* Executes an ES|QL request
@@ -59,6 +60,10 @@ export interface Request extends RequestBase {
5960
/**
6061
* The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.
6162
*/
62-
query: string
63+
query: string,
64+
/**
65+
* The version of the ES|QL language in which the "query" field uses was written.
66+
*/
67+
version: Version
6368
}
6469
}

0 commit comments

Comments
 (0)