elasticsearch/docs/reference/scripting/apis/delete-stored-script-api.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

50 lines
1 KiB
Text

[[delete-stored-script-api]]
=== Delete stored script API
++++
<titleabbrev>Delete stored script</titleabbrev>
++++
Deletes a <<script-stored-scripts,stored script>> or <<search-template,search
template>>.
////
[source,console]
----
PUT _scripts/my-stored-script
{
"script": {
"lang": "painless",
"source": "Math.log(_score * 2) + params['my_modifier']"
}
}
----
////
[source,console]
----
DELETE _scripts/my-stored-script
----
// TEST[continued]
[[delete-stored-script-api-request]]
==== {api-request-title}
`DELETE _scripts/<script-id>`
[[delete-stored-script-api-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have the `manage`
<<privileges-list-cluster,cluster privilege>> to use this API.
[[delete-stored-script-api-path-params]]
==== {api-path-parms-title}
`<script-id>`::
(Required, string)
Identifier for the stored script or search template.
[[delete-stored-script-api-query-params]]
==== {api-query-parms-title}
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]