Show Table of Contents
31.3. Scripting Metadata
Metadata may be stored in the script to provide additional information to the server on how the script is executed. This metadata is contained in a specially formatted comment on the first lines of the script.
Properties are defined as key=value pairs separated by commas, with the comment styles, such as
//, ;;, or #, depending on the scripting language in use. This information may be split over multiple lines if necessary, and single or double quotes may be used to delimit the values.
The following is an example of a valid metadata comment:
// name=test, language=javascript // mode=local, parameters=[a,b,c]
Metadata Properties
The following metadata properties are available:
mode: defines the mode of execution of a script. Can be one of the following values:local: the script will be executed only by the node handling the request. The script itself however can invoke clustered operations.distributed: runs the script using the Distributed Executor Service.
language: defines the script engine that will be used to execute the script, e.g. Javascript.extension: an alternative method of specifying the script engine that will be used to execute the script, e.g. js.role: a specific role which is required to execute the script.parameters: an array of valid parameter names for this script. Invocations which specify parameter names not included in this list will cause an exception.
As the execution mode is a characteristic of the script there is no additional configuration required on the client to invoke scripts in different modes.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.