此内容没有您所选择的语言版本。

1.3. JBoss ON CLI Scripts and JBoss ON Server Scripts


There are two major ways to access the remote API: through the JBoss ON CLI and through a separate JBoss ON server script.
The scripts themselves are more or less identical, with the exception of some methods that are available when the JBoss ON CLI is run interactively. Both CLI scripts and server-side scripts are written in JavaScript and use the remote API primarily, with support from the domain API for tasks like searches.
The main difference is in how the scripts are invoked:
  • The JBoss ON CLI can be run manually, execute a script file, and even be invoked automatically by a system tool like cron. The CLI can connect to to any JBoss ON server and can be run remotely.
    Essentially, the CLI is a script execution engine. It exposes the remote API in a scripting language, which makes it more convenient to interact dynamically the JBoss ON server.
  • Server-side scripts are uploaded into a content repository, managed in the JBoss ON server database, and are then invoked in response to a fired alert. Even though the server-side scripts are located on the server, they still use the same APIs to communicate with the server as other CLI scripts.

1.3.1. Using CommonJS with JBoss ON CLI and Server Scripts

JBoss ON also supports use of CommonJS module loading mechanism for expressing dependencies among scripts. CommonJS is supported by both the CLI and for server scripts using the require function to locate and load scripts using variables.

Important

Use of the legacy exec function in the CLI interactive session, while still supported, is not the preferred method. It is recommended to port scripts to the loading mechanisms supported by CommonJS as they are more secure, portable and extensible.
For more information about using CommonJS, a list of script sources and their compatibility with the CLI and server scripts, as well as how to locate and load scripts, refer to Section 3, “Using Script Modules for Dependencies and Loading Custom Functions”.
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat