API Request for Tenant Identifier for Resource Groups
Summary: Jared Meidal is seeking assistance with querying the "system.tenant.identifier" for device groups via the LogicMonitor API. While they have successfully retrieved this identifier for individual devices, they encountered issues when attempting the same for device groups. Mike Moniz and Rob Sapsford suggest trying the endpoint '/device/groups/123/properties,' which seems to work for inheritable properties for Rob Sapsford. Upon further discussion, Jared Meidal realizes that they were initially querying incorrectly and confirms its functionality. Jared Meidal also expresses interest in learning how to filter groups by the system.tenant.identifier property, as well as the correct syntax for filtering a value nested in a property array.
I can query and receive the "system.tenant.identifier" with a device endpoint in the APIv3
/device/devices/1234?fields=systemProperties
But I would like to do the same through a device group. In the portal UI I can see the property assigned to all my groups. But when I make this query, I can't discover the property:
/device/groups/123
Retrieving the property per group would be much more efficient than device by device for my process.
Thanks for any knowledge in this area!
Jared Meidal
OP4 months agoanother related query is how to filter a value nested in a property array
for example:
I'd love to understand the right syntax for this
Rob Sapsford
·4 months agoHave you tried /device/groups/123/properties?
Jared Meidal
OP4 months agoThanks Rob, I just tried it and it isn't there for me either!
There are properties which are set on the group visible, but not system properties which are inherited (like the tenant property)
Rob Sapsford
·4 months ago · EditedStrange. Did you try it with no filter? When I do /device/groups/groupid/properties I do see inherited properties.
{
"type": "inherit",
"name": "system.tenant.identifier",
"value": "removed",
"inheritList": [
{
"fullpath": "removed",
"id": 100,
"value": "removed",
"type": "group"
}
]
},
Edited because apparently I can't type devices. I should stick to copy and paste.
Jared Meidal
OP4 months agoI'm sorry, this absolutely works! I was trying this without a groupID and I see the property I was looking for now
Rob Sapsford
·4 months agoExcellent!
Jared Meidal
OP4 months agomy ultimate goal is to be able to filter groups by this system.tenant.identifier property. I'm not sure if this can be constructed in a filter statement however
Rob Sapsford
·4 months agoOff the top of my head because these properties are only provided when you supply a group ID, you're going to have to pull the groups and filter in your code.
You can just pull that property for each group using simple or advanced filters.
Example basic filter:
filter=name:system.tenant.identifier
Mike Moniz
·4 months ago · EditedTry looking at /device/groups/123/properties (https://www.logicmonitor.com/swagger-ui-master/api-v3/dist/#/Device%20Groups/getDeviceGroupPropertyList). I didn't test this but looks like that is what UIv3 is using to fill in the Info tab.