forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Entity Analytics] Improve response body for asset criticality delete…
… route (elastic#189872) While doing the API docs I noticed the asset criticality delete route did not return a response body, and returned a very ugly 404 if you attempted to delete something which didnt exist... ``` {"message":"{\"_index\":\".asset-criticality.asset-criticality-default\",\"_id\":\"host.name:my_host\",\"_version\":1,\"result\":\"not_found\",\"_shards\":{\"total\":2,\"successful\":1,\"failed\":0},\"_seq_no\":0,\"_primary_term\":1}","full_error":"{\"name\":\"ResponseError\",\"message\":\"{\\\"_index\\\":\\\".asset-criticality.asset-criticality-default\\\",\\\"_id\\\":\\\"host.name:my_host\\\",\\\"_version\\\":1,\\\"result\\\":\\\"not_found\\\",\\\"_shards\\\":{\\\"total\\\":2,\\\"successful\\\":1,\\\"failed\\\":0},\\\"_seq_no\\\":0,\\\"_primary_term\\\":1}\"}","status_code":404}% ``` I have now made it so that we return a boolean for if the record was deleted or not (`false` if the record didnt exist) and we also return the record that was deleted if it was, e.g... ``` { "deleted": true, "record": { "id_field": "host.name", "id_value": "my_host", "criticality_level": "medium_impact", "@timestamp": "2024-08-05T09:42:11.240Z" } } ``` And if the record didnt exist... ``` { "deleted": false, } ``` --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
23a4e9b
commit 70a4ad4
Showing
7 changed files
with
109 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters