mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Documents the following APIs: * [Delete stored script][0] * [Get stored script][1] * [Get script contexts][2] * [Get script languages][3] [0]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json [1]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json [2]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/get_script_context.json [3]: https://github.com/elastic/elasticsearch/blob/master/rest-api-spec/src/main/resources/rest-api-spec/api/get_script_languages.json
48 lines
1,013 B
Text
48 lines
1,013 B
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": """
|
|
TimestampHour date = doc['@timestamp'].value;
|
|
return date.getHour()
|
|
"""
|
|
}
|
|
}
|
|
----
|
|
////
|
|
|
|
[source,console]
|
|
----
|
|
DELETE _scripts/my-stored-script
|
|
----
|
|
// TEST[continued]
|
|
|
|
[[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]
|