API best way to query a bunch of groups? Filter? Other?
I have a certain property on some devices, which can change from time to time. I'm identifying all devices that has it in ONE clean call with a filter for that property to get a device list. From the device list response, I'm snagging all of the unique hostGroupIds into a map. And so I've got a list of about 108 hostIds (group IDs) that I want to be instances in a custom datasource, in the Active Discovery section.
I want to pull the name and fullPath and description from all of these groups, to use for instance name enrichment. I dont want my instances named 20321, etc. But they have no property on them that makes them all available to me in one clean call. Unless there is some group filter I can do where only groups come back that have direct members, where the members have a device property. :)
I'm trying to avoid writing a propertySource to set a property on the groups. And propertySources dont even apply to groups, so I'd have to do something super ugly like make a "propertySource" or some fake configSource that ran against the portal object and pretended to do a thing, but would really find all my group folders and tag them. Nasty.
But then again, my datasource is doing the same thing ... it runs on my portal object and generates a datasource there, and only there, that will have groups as instances.
But its a bad idea to make 108 API calls (and it could be more) in my Active Discovery, to get some useful info to make the instances presentable.
So I'm wondering, if I have a list of hostIds, is it crude to just build a filter that resembles 1023|23123|12|231231|3123..... etc? And then make a call to get all the groups with a filter that could be hundreds of groupIds long? Will GETs in the API even support that many characters?
What do you think? I guess I've almost convinced myself to just do the "fake" propertySource or configSource against my portal object, and have it set customProperties on my groups for the clean pull.
I really wish propertySources existed that could target resourceGroups. Oh well. :)
What are your thoughts? How long can a filter be, anyway? :)