API generation

This commit is contained in:
delvedor
2020-07-29 08:32:03 +02:00
parent 11b4cea493
commit 14536d6855
6 changed files with 93 additions and 129 deletions

View File

@ -12,16 +12,11 @@ function buildIndicesCreateDataStream (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [ const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
] ]
const snakeCase = { const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
} }
/** /**

View File

@ -12,20 +12,11 @@ function buildIndicesDataStreamsStats (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [ const acceptedQuerystring = [
'expand_wildcards',
'forbid_closed_indices',
'pretty',
'human',
'error_trace',
'source',
'filter_path'
] ]
const snakeCase = { const snakeCase = {
expandWildcards: 'expand_wildcards',
forbidClosedIndices: 'forbid_closed_indices',
errorTrace: 'error_trace',
filterPath: 'filter_path'
} }
/** /**

View File

@ -12,16 +12,11 @@ function buildIndicesDeleteDataStream (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [ const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
] ]
const snakeCase = { const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
} }
/** /**

View File

@ -12,16 +12,11 @@ function buildIndicesGetDataStream (opts) {
const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts
const acceptedQuerystring = [ const acceptedQuerystring = [
'pretty',
'human',
'error_trace',
'source',
'filter_path'
] ]
const snakeCase = { const snakeCase = {
errorTrace: 'error_trace',
filterPath: 'filter_path'
} }
/** /**

View File

@ -650,17 +650,6 @@ export interface IndicesCreate<T = RequestBody> extends Generic {
body?: T; body?: T;
} }
export interface IndicesCreateDataStream<T = RequestBody> extends Generic {
name: string;
body?: T;
}
export interface IndicesDataStreamsStats extends Generic {
name?: string | string[];
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
forbid_closed_indices?: boolean;
}
export interface IndicesDelete extends Generic { export interface IndicesDelete extends Generic {
index: string | string[]; index: string | string[];
timeout?: string; timeout?: string;
@ -677,10 +666,6 @@ export interface IndicesDeleteAlias extends Generic {
master_timeout?: string; master_timeout?: string;
} }
export interface IndicesDeleteDataStream extends Generic {
name: string | string[];
}
export interface IndicesDeleteIndexTemplate extends Generic { export interface IndicesDeleteIndexTemplate extends Generic {
name: string; name: string;
timeout?: string; timeout?: string;
@ -782,10 +767,6 @@ export interface IndicesGetAlias extends Generic {
local?: boolean; local?: boolean;
} }
export interface IndicesGetDataStream extends Generic {
name?: string | string[];
}
export interface IndicesGetFieldMapping extends Generic { export interface IndicesGetFieldMapping extends Generic {
fields: string | string[]; fields: string | string[];
index?: string | string[]; index?: string | string[];
@ -1745,6 +1726,19 @@ export interface IlmStart extends Generic {
export interface IlmStop extends Generic { export interface IlmStop extends Generic {
} }
export interface IndicesCreateDataStream<T = RequestBody> extends Generic {
name: string;
body?: T;
}
export interface IndicesDataStreamsStats extends Generic {
name?: string | string[];
}
export interface IndicesDeleteDataStream extends Generic {
name: string | string[];
}
export interface IndicesFreeze extends Generic { export interface IndicesFreeze extends Generic {
index: string; index: string;
timeout?: string; timeout?: string;
@ -1755,6 +1749,10 @@ export interface IndicesFreeze extends Generic {
wait_for_active_shards?: string; wait_for_active_shards?: string;
} }
export interface IndicesGetDataStream extends Generic {
name?: string | string[];
}
export interface IndicesReloadSearchAnalyzers extends Generic { export interface IndicesReloadSearchAnalyzers extends Generic {
index: string | string[]; index: string | string[];
ignore_unavailable?: boolean; ignore_unavailable?: boolean;

View File

@ -2678,52 +2678,6 @@ link:{ref}/indices-create-index.html[Documentation] +
|=== |===
=== indices.createDataStream
*Stability:* experimental
[source,ts]
----
client.indices.createDataStream({
name: string,
body: object
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string` - The name of the data stream
|`body`
|`object` - The data stream definition
|===
=== indices.dataStreamsStats
*Stability:* experimental
[source,ts]
----
client.indices.dataStreamsStats({
name: string | string[],
expand_wildcards: 'open' | 'closed' | 'hidden' | 'none' | 'all',
forbid_closed_indices: boolean
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string \| string[]` - A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams
|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether to expand wildcard expression to concrete indices that are open, closed or both. +
_Default:_ `open`
|`forbid_closed_indices` or `forbidClosedIndices`
|`boolean` - If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices +
_Default:_ `true`
|===
=== indices.delete === indices.delete
[source,ts] [source,ts]
@ -2789,22 +2743,6 @@ link:{ref}/indices-aliases.html[Documentation] +
|=== |===
=== indices.deleteDataStream
*Stability:* experimental
[source,ts]
----
client.indices.deleteDataStream({
name: string | string[]
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string \| string[]` - A comma-separated list of data streams to delete; use `*` to delete all data streams
|===
=== indices.deleteIndexTemplate === indices.deleteIndexTemplate
*Stability:* experimental *Stability:* experimental
[source,ts] [source,ts]
@ -3217,22 +3155,6 @@ _Default:_ `all`
|=== |===
=== indices.getDataStream
*Stability:* experimental
[source,ts]
----
client.indices.getDataStream({
name: string | string[]
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string \| string[]` - A comma-separated list of data streams to get; use `*` to get all data streams
|===
=== indices.getFieldMapping === indices.getFieldMapping
[source,ts] [source,ts]
@ -7132,6 +7054,58 @@ client.ilm.stop()
link:{ref}/ilm-stop.html[Documentation] + link:{ref}/ilm-stop.html[Documentation] +
=== indices.createDataStream
[source,ts]
----
client.indices.createDataStream({
name: string,
body: object
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string` - The name of the data stream
|`body`
|`object` - The data stream definition
|===
=== indices.dataStreamsStats
[source,ts]
----
client.indices.dataStreamsStats({
name: string | string[]
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string \| string[]` - A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams
|===
=== indices.deleteDataStream
[source,ts]
----
client.indices.deleteDataStream({
name: string | string[]
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string \| string[]` - A comma-separated list of data streams to delete; use `*` to delete all data streams
|===
=== indices.freeze === indices.freeze
[source,ts] [source,ts]
@ -7173,6 +7147,22 @@ _Default:_ `closed`
|=== |===
=== indices.getDataStream
[source,ts]
----
client.indices.getDataStream({
name: string | string[]
})
----
link:{ref}/data-streams.html[Documentation] +
[cols=2*]
|===
|`name`
|`string \| string[]` - A comma-separated list of data streams to get; use `*` to get all data streams
|===
=== indices.reloadSearchAnalyzers === indices.reloadSearchAnalyzers
[source,ts] [source,ts]