Query Labels from KACE API
Is this possible?
I'd like to use the API to return a set of machines for a given label. I don't see anything in the documentation that shows how one would fetch this data, if it is possible.
We'd like to use this for integration with other automation workflows in our environment.
I know how to do this using a MySQL client, but I'd prefer to use the REST API so I don't have a Sql dependency.
Can anyone point me in the right direction?
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
chucksteel
6 years ago
You want to use a filter on label.name:
/api/inventory/machines?filtering=label.name eq Library Services
In the API reference guide there is a list of Definitions at the end of the Inventory API Reference section. Those definitions define what you can use to filter the results. For instance, the machine schema contains many of the columns from the MACHINE table and this API query will return machines where the OS_Name contains macOS:
/api/inventory/machines?filtering=machine.os_name co macOS
Comments:
-
Awesome. Exactly what I need. Thanks for the answer. - ndelo 6 years ago
Posted by:
isudothings
5 years ago
If you use Powershell, there's a community written module that will query the API and return a result.
This will retrieve machines in a smart label called "D - SmartLabel - Test"