I would like to create a database of all virtual assets created and would like to automate it. Please suggest best way to do it.
Do you mean of all virtual assets created ever? Or only those virtual assets that currently exist? What do you want to be able to use such a database for? Knowing the purpose could help with suggesting ideas.
Virtual assets existing on server. Automating the process will help alleviate the effort to Maintain and update the db for the virtual assets created.
Take a look at the REST API that is available on the server, it will have information about all the currently deployed virtual assets that an automated process could consume. To use the REST API you have to run against a deployment that has a server license. For more information see these topics