mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Changes: * Updates the example Painless script to be valid and aligns it with the example in [How to write a script](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-using.html#script-stored-scripts). * Adds a hidden snippets to delete the script for cleanup. Relates to https://github.com/elastic/elasticsearch/issues/83038
50 lines
1 KiB
Text
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-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|