get-stored-script-api.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [[get-stored-script-api]]
  2. === Get stored script API
  3. ++++
  4. <titleabbrev>Get stored script</titleabbrev>
  5. ++++
  6. Retrieves a <<script-stored-scripts,stored script>> or <<search-template,search
  7. template>>.
  8. ////
  9. [source,console]
  10. ----
  11. PUT _scripts/my-stored-script
  12. {
  13. "script": {
  14. "lang": "painless",
  15. "source": "Math.log(_score * 2) + params['my_modifier']"
  16. }
  17. }
  18. ----
  19. ////
  20. [source,console]
  21. ----
  22. GET _scripts/my-stored-script
  23. ----
  24. // TEST[continued]
  25. ////
  26. [source,console]
  27. ----
  28. DELETE _scripts/my-stored-script
  29. ----
  30. // TEST[continued]
  31. ////
  32. [[get-stored-script-api-request]]
  33. ==== {api-request-title}
  34. `GET _scripts/<script-id>`
  35. [[get-stored-script-api-prereqs]]
  36. ==== {api-prereq-title}
  37. * If the {es} {security-features} are enabled, you must have the `manage`
  38. <<privileges-list-cluster,cluster privilege>> to use this API.
  39. [[get-stored-script-api-path-params]]
  40. ==== {api-path-parms-title}
  41. `<script-id>`::
  42. (Required, string)
  43. Identifier for the stored script or search template.
  44. [[get-stored-script-api-query-params]]
  45. ==== {api-query-parms-title}
  46. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]