Skip to content

Commit

Permalink
Change DELETE to POST for _bulk_delete to avoid incompatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankHassanabad committed Jan 11, 2021
1 parent 2658855 commit 2087812
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe('Detections Rules API', () => {
await deleteRules({ ids: ['mySuperRuleId', 'mySuperRuleId_II'] });
expect(fetchMock).toHaveBeenCalledWith('/api/detection_engine/rules/_bulk_delete', {
body: '[{"id":"mySuperRuleId"},{"id":"mySuperRuleId_II"}]',
method: 'DELETE',
method: 'POST',
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export const enableRules = async ({ ids, enabled }: EnableRulesProps): Promise<B
*/
export const deleteRules = async ({ ids }: DeleteRulesProps): Promise<BulkRuleResponse> =>
KibanaServices.get().http.fetch<Rule[]>(`${DETECTION_ENGINE_RULES_URL}/_bulk_delete`, {
method: 'DELETE',
method: 'POST',
body: JSON.stringify(ids.map((id) => ({ id }))),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ curl -s -k \
-H 'Content-Type: application/json' \
-H 'kbn-xsrf: 123' \
-u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD} \
-X DELETE ${KIBANA_URL}${SPACE_URL}/api/detection_engine/rules/_bulk_delete \
-X POST ${KIBANA_URL}${SPACE_URL}/api/detection_engine/rules/_bulk_delete \
-d @${RULES} \
| jq .;

0 comments on commit 2087812

Please sign in to comment.