Category Archives: Uncategorized

Jython script for creating a WAS VH

ceVHName = ‘ce_wss_host’
ceVHPort = ‘10001’
# the ceVHhostname would change for each environment. currently going for *, uncomment the one to suite the environment
ceVHhostname = ‘abc.prod.com’

cName = AdminConfig.list(‘Cell’)
cellName = AdminConfig.showAttribute(cName,”name”)
cellConfigID = AdminConfig.getid(‘/Cell:’+cellName+’/’)

ceVHExist = AdminConfig.getid(‘/Cell:’ + cellName + ‘/VirtualHost:’ + ceVHName + ‘/’)

if (ceVHExist == ” ):
AdminConfig.create(‘VirtualHost’, cellConfigID, ‘[[name “‘ + ceVHName + ‘”]]’)
AdminConfig.create(‘HostAlias’, AdminConfig.getid(‘/Cell:’ + cellName + ‘/VirtualHost:”‘ + ceVHName + ‘”/’), ‘[[hostname “‘ + ceVHhostname + ‘”] [port “‘ + ceVHPort + ‘”]]’)
else:
print ‘entry already exists, exiting without doing anything..’
#end if
AdminConfig.save()