From 1605d00e306a94a6c1a625e63083b36305eb1ee4 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 22 Mar 2022 17:01:39 -0700 Subject: [PATCH] [DOCS] Delete cases and comments APIs --- docs/api/cases.asciidoc | 10 +-- .../api/cases/cases-api-delete-cases.asciidoc | 52 +++++++++++++++ .../cases/cases-api-delete-comments.asciidoc | 63 +++++++++++++++++++ 3 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 docs/api/cases/cases-api-delete-cases.asciidoc create mode 100644 docs/api/cases/cases-api-delete-comments.asciidoc diff --git a/docs/api/cases.asciidoc b/docs/api/cases.asciidoc index 45186a4e7d489..5aa837d35676e 100644 --- a/docs/api/cases.asciidoc +++ b/docs/api/cases.asciidoc @@ -6,9 +6,8 @@ these APIs: * {security-guide}/cases-api-add-comment.html[Add comment] * <> -* {security-guide}/cases-api-delete-case.html[Delete case] -* {security-guide}/cases-api-delete-all-comments.html[Delete all comments] -* {security-guide}/cases-api-delete-comment.html[Delete comment] +* <> +* <> * {security-guide}/cases-api-find-alert.html[Find all alerts attached to a case] * <> * {security-guide}/cases-api-find-cases-by-alert.html[Find cases by alert] @@ -29,8 +28,11 @@ these APIs: //CREATE include::cases/cases-api-create.asciidoc[leveloffset=+1] +//DELETE +include::cases/cases-api-delete-cases.asciidoc[leveloffset=+1] +include::cases/cases-api-delete-comments.asciidoc[leveloffset=+1] //FIND include::cases/cases-api-find-cases.asciidoc[leveloffset=+1] include::cases/cases-api-find-connectors.asciidoc[leveloffset=+1] //UPDATE -include::cases/cases-api-update.asciidoc[leveloffset=+1] \ No newline at end of file +include::cases/cases-api-update.asciidoc[leveloffset=+1] diff --git a/docs/api/cases/cases-api-delete-cases.asciidoc b/docs/api/cases/cases-api-delete-cases.asciidoc new file mode 100644 index 0000000000000..5e4436806f14f --- /dev/null +++ b/docs/api/cases/cases-api-delete-cases.asciidoc @@ -0,0 +1,52 @@ +[[cases-api-delete-cases]] +== Delete cases API +++++ +Delete cases +++++ + +Deletes one or more cases. + +=== Request + +`DELETE :/api/cases?ids=["",""]` + +`DELETE :/s//api/cases?ids=["",""]` + +=== Prerequisite + +You must have `all` privileges for the *Cases* feature in the *Management*, +*{observability}*, or *Security* section of the +<>, depending on the +`owner` of the cases you're deleting. + +=== Path parameters + +``:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== Query parameters + +`ids`:: +(Required, string) The cases that you want to remove. To retrieve case IDs, use +<>. ++ +NOTE: All non-ASCII characters must be URL encoded. + +==== Response code + +`204`:: + Indicates a successful call. + +=== Example + +Delete cases with these IDs: + +* `2e3a54f0-6754-11ea-a1c2-e3a8bc9f7aca` +* `40b9a450-66a0-11ea-be1b-2bd3fef48984` + +[source,console] +-------------------------------------------------- +DELETE api/cases?ids=%5B%222e3a54f0-6754-11ea-a1c2-e3a8bc9f7aca%22%2C%2240b9a450-66a0-11ea-be1b-2bd3fef48984%22%5D +-------------------------------------------------- +// KIBANA diff --git a/docs/api/cases/cases-api-delete-comments.asciidoc b/docs/api/cases/cases-api-delete-comments.asciidoc new file mode 100644 index 0000000000000..66421944ac1be --- /dev/null +++ b/docs/api/cases/cases-api-delete-comments.asciidoc @@ -0,0 +1,63 @@ +[[cases-api-delete-comments]] +== Delete comments from case API +++++ +Delete comments +++++ + +Deletes one or all comments from a case. + +=== Request + +`DELETE :/api/cases//comments` + +`DELETE :/api/cases//comments/` + +`DELETE :/s//api/cases//comments` + +`DELETE :/s//api/cases//comments/` + +=== Prerequisite + +You must have `all` privileges for the *Cases* feature in the *Management*, +*{observability}*, or *Security* section of the +<>, depending on the +`owner` of the cases you're updating. + +=== Path parameters + +``:: +(Required, string) The identifier for the case. To retrieve case IDs, use +<>. + +``:: +(Optional, string) The identifier for the comment. +//To retrieve comment IDs, use <>. +If it is not specified, all comments are deleted. + +:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== Response code + +`204`:: + Indicates a successful call. + +=== Example + +Delete all comments from case ID `9c235210-6834-11ea-a78c-6ffb38a34414`: + +[source,console] +-------------------------------------------------- +DELETE api/cases/a18b38a0-71b0-11ea-a0b2-c51ea50a58e2/comments +-------------------------------------------------- +// KIBANA + +Delete comment ID `71ec1870-725b-11ea-a0b2-c51ea50a58e2` from case ID +`a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`: + +[source,sh] +-------------------------------------------------- +DELETE api/cases/a18b38a0-71b0-11ea-a0b2-c51ea50a58e2/comments/71ec1870-725b-11ea-a0b2-c51ea50a58e2 +-------------------------------------------------- +// KIBANA