Search code examples
pythonjythonwebsphere-8

How to list only cell scoped datasource in websphere application server using wsadmin/jython scripting?


I want to list only cell scoped data source by using the jython script. currently i can list down all the data source which is giving me cluster scoped and cell scoped both, but i am not able to segregate them.

I am using the below command to listing the datasource.

AdminConfig.list('DataSource',AdminConfig.getid('/Cell:mycell/')).splitlines()

output of this command is all the available datasources for specific cell.

Thanks in advance.


Solution

  • To get a list off all data sources that are cell scoped you will likely need to iterate through all cells like this:

    cells = AdminConfig.list('Cell').split()
    datasources = []
    for cell in cells:
        cn = AdminConfig.showAttribute(cell, 'name')
        print cn
        datasources.append(AdminConfig.list('DataSource',cell).splitlines())