For instance, I can parse through the string returned via:
{code}AdminConfig.getid('/Server:myServer/'){code}
and get the info I want, but I'm hoping there is a better way along the lines of:
{code}AdminConfig.list('Node', AdminConfig.getid('/Server:myServer/'){code}
Obviously the above doesn't work, but hopefully you get the idea. I'm limited to AdminConfig, since the servers I am directly concerned with are un-managed web server definitions in the configuration.
Any insight would be greatly appreciated!
Thanks,
Josh
How about this?
def getNodeNameForServer(nm):
nodes = AdminConfig.list("Node").split(lf)
for node in nodes:
nodeServers = AdminConfig.list("Server", node).split(lf)
for nodeServer in nodeServers:
sname = AdminConfig.showAttribute(nodeServer, "name")
if sname == nm:
nname = AdminConfig.showAttribute(node, "name")
return nname
return None
FYI,
Steve Warsa
The "node=" designation is unnecessary. I assume this is only true as long as you do not have duplicate names on each node. Since in my case, all of our servers have unique names across our nodes, I was able to change to using:
{code}-MapModulesToServers [[ myApp.war myApp.war,WEB-INF/web.xml
WebSphere:cell=MyCell,cluster=MyCluster+WebSphere:cell=MyCell,server=MyWebServer1+
WebSphere:cell=MyCell,server=MyWebServer2 ]]{code}
And achieved the desired results.
Thanks to any that spent a little time thinking about this one!
Josh