mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[SIEM][Detection Engine][Lists] Adds "wait_for" to all the create, update, patch, delete endpoints
## Summary * Adds "wait_for" to all the create, update, patch, and delete endpoints * Ran some quick tests against import and the performance still looks acceptable * Updates the unit tests to reflect the addition ### Checklist - [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
This commit is contained in:
parent
e54729caf2
commit
4b4796ddbb
14 changed files with 17 additions and 0 deletions
|
@ -36,6 +36,7 @@ describe('crete_list_item', () => {
|
|||
body,
|
||||
id: LIST_ITEM_ID,
|
||||
index: LIST_ITEM_INDEX,
|
||||
refresh: 'wait_for',
|
||||
};
|
||||
expect(options.callCluster).toBeCalledWith('index', expected);
|
||||
});
|
||||
|
|
|
@ -71,6 +71,7 @@ export const createListItem = async ({
|
|||
body,
|
||||
id,
|
||||
index: listItemIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
|
@ -33,6 +33,7 @@ describe('crete_list_item_bulk', () => {
|
|||
secondRecord,
|
||||
],
|
||||
index: LIST_ITEM_INDEX,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -70,6 +71,7 @@ describe('crete_list_item_bulk', () => {
|
|||
},
|
||||
],
|
||||
index: '.items',
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -84,6 +84,7 @@ export const createListItemsBulk = async ({
|
|||
await callCluster('bulk', {
|
||||
body,
|
||||
index: listItemIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
} catch (error) {
|
||||
// TODO: Log out the error with return values from the bulk insert into another index or saved object
|
||||
|
|
|
@ -47,6 +47,7 @@ describe('delete_list_item', () => {
|
|||
const deleteQuery = {
|
||||
id: LIST_ITEM_ID,
|
||||
index: LIST_ITEM_INDEX,
|
||||
refresh: 'wait_for',
|
||||
};
|
||||
expect(options.callCluster).toBeCalledWith('delete', deleteQuery);
|
||||
});
|
||||
|
|
|
@ -28,6 +28,7 @@ export const deleteListItem = async ({
|
|||
await callCluster('delete', {
|
||||
id,
|
||||
index: listItemIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
}
|
||||
return listItem;
|
||||
|
|
|
@ -52,6 +52,7 @@ describe('delete_list_item_by_value', () => {
|
|||
},
|
||||
},
|
||||
index: '.items',
|
||||
refresh: 'wait_for',
|
||||
};
|
||||
expect(options.callCluster).toBeCalledWith('deleteByQuery', deleteByQuery);
|
||||
});
|
||||
|
|
|
@ -48,6 +48,7 @@ export const deleteListItemByValue = async ({
|
|||
},
|
||||
},
|
||||
index: listItemIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
return listItems;
|
||||
};
|
||||
|
|
|
@ -62,6 +62,7 @@ export const updateListItem = async ({
|
|||
},
|
||||
id: listItem.id,
|
||||
index: listItemIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
return {
|
||||
created_at: listItem.created_at,
|
||||
|
|
|
@ -52,6 +52,7 @@ describe('crete_list', () => {
|
|||
body,
|
||||
id: LIST_ID,
|
||||
index: LIST_INDEX,
|
||||
refresh: 'wait_for',
|
||||
};
|
||||
expect(options.callCluster).toBeCalledWith('index', expected);
|
||||
});
|
||||
|
|
|
@ -67,6 +67,7 @@ export const createList = async ({
|
|||
body,
|
||||
id,
|
||||
index: listIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
return {
|
||||
id: response._id,
|
||||
|
|
|
@ -47,6 +47,7 @@ describe('delete_list', () => {
|
|||
const deleteByQuery = {
|
||||
body: { query: { term: { list_id: LIST_ID } } },
|
||||
index: LIST_ITEM_INDEX,
|
||||
refresh: 'wait_for',
|
||||
};
|
||||
expect(options.callCluster).toBeCalledWith('deleteByQuery', deleteByQuery);
|
||||
});
|
||||
|
@ -59,6 +60,7 @@ describe('delete_list', () => {
|
|||
const deleteQuery = {
|
||||
id: LIST_ID,
|
||||
index: LIST_INDEX,
|
||||
refresh: 'wait_for',
|
||||
};
|
||||
expect(options.callCluster).toHaveBeenNthCalledWith(2, 'delete', deleteQuery);
|
||||
});
|
||||
|
|
|
@ -36,11 +36,13 @@ export const deleteList = async ({
|
|||
},
|
||||
},
|
||||
index: listItemIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
|
||||
await callCluster('delete', {
|
||||
id,
|
||||
index: listIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ export const updateList = async ({
|
|||
body: { doc },
|
||||
id,
|
||||
index: listIndex,
|
||||
refresh: 'wait_for',
|
||||
});
|
||||
return {
|
||||
created_at: list.created_at,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue