From def4be92c614875b5d244459559c337f91b4dd57 Mon Sep 17 00:00:00 2001 From: delvedor Date: Wed, 30 Oct 2019 09:50:17 +0100 Subject: [PATCH] API generation --- api/api/rank_eval.js | 2 ++ api/api/security.get_api_key.js | 4 +++- api/api/transform.stop_transform.js | 7 +++++-- api/requestParams.d.ts | 4 ++++ docs/reference.asciidoc | 20 ++++++++++++++++++-- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/api/api/rank_eval.js b/api/api/rank_eval.js index ca588db40..2debba204 100644 --- a/api/api/rank_eval.js +++ b/api/api/rank_eval.js @@ -15,6 +15,7 @@ function buildRankEval (opts) { 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', + 'search_type', 'pretty', 'human', 'error_trace', @@ -26,6 +27,7 @@ function buildRankEval (opts) { ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', + searchType: 'search_type', errorTrace: 'error_trace', filterPath: 'filter_path' } diff --git a/api/api/security.get_api_key.js b/api/api/security.get_api_key.js index bbcfc0162..80e21a104 100644 --- a/api/api/security.get_api_key.js +++ b/api/api/security.get_api_key.js @@ -15,11 +15,13 @@ function buildSecurityGetApiKey (opts) { 'id', 'name', 'username', - 'realm_name' + 'realm_name', + 'owner' ] const snakeCase = { realmName: 'realm_name' + } /** diff --git a/api/api/transform.stop_transform.js b/api/api/transform.stop_transform.js index 1ee434793..eed82e91a 100644 --- a/api/api/transform.stop_transform.js +++ b/api/api/transform.stop_transform.js @@ -12,14 +12,17 @@ function buildTransformStopTransform (opts) { const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const acceptedQuerystring = [ + 'force', 'wait_for_completion', 'timeout', - 'allow_no_match' + 'allow_no_match', + 'wait_for_checkpoint' ] const snakeCase = { waitForCompletion: 'wait_for_completion', - allowNoMatch: 'allow_no_match' + allowNoMatch: 'allow_no_match', + waitForCheckpoint: 'wait_for_checkpoint' } /** diff --git a/api/requestParams.d.ts b/api/requestParams.d.ts index 18e8658ca..000f98cf5 100644 --- a/api/requestParams.d.ts +++ b/api/requestParams.d.ts @@ -1036,6 +1036,7 @@ export interface RankEval extends Generic { ignore_unavailable?: boolean; allow_no_indices?: boolean; expand_wildcards?: 'open' | 'closed' | 'none' | 'all'; + search_type?: 'query_then_fetch' | 'dfs_query_then_fetch'; body: T; } @@ -2011,6 +2012,7 @@ export interface SecurityGetApiKey extends Generic { name?: string; username?: string; realm_name?: string; + owner?: boolean; } export interface SecurityGetBuiltinPrivileges extends Generic { @@ -2151,9 +2153,11 @@ export interface TransformStartTransform extends Generic { export interface TransformStopTransform extends Generic { transform_id: string; + force?: boolean; wait_for_completion?: boolean; timeout?: string; allow_no_match?: boolean; + wait_for_checkpoint?: boolean; } export interface TransformUpdateTransform extends Generic { diff --git a/docs/reference.asciidoc b/docs/reference.asciidoc index 2860ec151..e9f314f15 100644 --- a/docs/reference.asciidoc +++ b/docs/reference.asciidoc @@ -4134,6 +4134,7 @@ client.rankEval({ ignore_unavailable: boolean, allow_no_indices: boolean, expand_wildcards: 'open' | 'closed' | 'none' | 'all', + search_type: 'query_then_fetch' | 'dfs_query_then_fetch', body: object }) ---- @@ -4153,6 +4154,9 @@ link:{ref}/search-rank-eval.html[Reference] |`'open' \| 'closed' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. + _Default:_ `open` +|`search_type` or `searchType` +|`'query_then_fetch' \| 'dfs_query_then_fetch'` - Search operation type + |`body` |`object` - The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. @@ -7994,7 +7998,8 @@ client.security.getApiKey({ id: string, name: string, username: string, - realm_name: string + realm_name: string, + owner: boolean }) ---- link:{ref}/security-api-get-api-key.html[Reference] @@ -8012,6 +8017,9 @@ link:{ref}/security-api-get-api-key.html[Reference] |`realm_name` or `realmName` |`string` - realm name of the user who created this API key to be retrieved +|`owner` +|`boolean` - flag to query API keys owned by the currently authenticated user + |=== === security.getBuiltinPrivileges @@ -8549,9 +8557,11 @@ link:{ref}/start-transform.html[Reference] ---- client.transform.stopTransform({ transform_id: string, + force: boolean, wait_for_completion: boolean, timeout: string, - allow_no_match: boolean + allow_no_match: boolean, + wait_for_checkpoint: boolean }) ---- link:{ref}/stop-transform.html[Reference] @@ -8560,6 +8570,9 @@ link:{ref}/stop-transform.html[Reference] |`transform_id` or `transformId` |`string` - The id of the transform to stop +|`force` +|`boolean` - Whether to force stop a failed transform or not. Default to false + |`wait_for_completion` or `waitForCompletion` |`boolean` - Whether to wait for the transform to fully stop before returning or not. Default to false @@ -8569,6 +8582,9 @@ link:{ref}/stop-transform.html[Reference] |`allow_no_match` or `allowNoMatch` |`boolean` - Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) +|`wait_for_checkpoint` or `waitForCheckpoint` +|`boolean` - Whether to wait for the transform to reach a checkpoint before stopping. Default to false + |=== === transform.updateTransform