mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
## Summary - addresses https://github.com/elastic/security-team/issues/7198 - moves list/items indices to data stream - adds `@timestamp` mapping to indices mappings - migrate to data stream if indices already exist(for customers < 8.11) or create data stream(for customers 8.11+ or serverless) - adds [DLM](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/data-streams-put-lifecycle.html) to index templates - replaces update/delete queries with update_by_query/delete_by_query which supported in data streams - fixes existing issues with update/patch APIs for lists/items - update/patch for lists didn't save `version` parameter in ES - update and patch APIs for lists/items were identical, i.e. for both routes was called the same `update` method w/o any changes <details> <summary>Technical detail on moving API to (update/delete)_by_query</summary> `update_by_query`, `delete_by_query` do not support refresh=wait_for, [only false/true values](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/docs-update-by-query.html#_refreshing_shards_2). Which might break some of the use cases on UI(when list is removed, we refetch all lists. Deleted list will be returned for some time. [Default refresh time is 1s](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/docs-refresh.html)). So, we retry refetching deleted/updated document before finishing request, to return reindexed document `update_by_query` does not support OCC [as update API](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/optimistic-concurrency-control.html). Which is supported in both [list](https://www.elastic.co/guide/en/security/current/lists-api-update-container.html)/[list item ](https://www.elastic.co/guide/en/security/current/lists-api-update-item.html)updates through _version parameter. _version is base64 encoded "_seq_no", "_primary_term" props used for OCC So, to keep it without breaking changes: implemented check for version conflict within update method </details> ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
* Side Public License, v 1.
|
|
*/
|
|
|
|
export * from './src/bad_request_error';
|
|
export * from './src/create_boostrap_index';
|
|
export * from './src/create_data_stream';
|
|
export * from './src/decode_version';
|
|
export * from './src/delete_all_index';
|
|
export * from './src/delete_data_stream';
|
|
export * from './src/delete_index_template';
|
|
export * from './src/delete_policy';
|
|
export * from './src/delete_template';
|
|
export * from './src/encode_hit_version';
|
|
export * from './src/get_bootstrap_index_exists';
|
|
export * from './src/get_index_aliases';
|
|
export * from './src/get_index_count';
|
|
export * from './src/get_index_exists';
|
|
export * from './src/get_data_stream_exists';
|
|
export * from './src/get_index_template_exists';
|
|
export * from './src/get_policy_exists';
|
|
export * from './src/get_template_exists';
|
|
export * from './src/migrate_to_data_stream';
|
|
export * from './src/read_index';
|
|
export * from './src/read_privileges';
|
|
export * from './src/put_mappings';
|
|
export * from './src/remove_policy_from_index';
|
|
export * from './src/set_index_template';
|
|
export * from './src/set_policy';
|
|
export * from './src/set_template';
|
|
export * from './src/transform_error';
|