I am using the below script to retrieve the datasource properties.
try:
for server in AdminConfig.list('Server').splitlines():
serverName = AdminConfig.showAttribute(server, 'name')
serverType = AdminConfig.showAttribute(server, 'serverType')
findIndex = serverName.find('myservers')
if findIndex > 0 and serverType == 'APPLICATION_SERVER':
dsList = AdminConfig.list('DataSource', server).splitlines()
for ds in dsList:
# Get the database details for this data source
dbName = AdminConfig.showAttribute(ds, 'jndiName')
try: propSet = AdminConfig.showAttribute(ds, 'propertySet')
except:
print 'Error getting propertySet:'
else:
propList = AdminConfig.list('J2EEResourceProperty', propSet).splitlines()
for prop in propList:
print AdminConfig.showAttribute(prop, 'name') + '-' + AdminConfig.showAttribute(prop, 'value')
# Get the jaas authentication details for this data source
try: jaasAuthDataSet = AdminConfig.list("JAASAuthData", ds).splitlines()
except:
print 'Error getting Jaas Authentication data'
else:
for jaasAuthData in jaasAuthDataSet:
print AdminConfig.showAttribute(jaasAuthData, "alias")
except AdminException, ex:
print 'Admin Config not available:' + ex
return None
However in the datasource property set i am not able to get the authdatalias
property, which defines the component managed authdata alias.
Also i tried to get the JAASAuthData
for the Datasource
using the below, but without any results:
AdminConfig.list("JAASAuthData", ds).splitlines()
I am able to retrieve the list of all JAASAuthData
using the below:
for jsData in AdminConfig.list("JAASAuthData").splitlines():
print AdminConfig.showAttribute(jsData, "alias") + "-" + AdminConfig.showAttribute(jsData, "userId")
Any pointers on how this can be retrieved will be helpful. Thanks.