Teiid does not provide deleting resource-adapters. Teiid controls the "connection" portion of the resources. Deleting the whole resource-adapter is akin to deleting a JDBC driver in the case of datasources. You can easily do this using CLI. You it is possible to add extensions to the admin api to do also.
Thank you, Ramesh.
Ok, so we think in another way.
To reuse that resource-adapter, which API should we use to create connection portion, but not re-create the same resource-adapter?
We tried Admin.createDataSource( ), it always complains the data source already exists. So looks like we need to use a different API to create connection portion only.
There is no API function to add "resource-adapter", just like there is no API function to define a jdbc driver. You can deploy a JDBC driver or you can deploy a resource-adapter (.rar) file using "deploy", and use the names of the files as the module names for creating the data sources on top of it.
But, there is bug in the JBoss AS7, that only allows one connection per .rar file, to workaround it, we manually defined "resource-adapter" definitions in the configurations and add data sources on it using the API multiple times.