使用属性文件来删除服务器、集群、应用程序或授权组对象
使用本主题,从配置中删除服务器、集群、应用程序或授权组对象。
关于此任务
通过 AdminTask 对象的 PropertiesBasedConfiguration 命令组,您可以使用属性文件,从环境中删除配置对象。

过程
- 启动 wsadmin 脚本编制工具。
- 创建属性文件模板。 创建属性文件模板,以用于删除相关的服务器、集群、应用程序或授权组对象。使用 -configType 参数并遵循以下准则来指定要创建的模板的类型:
- 指定 Server 以创建服务器类型属性文件模板。
- 指定 ServerCluster 以创建服务器集群类型属性文件模板。
- 指定 Application 以创建应用程序类型属性文件模板。
- 指定 AuthorizationGroup 以创建授权组类型属性文件模板。
以下 Jython 示例使用 createPropertiesFileTemplates 命令来创建新的 AuthorizationGroup 对象模板:AdminTask.createPropertiesFileTemplates('[-propertiesFileName authorizationGroup.template -configType AuthorizationGroup]')
此命令会生成类似以下样本模板的模板文件:# # Delete parameters # Replace the line 'SKIP=true' with 'SKIP=false' under each section that is needed # Set necessary parameters under each command or step sections # Invoke deleteConfigProperties command using this properties file. # ResourceType=AuthorizationGroup ImplementingResourceType=AuthorizationGroup ResourceId=AuthorizationGroup= SKIP=true CreateDeleteCommandProperties=true # # #Properties # authorizationGroupName=authorizationGroupName #String,required commandName=deleteAuthorizationGroup
- 修改新的模板文件。
通过设置必需参数来修改新的 AuthorizationGroup 模板文件。您也可以修改可选参数,但必须修改必需参数。
将 SKIP 必需属性值从 SKIP=true 更改为 SKIP=false,以指示系统应该将属性文件的特定部分中的属性应用到配置。要忽略属性文件的特定部分,请将 SKIP 属性设置为 SKIP=true。# # Delete parameters # Replace the line `SKIP=true` with 'SKIP=false' under each section that is needed # Set necessary parameters under each command or step sections # Invoke deleteConfigProperties command using this properties file. # ResourceType=AuthorizationGroup ImplementingResourceType=AuthorizationGroup ResourceId=AuthorizationGroup=authorizationGroupName SKIP=false CreateDeleteCommandProperties=true # # #Properties # authorizationGroupName=authorizationGroupName #String,required commandName=deleteAuthorizationGroup
- 从配置中除去对象。 使用 deleteConfigProperties 命令,从配置中除去现有 AuthorizationGroup 对象,如以下 Jython 示例所示:
AdminTask.deleteConfigProperties('[-propertiesFileName authorizationGroup.template]')
此命令会除去配置中的 ag1 授权组。
- 保存配置更改。 请使用以下命令示例来保存配置更改:
AdminConfig.save()
相关任务:


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_7delpropobjects
文件名:txml_7delpropobjects.html