Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/reference/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -13530,8 +13530,6 @@ Multi-target syntax is supported.
- **`master_timeout` (Optional, string | -1 | 0)**: The period to wait for the master node.
If the master node is not available before the timeout expires, the request fails and returns an error.
To indicate that the request should never timeout, set it to `-1`.
- **`timeout` (Optional, string | -1 | 0)**: The period of time to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.

## client.snapshot.create [_snapshot.create]
Create a snapshot.
Expand Down
156 changes: 156 additions & 0 deletions src/api/api/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ export default class Indices {
'expand_wildcards'
]
},
'indices.delete_data_stream_options': {
path: [
'name'
],
body: [],
query: []
},
'indices.delete_index_template': {
path: [
'name'
Expand Down Expand Up @@ -408,6 +415,13 @@ export default class Indices {
'verbose'
]
},
'indices.get_data_stream_options': {
path: [
'name'
],
body: [],
query: []
},
'indices.get_field_mapping': {
path: [
'fields',
Expand Down Expand Up @@ -559,6 +573,13 @@ export default class Indices {
'timeout'
]
},
'indices.put_data_stream_options': {
path: [
'name'
],
body: [],
query: []
},
'indices.put_index_template': {
path: [
'name'
Expand Down Expand Up @@ -1564,6 +1585,51 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Deletes the data stream options of the selected data streams.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
*/
async deleteDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async deleteDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async deleteDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async deleteDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['indices.delete_data_stream_options']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
querystring[key] = params[key]
}
}

const method = 'DELETE'
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_options`
const meta: TransportRequestMetadata = {
name: 'indices.delete_data_stream_options',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Delete an index template. The provided <index-template> may contain multiple template names separated by a comma. If multiple template names are specified then there is no wildcard support and the provided names should match completely with existing templates.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-index-template | Elasticsearch API documentation}
Expand Down Expand Up @@ -2377,6 +2443,51 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Returns the data stream options of the selected data streams.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
*/
async getDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['indices.get_data_stream_options']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
querystring[key] = params[key]
}
}

const method = 'GET'
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_options`
const meta: TransportRequestMetadata = {
name: 'indices.get_data_stream_options',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Get mapping definitions. Retrieves mapping definitions for one or more fields. For data streams, the API retrieves field mappings for the stream’s backing indices. This API is useful if you don't need a complete mapping or if an index mapping contains a large number of fields.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping | Elasticsearch API documentation}
Expand Down Expand Up @@ -3049,6 +3160,51 @@ export default class Indices {
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Updates the data stream options of the selected data streams.
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/index.html | Elasticsearch API documentation}
*/
async putDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async putDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async putDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async putDataStreamOptions (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['indices.put_data_stream_options']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
querystring[key] = params[key]
}
}

const method = 'PUT'
const path = `/_data_stream/${encodeURIComponent(params.name.toString())}/_options`
const meta: TransportRequestMetadata = {
name: 'indices.put_data_stream_options',
pathParts: {
name: params.name
}
}
return await this.transport.request({ path, method, querystring, body, meta }, options)
}

/**
* Create or update an index template. Index templates define settings, mappings, and aliases that can be applied automatically to new indices. Elasticsearch applies templates to new indices based on an wildcard pattern that matches the index name. Index templates are applied during data stream or index creation. For data streams, these settings and mappings are applied when the stream's backing indices are created. Settings and mappings specified in a create index API request override any settings or mappings specified in an index template. Changes to index templates do not affect existing indices, including the existing backing indices of a data stream. You can use C-style `/* *\/` block comments in index templates. You can include comments anywhere in the request body, except before the opening curly bracket. **Multiple matching templates** If multiple index templates match the name of a new index or data stream, the template with the highest priority is used. Multiple templates with overlapping index patterns at the same priority are not allowed and an error will be thrown when attempting to create a template matching an existing index template at identical priorities. **Composing aliases, mappings, and settings** When multiple component templates are specified in the `composed_of` field for an index template, they are merged in the order specified, meaning that later component templates override earlier component templates. Any mappings, settings, or aliases from the parent index template are merged in next. Finally, any configuration on the index request itself is merged. Mapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration. If a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one. This recursive merging strategy applies not only to field mappings, but also root options like `dynamic_templates` and `meta`. If an earlier component contains a `dynamic_templates` block, then by default new `dynamic_templates` entries are appended onto the end. If an entry already exists with the same key, then it is overwritten by the new definition.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template | Elasticsearch API documentation}
Expand Down
3 changes: 1 addition & 2 deletions src/api/api/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ export default class Snapshot {
'indices'
],
query: [
'master_timeout',
'timeout'
'master_timeout'
]
},
'snapshot.create': {
Expand Down
7 changes: 2 additions & 5 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33941,16 +33941,13 @@ export interface SnapshotCloneRequest extends RequestBase {
* If the master node is not available before the timeout expires, the request fails and returns an error.
* To indicate that the request should never timeout, set it to `-1`. */
master_timeout?: Duration
/** The period of time to wait for a response.
* If no response is received before the timeout expires, the request fails and returns an error. */
timeout?: Duration
/** A comma-separated list of indices to include in the snapshot.
* Multi-target syntax is supported. */
indices: string
/** All values in `body` will be added to the request body. */
body?: string | { [key: string]: any } & { repository?: never, snapshot?: never, target_snapshot?: never, master_timeout?: never, timeout?: never, indices?: never }
body?: string | { [key: string]: any } & { repository?: never, snapshot?: never, target_snapshot?: never, master_timeout?: never, indices?: never }
/** All values in `querystring` will be added to the request querystring. */
querystring?: { [key: string]: any } & { repository?: never, snapshot?: never, target_snapshot?: never, master_timeout?: never, timeout?: never, indices?: never }
querystring?: { [key: string]: any } & { repository?: never, snapshot?: never, target_snapshot?: never, master_timeout?: never, indices?: never }
}

export type SnapshotCloneResponse = AcknowledgedResponseBase
Expand Down