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

6.2. Default Locations for Script Module Sources


The require statement loads a modules from an identified location to be used in a script. The JBoss ON CLI, CLI script, or server-side script can load a module from any of several locations, for both the local and remote sources.
The require line has the format sourceType:/path/moduleFile.
The default module locations are defined in the following list.
Modules Directory
Description — Loads the specified module file from a configured location on the local system. The CLI has a system property (RHQ_CLI_MODULES_DIR) which defines a default directory for modules.
The location can be set or changed by updating the rhq-cli-env.sh file or by setting it at the command line, as shown in the examples below:
RHQ_CLI_MODULES_DIR=/opt/rhq/modules
Copy to Clipboard Toggle word wrap
RHQ_CLI_MODULES_DIR=/opt/rhq/modules; bin/rhq-cli.sh
Copy to Clipboard Toggle word wrap
Available For — CLI
Local Filesystem
Loads the specified module file from an absolute path on the local system.
Format — file:/path
Example:
var myModule = require("file:/opt/jon/js-modules/myModule"); //This will load the module from a file called "myModule.js" in the /opt/jon/js-modules directory on the local filesystem.
Copy to Clipboard Toggle word wrap
Available For — CLI
JBoss ON Repository
Downloads the specified module file from the given JBoss ON repository. Because this connects to the server, a user must be logged into the JBoss ON server first.
Format — rhq://repositories/repo_name/module_name
Example:
var myModule = require("rhq://repositories/myRepo/myModule"); //This will load the module stored in the RHQ server repository "myRepo" called "myModule.js"
Copy to Clipboard Toggle word wrap
Available for — CLI, Server
JBoss ON Downloads
Downloads the specified module file from the downloads location on the JBoss ON server. JBoss ON could make some scripts available that can be used for alert server-side scripts or for the CLI. Because this connects to the server, a user must be logged into the JBoss ON server first.
Format — rhq://downloads/path/module_name
Example:
var myModule = require("rhq://downloads/script-modules/util"); //This will load the module stored in the RHQ server downloads section called "js/util.js"
Copy to Clipboard Toggle word wrap
Available For — CLI, Server
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat