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.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.