1
0

scripting.asciidoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. [discrete]
  2. [[breaking_80_scripting_changes]]
  3. ==== Scripting changes
  4. //NOTE: The notable-breaking-changes tagged regions are re-used in the
  5. //Installation and Upgrade Guide
  6. //tag::notable-breaking-changes[]
  7. .The `JodaCompatibleDateTime` class has been removed.
  8. [%collapsible]
  9. ====
  10. *Details* +
  11. As a transition from Joda datetime to Java datetime, scripting used
  12. an intermediate class called `JodaCompatibleDateTime`. This class has
  13. been removed and is replaced by `ZonedDateTime`. Any use of casting
  14. to a `JodaCompatibleDateTime` in a script will result in a compilation
  15. error, and may not allow the upgraded node to start.
  16. *Impact* +
  17. Before upgrading, replace `getDayOfWeek` with `getDayOfWeekEnum().value` in any
  18. scripts. Any use of `getDayOfWeek` expecting a return value of `int` will result
  19. in a compilation error or runtime error and may not allow the upgraded node to
  20. start.
  21. ====
  22. .Stored scripts no longer support empty scripts or search templates.
  23. [%collapsible]
  24. ====
  25. *Details* +
  26. The {ref}/create-stored-script-api.html[create or update stored script API]'s
  27. `source` parameter cannot be empty.
  28. *Impact* +
  29. Before upgrading, use the {ref}/delete-stored-script-api.html[delete stored
  30. script API] to delete any empty stored scripts or search templates.
  31. In 8.0, {es} will drop any empty stored scripts or empty search templates from
  32. the cluster state. Requests to create a stored script or search template with
  33. an empty `source` will return an error.
  34. ====
  35. .The create or update stored script API's `code` parameter has been removed.
  36. [%collapsible]
  37. ====
  38. *Details* +
  39. The {ref}/create-stored-script-api.html[create or update stored script API]'s
  40. `code` parameter has been removed. Use the `source` parameter instead.
  41. *Impact* +
  42. Discontinue use of the `code` parameter. Requests that include the parameter
  43. will return an error.
  44. ====
  45. // end::notable-breaking-changes[]