运行 ObjectManager 命令
ibmcloud openpages CLI 运行 ObjectManager 命令。在运行 Microsoft Windows 操作系统的计算机上,ObjectManager 命令文件命名为 ObjectManager.cmd 。 在运行 Linux® 操作系统的计算机上,命令文件命名为 ObjectManager.sh 。
ObjectManager.sh|.cmd <command> config|c <authentication> [parameters]ObjectManager 命令行必须为:
- 从
bin目录运行。 - 在命令窗口中的单行 (无换行符) 上输入。
ObjectManager命令行参数
您可以通过 ObjectManager 工具使用各种命令和参数。
<command>- 必需。值可以是以下命令之一:
dump或d:转储(导出)数据。load或l:从单个加载器文件加载(导入)数据。validate或v:验证和确认加载器文件中的数据。batchorb: Runs ObjectManager in batch processing mode. 使用批处理模式在一次会话中加载多个加载器文件。 更多信息,请参阅批量加载器文件语法。
<authentication>- 您需要使用的身份验证方法取决于您使用的部署类型。
- IBMOpenPages云和IBM OpenPages办公场所
- 使用
<user>和<password>。 - IBM Cloud Pak® for Data
- 使用以下组合之一:
jwt和 IBM Cloud Pak for Data JSON Web 令牌 (JWT)- 您的IBM Cloud Pak for Data用户名和您的IBM Cloud Pak for DataAPI 密钥
您可在 IBM Cloud Pak for Data 中生成 API 密钥。 有关详细信息,请参阅生成用于身份验证的 API 密钥。
要查看在IBM OpenPages for IBM Cloud Pak for Data 中使用这些参数的示例,请参阅加载命令语法。
- Watsonx.governance 作为 AWS 上的一项服务
- 使用
apikey <apikey>。将
<apikey>替换为您的 API 密钥。您可以在 IBM SaaS 控制台中生成 API 密钥。 更多信息,请参阅创建 API 密钥
<loader-file-path>- 可选。
单个 XML 加载器文件的文件路径。
如果未指定文件路径,则使用当前目录。
ObjectManager.log 文件将写入该目录。
<loader-file-prefix>- 可选。
加载程序文件名的用户自定义部分。
默认情况下,如果没有指定前缀,ObjectManager 工具会尝试从文件
op-config.xml加载或写入。 <batch-loader-dir>- 使用
batch模式时必须填写。The file path to the XML loader files that are listed in the
<batch-loader-list-file>. 如果加载程序文件位于父目录下的多个子目录中,则可以使用该目录。 <batch-loader-list-file>- 使用
batch模式时必须填写。文本文件的完整文件路径和名称,该文件包含用于批处理的加载程序文件列表。
加载命令语法
data1-op-config.xml 文件夹中名为 c:\import 的加载器文件将数据导入 IBM OpenPages 文件夹。 过程
转储命令语法
c:\export 文件夹中名为 config1-op-config.xml prefix 的文件。 如果文件夹不存在,ObjectManager 工具会创建它。 过程
批量加载文件语法
批量加载器列表文件通常是一个文本(.txt)文件,其中包含供 ObjectManager 工具批量处理的 XML 加载器文件列表。
ObjectManager batch|b config|c <authentication> <batch-loader-dir> <batch-loader-list-file> - <batch-loader-dir> 是包含加载程序文件目录的完整路径。 加载器文件可以位于 <batch-loader-dir> 下的子目录中。
- <batch-loader-list-file> 是批加载器列表文件的完整路径和文件名。 该文件通常是一个
.txt文件
- 任何以数字符号(
#)开头的行都被视为注释。 - 以大于号(
>)开头的任何一行都会被写入屏幕以供显示。 - 所有其他行均假定为加载程序文件的相对路径。
# If the <batch-loader-dir> was given as
# c:\temp\myfiles, the following lines would
# write the "Loading…" message and then attempt to load the file
# c:\temp\myfiles\sample-add-user-op-config.xml
> Loading example 1…
sample-add-user
# The following lines would write the "Loading…" message and then attempt
# to load the files:
# c:\temp\loaders\samplefxrates-op-config
# c:\temp\loaders\samplecurrencyfield-op-config
# c:\temp\loaders\samplecurrencies-op-config
> Loading examples 2-4…
loaders\samplecurrencyfield
loaders\samplecurrencies
loaders\samplefxrates示例文件还显示了如何在屏幕上显示信息 loading
消息(以 > 开始的行)。
在本例中,将文件命名为 my_loader_list.txt 并保存在 c:\sample_batch\ 目录中。
my_loader_list.txt 文件来加载或导入数据。<batch-loader-dir>为 c:\temp\myfiles。\myfiles目录用于<batch-loader-dir>参数,因为它包括 sample-add-user-op-config.xml 和\loaders子目录,后者包含要加载的其他文件。<batch-loader-list-file>是批加载器列表文件的完整路径和名称。 在本例中,路径为 c:\sample_batch\my_loader_list.txt。