编辑WebSphere变量 - 来自wsadmin

时间:2011-06-10 09:13:52

标签: websphere

有“enviornment> WebSphere变量”。我读过如果需要我可以设置一个,使用AdminControl.setVariable等等。

但是如果我想从所有可能的范围中删除某个可验证的内容呢?我查看了互联网,发现没有任何可靠的内容。

以下内容可以帮助我: 一种遍历所有范围(集群,服务器,节点)的方法: 然后我可以查看它们,查找变量并删除它。列出所有服务器,节点和集群的任何方式?

感谢。

1 个答案:

答案 0 :(得分:1)

Modifying variables using wsadmin scriptingCommands for the AdminConfig object using wsadmin scripting上的信息中心文章开始,您希望执行以下操作:

ls = java.lang.System.getProperty("line.separator");

# List all config objects in the cell by not passing a parent config object.
varSubsts = AdminConfig.list("VariableSubstitutionEntry").split(ls)

for varSubst in varSubsts
  varName = AdminConfig.showAttribute(varSubst, "symbolicName")
  if varName == "MyVarToDelete":
    AdminConfig.remove(varSubst)