I would like to share with you small tip how to list all custom application-sites objects via API in reasonable time.
Why I need it?
I personally need to list all custom application site objects for internal auditing purpose. Right now there is no direct call how to list it. You can make listing simply by call "show-application-sites" and filter result by user-defined parameter, category or tag
In that case every simple call could take a long time. There is more than 8K generic application objects in database by default and I noticed such call take me approximatelly 2 minutes. If you need to take it from 30 diferent domains for example, then it could be really time consuming. Administrators don't have thousands of those objects so I don't see reason to load whole big data batch and then just drop 95% of it.
I decided to use workaround in my code to and time went down from minutes to seconds.
I'm using call "show-generic-objects" to get custom sites uids (this is not a standard call so I want to take a minimum only to avoid any unexpected result). Then I'm reading each custom site by "show-application-site"
mgmt_cli show-generic-objects class-name "com.checkpoint.objects.appfw.dummy.CpmiUserApplication" details-level uid --format json
mgmt_cli show-application-site uid "6175850c-9ad5-4f1b-b7d8-e551b4d0f0c2" details-level standard --format json
Remember to use offset and limit to list all related objects in first call.
It would be nice if we have one day a simple parameter in API to make the same work or related filter in show-objects call.