Este contenido no está disponible en el idioma seleccionado.

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

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.