diff --git a/api/_core/scriptsPainlessExecute.d.ts b/api/_core/scriptsPainlessExecute.d.ts index b7912773a..9c20c7f9e 100644 --- a/api/_core/scriptsPainlessExecute.d.ts +++ b/api/_core/scriptsPainlessExecute.d.ts @@ -34,6 +34,6 @@ export type ScriptsPainlessExecute_Response = ApiResponse & { } export type ScriptsPainlessExecute_ResponseBody = { - result: Record; + result: number | string | boolean; } diff --git a/api/_types/_common.d.ts b/api/_types/_common.d.ts index 54416b9d4..aad183307 100644 --- a/api/_types/_common.d.ts +++ b/api/_types/_common.d.ts @@ -608,6 +608,19 @@ export type RequestStats = { total?: number; } +export type ResourceStat = { + cpu_time_in_nanos: DurationValueUnitNanos; + memory_in_bytes: ByteCount; +} + +export type ResourceStats = { + average: ResourceStat; + max: ResourceStat; + min: ResourceStat; + thread_info: ThreadInfo; + total: ResourceStat; +} + export type ResourceType = 'index_or_alias' export type Result = 'created' | 'deleted' | 'noop' | 'not_found' | 'updated' @@ -831,6 +844,11 @@ export type TaskId = string | number export type TermFrequencyNormalization = 'h1' | 'h2' | 'h3' | 'no' | 'z' +export type ThreadInfo = { + active_threads: number; + thread_executions: number; +} + export type TimeOfDay = string export type TimeUnit = 'd' | 'h' | 'm' | 'micros' | 'ms' | 'nanos' | 's' diff --git a/api/_types/_core.scripts_painless_execute.d.ts b/api/_types/_core.scripts_painless_execute.d.ts index 627a446ec..9e81fc195 100644 --- a/api/_types/_core.scripts_painless_execute.d.ts +++ b/api/_types/_core.scripts_painless_execute.d.ts @@ -20,6 +20,6 @@ import * as Common_QueryDsl from './_common.query_dsl' export type PainlessContextSetup = { document: Record; index: Common.IndexName; - query: Common_QueryDsl.QueryContainer; + query?: Common_QueryDsl.QueryContainer; } diff --git a/api/_types/_core.search.d.ts b/api/_types/_core.search.d.ts index 507ea69e4..76f322fbe 100644 --- a/api/_types/_core.search.d.ts +++ b/api/_types/_core.search.d.ts @@ -203,7 +203,7 @@ export type Hit = { _source?: Record; _type?: Common.Type; _version?: Common.VersionNumber; - fields?: Record>; + fields?: Record; highlight?: Record; ignored_field_values?: Record; inner_hits?: Record; diff --git a/api/_types/indices.simulate_template.d.ts b/api/_types/indices.simulate_template.d.ts index 4b7acea76..e526e9390 100644 --- a/api/_types/indices.simulate_template.d.ts +++ b/api/_types/indices.simulate_template.d.ts @@ -25,7 +25,7 @@ export type Overlapping = { export type Template = { aliases: Record; - mappings: Common_Mapping.TypeMapping; + mappings?: Common_Mapping.TypeMapping; settings: Indices_Common.IndexSettings; } diff --git a/api/_types/ingest.simulate.d.ts b/api/_types/ingest.simulate.d.ts index 4675dce39..c277ab0ba 100644 --- a/api/_types/ingest.simulate.d.ts +++ b/api/_types/ingest.simulate.d.ts @@ -27,7 +27,7 @@ export type DocumentSimulation = { _index: Common.IndexName; _ingest: Ingest; _routing?: string; - _source: Record>; + _source: Record; _version?: Common.StringifiedVersionNumber; _version_type?: Common.VersionType; } diff --git a/api/_types/nodes._common.d.ts b/api/_types/nodes._common.d.ts index 6dd16744d..dcd195724 100644 --- a/api/_types/nodes._common.d.ts +++ b/api/_types/nodes._common.d.ts @@ -322,12 +322,15 @@ export type NodeBufferPool = { used_in_bytes?: Common.ByteCount; } -export type NodeReloadError = { - name: Common.Name; +export type NodeReloadError = NodeReloadResponse & { reload_exception?: Common.ErrorCause; } -export type NodeReloadResult = Stats | NodeReloadError +export type NodeReloadResponse = { + name: Common.Name; +} + +export type NodeReloadResult = NodeReloadResponse | NodeReloadError export type NodesResponseBase = { _nodes?: Common.NodeStatistics; diff --git a/api/_types/nodes.usage.d.ts b/api/_types/nodes.usage.d.ts index 780380451..214d08e03 100644 --- a/api/_types/nodes.usage.d.ts +++ b/api/_types/nodes.usage.d.ts @@ -17,11 +17,11 @@ import * as Common from './_common' import * as Nodes_Common from './nodes._common' -export type Metric = '_all' | 'rest_actions' +export type Metric = '_all' | 'aggregations' | 'rest_actions' export type NodeUsage = { - aggregations: Record>; - rest_actions: Record; + aggregations?: Record>; + rest_actions?: Record; since: Common.EpochTimeUnitMillis; timestamp: Common.EpochTimeUnitMillis; } diff --git a/api/_types/tasks._common.d.ts b/api/_types/tasks._common.d.ts index 8764946ee..ab3666cd8 100644 --- a/api/_types/tasks._common.d.ts +++ b/api/_types/tasks._common.d.ts @@ -49,6 +49,7 @@ export type TaskInfoBase = { id: number; node: Common.NodeId; parent_task_id?: Common.TaskId; + resource_stats?: Common.ResourceStats; running_time?: Common.Duration; running_time_in_nanos: Common.DurationValueUnitNanos; start_time_in_millis: Common.EpochTimeUnitMillis; diff --git a/api/asynchronousSearch/search.js b/api/asynchronousSearch/search.js index d62e3ca7b..5db0f6309 100644 --- a/api/asynchronousSearch/search.js +++ b/api/asynchronousSearch/search.js @@ -25,10 +25,10 @@ const { normalizeArguments } = require('../utils'); * @memberOf API-Asynchronous-Search * * @param {object} [params] - * @param {string} [params.index] - The name of the index to be searched. - * @param {string} [params.keep_alive] - The amount of time that the result is saved in the cluster. + * @param {string} [params.index] - The name of the index to be searched. Can be an individual name, a comma-separated list of indexes, or a wildcard expression of index names. + * @param {string} [params.keep_alive] - The amount of time that the result is saved in the cluster. For example, `2d` means that the results are stored in the cluster for 48 hours. The saved search results are deleted after this period or if the search is canceled. Note that this includes the query execution time. If the query overruns this time, the process cancels this query automatically. * @param {boolean} [params.keep_on_completion] - Whether you want to save the results in the cluster after the search is complete. - * @param {string} [params.wait_for_completion_timeout] - The amount of time that you plan to wait for the results. + * @param {string} [params.wait_for_completion_timeout] - The amount of time that you plan to wait for the results. You can poll the remaining results based on an ID. The maximum value is `300s`. Default is `1s`. * @param {object} [params.body] - The search definition using the Query DSL. * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} diff --git a/api/indices/simulateIndexTemplate.d.ts b/api/indices/simulateIndexTemplate.d.ts index 5e92856c9..e9afb7d8d 100644 --- a/api/indices/simulateIndexTemplate.d.ts +++ b/api/indices/simulateIndexTemplate.d.ts @@ -22,9 +22,7 @@ import * as Indices_PutIndexTemplate from '../_types/indices.put_index_template' export type Indices_SimulateIndexTemplate_Request = Global.Params & { body?: Indices_SimulateIndexTemplate_RequestBody; - cause?: string; cluster_manager_timeout?: Common.Duration; - create?: boolean; master_timeout?: Common.Duration; name: Common.Name; } diff --git a/api/indices/simulateIndexTemplate.js b/api/indices/simulateIndexTemplate.js index 6433f5e9f..4f0f1bff0 100644 --- a/api/indices/simulateIndexTemplate.js +++ b/api/indices/simulateIndexTemplate.js @@ -25,9 +25,7 @@ const { normalizeArguments, parsePathParam, handleMissingParam } = require('../u * @memberOf API-Indices * * @param {object} params - * @param {string} [params.cause=false] - User defined reason for dry-run creating the new template for simulation purposes. * @param {string} [params.cluster_manager_timeout] - Operation timeout for connection to cluster-manager node. - * @param {boolean} [params.create=false] - If `true`, the template passed in the body is only used if no existing templates match the same index patterns. If `false`, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. * @param {string} [params.master_timeout] DEPRECATED - Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error. * @param {string} params.name - Index or template name to simulate * @param {object} [params.body] - New index template definition, which will be included in the simulation, as if it already exists in the system diff --git a/api/ingest/processorGrok.d.ts b/api/ingest/processorGrok.d.ts index 022ac0992..070208097 100644 --- a/api/ingest/processorGrok.d.ts +++ b/api/ingest/processorGrok.d.ts @@ -17,7 +17,9 @@ import { ApiResponse } from '../../lib/Transport' import * as Global from '../_types/_global' -export type Ingest_ProcessorGrok_Request = Global.Params & Record +export type Ingest_ProcessorGrok_Request = Global.Params & { + s?: boolean; +} export type Ingest_ProcessorGrok_Response = ApiResponse & { body: Ingest_ProcessorGrok_ResponseBody; diff --git a/api/ingest/processorGrok.js b/api/ingest/processorGrok.js index 632429384..0dd0b86d1 100644 --- a/api/ingest/processorGrok.js +++ b/api/ingest/processorGrok.js @@ -24,7 +24,9 @@ const { normalizeArguments } = require('../utils'); * * @memberOf API-Ingest * - * @param {object} [params] - (Unused) + * @param {object} [params] + * @param {boolean} [params.s=false] - Sort returned patterns by key name. + * * @param {TransportRequestOptions} [options] - Options for {@link Transport#request} * @param {function} [callback] - Callback that handles errors and response *